[Python-ideas] Geo coordinates conversion in stdlib

Mark Lawrence breamoreboy at yahoo.co.uk
Mon Mar 23 09:51:09 CET 2015


On 23/03/2015 06:08, anatoly techtonik wrote:
> On Mon, Mar 23, 2015 at 1:37 AM, Andrew Barnert
> <abarnert at yahoo.com.dmarc.invalid> wrote:
>> On Mar 22, 2015, at 2:38 PM, Antoine Pitrou <solipsis at pitrou.net> wrote:
>>>
>>> On Sun, 22 Mar 2015 17:15:39 -0400
>>> Alexander Walters
>>> <tritium-list at sdamon.com> wrote:
>>>>> On 3/21/2015 05:46, anatoly techtonik wrote:
>>>>> I think it should be in stdlib.
>>>>>
>>>>> 11° 18′ 0″ S, 2° 42′ 0″ E   to  -11.3, 2.7  and back.
>>>>>
>>>>> This is from Wikipedia.
>>>> Why does this need to be in the standard library?
>>>
>>> Because Anatoly needs it, of course :)
>>
>> Well, it would certainly be nice to have all of Wikipedia in the stdlib, but I wonder how that would affect Python's release schedule, and its use in resource-constrained systems.
>>
>> More seriously, if you're just looking to convert arcminutes and arcseconds to and from fractional degrees, it's exactly the same algorithm as converting minutes and seconds to fractional hours, which we already have in the datetime.timedelta class. If you can't figure out the complexity of multiplying and divmodding by 60 twice, you can borrow its code, or just wrap it and delegate. That seems trivial enough to do in any project that needs it. And that means projects that want degrees-arcminutes-arcseconds-milliarcseconds (e.g., for astronomy) or just degrees and fractional arcminutes with no arcseconds (e.g., for marine navigation) or degrees, arcminutes, and eighth-arcminutes (e.g., for US military scopes) can just as easily get what they need, instead of being forced to use the variation surveyors prefer.
>
> That's nice to know, but IIRC datetime is from the top 10 Python
> modules that need a redesign.

I'm looking forward to seeing your redesign for all 10 modules on the 
bug tracker.  Can you get this done in time for 3.5 beta?

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence



More information about the Python-ideas mailing list