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.
https://caltopo.com/m/10VK4

I created a quick and dirty Angular application to generate a waypoint bearing and distance list, the meat of the calculations being here
https://github.com/rcollette/MarkersToBearingsAndDistance/blob/main/src/app/orienteering/orienteering.service.ts

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
https://www.rfc-editor.org/rfc/rfc7946#section-1.4

(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.

0

Comments

2 comments

  • 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.
    Marc

    0
  • 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.

    0

Please sign in to leave a comment.