[GRASS-dev] D:M:Sh to decimal degrees fn in python

Hi,

before starting the port from C, has anyone written a D:M:Sh to decimal
degrees function in python? This is for the location wizard region
setting page, but would go in the main core.py or gui_modules/utils.py so
available to anything that wants it.

alternately (preferably?) I could easily use G_lat_scan() etc. via Swig,
but I'm not sure how welcome swig is in the main pyGUIs. (I suspect not)

hmmm, actually I don't think it is needed; we can just test the string
for basic syntax and then just write it out as-is.

Hamish

Hamish wrote:

before starting the port from C, has anyone written a D:M:Sh to decimal
degrees function in python? This is for the location wizard region
setting page, but would go in the main core.py or gui_modules/utils.py so
available to anything that wants it.

float_or_dms() in core.py.

--
Glynn Clements <glynn@gclements.plus.com>

Hamish wrote:

has anyone written a D:M:Sh to decimal degrees function in python?

Glynn wrote:

float_or_dms() in core.py.

ah, thanks. missed it there way down at the end of the file.

it still needs some work to handle a trailing hemisphere letter, but
otherwise does the trick.

Hamish