Log in

View Full Version : Latitude Longitude entry


Chris W
September 3rd 06, 10:14 PM
This is off topic but something that I think pilots can appreciate.

I am working on a web site that will require the entry of latitude
longitude coordinates. As you probably know there area lot of
different ways to format latitude and longitude. I have done my best to
make my code work no mater what format you use. If you have some time
and would like to try it, I want to know if anyone can break it. If you
do, please send me the data you used to break it, so I can figure out
why it broke and fix it. Below is the URL for the test. The web site
it is currently on is not the web site it is for, that is just where I
am doing the testing until I get a server set up for the new site.

http://www.thewishzone.com/LatLonTest.php

P.S. If anyone wants a copy of the code I wrote to do this, let me know
and I will email it to you.


--
Chris W
KE5GIX

Gift Giving Made Easy
Get the gifts you want &
give the gifts they want
One stop wish list for any gift,
from anywhere, for any occasion!
http://thewishzone.com

J. Severyn
September 5th 06, 01:13 AM
Great Job Chris.

The is one of my pet peeves. Different maps, different users, etc do not
use consistent formats. My GPS will accept input in different formats, but
many times I've entered coordinates in one format when the GPS was set for
entry in a different format. I'm always pulling coordinates from topo maps
or other sources and I must not forget to do the conversion to make the
entries consistent. (or keep flipping the GPS to accept the different
formats)

The only comment I might make: It might be useful to catch a case of
mistaken mixed entry such as: 30.3 45 56 which results in a value
greater than 31 degrees. This would catch the improper entry before the
data is used, as once it is converted, might make finding the error
difficult.

Sure, I'd like to see the code if possible.

Remove the ".cutout" for my true email address.

Regards,
John Severyn
@KLVK

"Chris W" > wrote in message
news:HAHKg.9416$JR5.1674@dukeread11...
> This is off topic but something that I think pilots can appreciate.
>
> I am working on a web site that will require the entry of latitude
> longitude coordinates. As you probably know there area lot of different
> ways to format latitude and longitude. I have done my best to make my
> code work no mater what format you use. If you have some time and would
> like to try it, I want to know if anyone can break it. If you do, please
> send me the data you used to break it, so I can figure out why it broke
> and fix it. Below is the URL for the test. The web site it is currently
> on is not the web site it is for, that is just where I am doing the
> testing until I get a server set up for the new site.
>
> http://www.thewishzone.com/LatLonTest.php
>
> P.S. If anyone wants a copy of the code I wrote to do this, let me know
> and I will email it to you.
>
>
> --
> Chris W
> KE5GIX
>
> Gift Giving Made Easy
> Get the gifts you want &
> give the gifts they want
> One stop wish list for any gift,
> from anywhere, for any occasion!
> http://thewishzone.com

September 5th 06, 02:06 AM
J. Severyn wrote:
> Great Job Chris.
>
> The is one of my pet peeves. Different maps, different users, etc do not
> use consistent formats. My GPS will accept input in different formats, but
> many times I've entered coordinates in one format when the GPS was set for
> entry in a different format. I'm always pulling coordinates from topo maps
> or other sources and I must not forget to do the conversion to make the
> entries consistent. (or keep flipping the GPS to accept the different
> formats)
>
> The only comment I might make: It might be useful to catch a case of
> mistaken mixed entry such as: 30.3 45 56 which results in a value
> greater than 31 degrees. This would catch the improper entry before the
> data is used, as once it is converted, might make finding the error
> difficult.
>
> Sure, I'd like to see the code if possible.
>
> Remove the ".cutout" for my true email address.
>
> Regards,
> John Severyn
> @KLVK
>
> "Chris W" > wrote in message
> news:HAHKg.9416$JR5.1674@dukeread11...
> > This is off topic but something that I think pilots can appreciate.
> >
> > I am working on a web site that will require the entry of latitude
> > longitude coordinates. As you probably know there area lot of different
> > ways to format latitude and longitude. I have done my best to make my
> > code work no mater what format you use. If you have some time and would
> > like to try it, I want to know if anyone can break it. If you do, please
> > send me the data you used to break it, so I can figure out why it broke
> > and fix it. Below is the URL for the test. The web site it is currently
> > on is not the web site it is for, that is just where I am doing the
> > testing until I get a server set up for the new site.

Sure:- I had a bit of trouble with this recently figuring out
what google earth would accept.

http://www.multimap.com/map/
browse.cgi?lat=51.4829&lon=-0.1009
&scale=10000&icon=x


lat=51.4829 lon=-0.1009 BAD
51.4829 -0.1009 OK
51.4829 N 0.1009 W OK
51:28:58N 0:06:03W OK

Lat: 51:28:58N (51.4829) Lon: 0:06:03W (-0.1009) OK WOW!!!
Lat: 51:28:58N Lon: 0:06:03W OK



40° 4'50.36"N 96° 9'40.26"W
N/W disappeared from input boxes on processing
OK though. Google Earth.
This looks pretty nice, just tried a few and they almost all worked.

Sylvain
September 5th 06, 04:48 AM
wrote:

> Sure:- I had a bit of trouble with this recently figuring out
> what google earth would accept.

note about Google Map; they'll take the decimal degrees form, but
beware of the convention they use for East/West longitude: West
longitudes are expressed as a negative number (as opposed to the
frequently used opposite);

also, doing spherical trigonometry is a lot of fun (I am toying
with such applications these days), but beware of the effects
of rounding errors, the formula right off the books won't always
produce the intended results! :-)) (a classical one is to make
sure you don't feed acos or asin with numbers greater than one
or smaller than minus one -- but there are plenty of other gotchas :-)

--Sylvain

Chris W
September 5th 06, 03:33 PM
Sylvain wrote:
> wrote:
>
>
>>Sure:- I had a bit of trouble with this recently figuring out
>>what google earth would accept.
>
>
> note about Google Map; they'll take the decimal degrees form, but
> beware of the convention they use for East/West longitude: West
> longitudes are expressed as a negative number (as opposed to the
> frequently used opposite);

West as positive is "frequently" used only by people in the US who like
to *ignore* standards and are to lazy to include the negative sign.
Which makes both lat and long positive in all but a few of the Aleutian
Islands.


--
Chris W
KE5GIX

Gift Giving Made Easy
Get the gifts you want &
give the gifts they want
One stop wish list for any gift,
from anywhere, for any occasion!
http://thewishzone.com

Grumman-581[_3_]
September 6th 06, 08:57 PM
"Chris W" > wrote in message
news:HAHKg.9416$JR5.1674@dukeread11...
> If you have some time and would like to try it, I want
> to know if anyone can break it. If you do, please send
> me the data you used to break it, so I can figure out
> why it broke and fix it.

n234521.123
w954521.123

using the ddmmss.sss format for the longitude, it chokes on two digit
longitudes... It does work if you put a leading zero on the longitude or if
it is a 3-digit one...

Same thing happens with longitudes of the format ddmm.mmm instead of using
ddd.mm.mmm...

Chris W
September 8th 06, 05:09 AM
Grumman-581 wrote:
> "Chris W" > wrote in message
> news:HAHKg.9416$JR5.1674@dukeread11...
>
>>If you have some time and would like to try it, I want
>>to know if anyone can break it. If you do, please send
>>me the data you used to break it, so I can figure out
>>why it broke and fix it.
>
>
> n234521.123
> w954521.123
>
> using the ddmmss.sss format for the longitude, it chokes on two digit
> longitudes... It does work if you put a leading zero on the longitude or if
> it is a 3-digit one...
>


Well let's think about this.

What if it is 5degrees do you want to do it like this..... dmm.mmmmm?
How do could the system possibly distinguish that from ddd.ddddd?
Obviously it can not. Then what about say 1 degree 3 minutes dm.mmmm?
Just move evidence of why that can't be done. If you want a format with
out any kind of separator between the degrees minutes and seconds all
fields have to be of fixed width and since longitude goes from -180 to +
180 you need to have it be dddmmss.sss or dddmmm.mmmm And since
Latitude is -90 to +90 ddmmss.ss or ddmm.mmmm is the only way to go. It
is my understanding the ddmmss.ss or ddmm.mmmmm for Latitude and
dddmmss.ss or dddmm.mmmm for longitude are standard formats in the GIS
software industry. However I would think since the web site this code
is for is not targeted at GIS professionals, most users will have
something separating the degrees minutes and seconds like dd mm ss.ss


--
Chris W
KE5GIX

Gift Giving Made Easy
Get the gifts you want &
give the gifts they want
One stop wish list for any gift,
from anywhere, for any occasion!
http://thewishzone.com

Google