Hi all!
I'd like to know what would be the best way to parse an kml for coordinates, pull them out and place them in a .json file. I'm running Ubuntu 10.11.
Scripting? Perl? What do you think?
idea is:
Read KML file, parse out the coordinates of th first point, count how many times that point appears in the file and output in the following sequence without spaces:
[["FilenameWihoutExt",[Lat,Long,#OccurencesDivededBy10,000,Lat,Long,#OccurencesDivededBy10,000,Lat,Long,#OccurencesDivededBy10,000,]]]
and then output to a text file such as:
This is for my 3D earth. An experimental webgl project by Chrome. http://www.chromeexperiments.com/globe
Thanks in advance!
I'd like to know what would be the best way to parse an kml for coordinates, pull them out and place them in a .json file. I'm running Ubuntu 10.11.
Scripting? Perl? What do you think?
idea is:
Read KML file, parse out the coordinates of th first point, count how many times that point appears in the file and output in the following sequence without spaces:
[["FilenameWihoutExt",[Lat,Long,#OccurencesDivededBy10,000,Lat,Long,#OccurencesDivededBy10,000,Lat,Long,#OccurencesDivededBy10,000,]]]
Code:
KML sample:
<Folder>
<name>Placemarks</name>
<Placemark>
<name>Ireland</name>
<description>Trip to Ireland</description>
<Point>
<coordinates>-73.5833,45.5</coordinates>
</Point>
</Placemark>
and then output to a text file such as:
Code:
[["UnitedKingodom",[-73.5833,45.5,0.001,-122.083469,37.42222,0.080,-122.084075,37.4210039,0.050,-76.488393,44.33,003]]]
This is for my 3D earth. An experimental webgl project by Chrome. http://www.chromeexperiments.com/globe
Thanks in advance!