Is there anyway to take an unordered set of placemarks in a KML file and add a linear order to them?

By linear order I mean add a numeric number so that each placemark has an order in the group of placemarks. This will essentially turn the placemarks into a ordered path.

I'm willing to use any program to import the KML file to do these operations however it has to have a GUI so that semi-technical people can do it. (i.e. people without knowledge of xml)

1 Answer 1


If you path does not loop back on itself but has a fairly consistent direction you can make an id based on the coordinates. I would use your GIS (ArcGIS) to open the data and convert to a 'standard' gis format (e.g. shapefile) so you can manipulate the data easily without corrupting your original file. Then I'd create a text attribute that concatenates the x and y coordinates of each point (but cast as strings and concatenated, not simply added as numbers). If the predominant direction is east-west, then I would concatenate x||y. If it is north-south, I would concatenate y||x.

If your path loops back on itself, this will not work, but perhaps, your points have a timestamp, in which case you can simple use that. Alternatively, if your points were digitized in order in Google MyMap or Google Earth, then they will be in order in your data. So you can create a new attribute and set it to be the rownumber, which will give you an ordered id attribute reflecting the order of digitizing the points.

If the points were created in a more random fashion and loop back on themselves, then there is nothing for it but to manually ascribe an attribute (either in Google Earth or ArcMap).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.