Best way to store positions

5 views
Skip to first unread message

mikemcc

unread,
Jul 2, 2009, 7:14:52 PM7/2/09
to KML Developer Support - KML Server Side Scripting
Having started my server-side programming with the tutorial on how to
create kml using mysql and php, I am storing all my placemarks'
positions in lat and long. However I'm wondering whether it's best to
store positions as one long-lat value because sometimes positions of
places are made available only as a combined value.

Any advice please on that ?

Also, can anyone provide Excel formulae to convert long,lat,altitude
like
-79.02144217999999,41.65201754000002,0
into separate long and lat values ?

When the above value is in cell B, I have got the long values in cell
C by using
=LEFT($B1;SEARCH(",";$B1)-1)
and the lat values by first getting the lat,alt value in cell D with
=MID($B1;SEARCH(",";$B1)+1;LEN($B1)-LEN($C1))
and then I got the lat value using
=LEFT($D1;SEARCH(",";$D1)-1)
but the results are text and I can't use Excel help's method of
converting text to numbers.

Perhaps I should use php ?

Maarten L

unread,
Jul 3, 2009, 5:52:34 PM7/3/09
to KML Developer Support - KML Server Side Scripting
I think you should store lat and long seperately: sometimes it is
necesarry to reference a place as long,lat instead of lat,long. Also,
if you want to make calculations and conversions, you'll need seperate
values.
Your second question doesn't really belong on this forum, I think the
answer to your question depends on your version of Excel and your OS.
Using php instead of Excel depends on your knowledge of both.
Reply all
Reply to author
Forward
0 new messages