Marker/Waypoint Ordering rfc7946 1.4

Richard Collette

I absolutely love this site having discovered it a week ago or so.   I have been creating a 5Mi hiking map for use by Scouts to fulfill their Second Class rank requirements.

I created a quick and dirty Angular application to generate a waypoint bearing and distance list, the meat of the calculations being here

I notice on the Caltopo site that markers are ordered alphabetically, but in the exported GeoJSON the markers are not sorted in the same order.  Hence I added sorting to my app above.

I sorted the markers externally and re-imported, and they seemed to get shuffled around when I export again.

The geojson specification states

(last bullet point)

The word "Collection" in "FeatureCollection" and
      "GeometryCollection" does not have any significance for the
      semantics of array members.  The "features" and "geometries"
      members, respectively, of these objects are standard ordered JSON
      arrays, not unordered sets.

So the spec states that FeatureCollections are to be treated as ordered, not unordered sets.

That being the case, it would be great if marker order could be preserved on export/import.  Additionally, an ability to reorder the points, using  drag/drop would be fantastic.  Although not part of the spec, having an ability to assign an ordinal value to use for sorting might be helpful as well.

Thank you.




  • Comment author
    Marc Chauvin

    The marker order in the json is determined by when the marker was created. In the display it will order alphanumeric by title/label. When I have needed to order things programmatically I do as you did and have the program use the title.

  • Comment author
    Richard Collette

    But when I import a set of waypoints, and then export again, the order of the exported waypoints is neither alphabetical, nor in the order that they where when I imported them.  They also aren't in reverse order.   Something else is happening.


Please sign in to leave a comment.