You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ensure we maintain field order (eg. the id must come first).
this 'just works' right now because js magically maintains the order of elements added to an object (this should not be relied upon), so when using decode and encode it works, but manipulating fields could cause them to be re-ordered.
maintaining field order is easy to implement, just need to cycle over the keys in the keymap and add them in order. in this case we need to consider what to do about fields not defined in the spec, either discard them or append them to the line.
tags seem to be added in the order they were inserted in to the osm database and so there is no way we can ensure any sort of consistency there. the spec should force them to be alphabetically ordered so that a decode+encode operation is idempotent and consistent (helpful in testing)
The text was updated successfully, but these errors were encountered:
ensure we maintain field order (eg. the id must come first).
this 'just works' right now because js magically maintains the order of elements added to an object (this should not be relied upon), so when using
decode
andencode
it works, but manipulating fields could cause them to be re-ordered.maintaining field order is easy to implement, just need to cycle over the keys in the keymap and add them in order. in this case we need to consider what to do about fields not defined in the spec, either discard them or append them to the line.
tags seem to be added in the order they were inserted in to the osm database and so there is no way we can ensure any sort of consistency there. the spec should force them to be alphabetically ordered so that a decode+encode operation is idempotent and consistent (helpful in testing)
The text was updated successfully, but these errors were encountered: