Hi.

I am the President of the NZ Recreational GPS Society. As such, all of our members have access to much information in WGS-84 lat/long.

I have just installed location.module and discovered that the only apparent means of entering location information is via addresses. It would be extremely useful to us if when configuring a content type, that it was possible to have the Do Not Collect/Allow/Require option for entering WGS-84 lat/longs - in effect exposing the lat/long directly to the users.

If doing so, it should be possible for the administrator to determine the default format e.g. these are the three most common... (eventually it might be nice to allow users to configure it to their preference)

* +/-[d]dd.ddddd
* +/-[d]dd mm.mmm (this is the default on most consumer GPS units, and the one we would use)
* +/-[d]dd mm ss

For input, it is actually relatively easy to support all three formats for entry with no form magic. You take the text entered, explode it by spaces " ", and then add them together. So -43.50000 can also be entered as -43 30.000 and -43 30 00 from one simple text field.

Excuse the ugly pseudo-code, and naturally you have to check for the negative, and multiply any minutes and seconds by -1 to make sure minutes/seconds are subtracted properly.

$pieces = explode(" ",$lat_form);
$lat = $pieces[0] + ($pieces[0]/abs($pieces[0])*($pieces[1]/60) + ($pieces[0]/abs($pieces[0])*($pieces[2]/3600);

Alas, I know just enough php to be dangerous, but not enough to probably do it myself. I more more than happy to help with testing etc.

Cheers Gav

Comments

rediguana’s picture

Ah, I see that this has already been raised, I still think that lat/long should be available using the same options as other location fields though, so I'll leave this open.

catch’s picture

Status: Active » Closed (duplicate)