umap
umap copied to clipboard
Uniformize the way we store metadata in the geojson
- map metadata are stored in
propertiesof the top level - datalayer metadata are stored in
_umap_optionsof theFeatureCollectionlevel - feature metadata are stored in the
_umap_optionskey insidepropertiesat theFeaturelevel
This should be more consistent.
We may have a separate key for all (eg. metadata, style, umap) at the same level of properties. But we may also decide that everything goes inside properties, and any key that is recognized by uMap would be used as a metadata (and exposed to user through specific form fields), and any key which is not part of its format would be considered as data, (and exposed to used through the non typed data form).
Maybe we should also separate the styling metadata (which may be used by other tools) from behaviour metadata, which are very tied to uMap itself.
cf #316 cf https://github.com/mapbox/simplestyle-spec
cf #1635
#1646
I share the pain, this is what my Umap overlay processing style currently has:
for path in ['$.properties.*', '$.properties._storage.*', '$._storage.*', '$.properties._storage_options.*', '$._storage_options.*', '$.properties._umap_options.*', '$._umap_options.*']:
https://github.com/hholzgra/ocitysmap/blob/5d41e4c3b31cb8b554fdb0be017e426cf6ef155f/ocitysmap/stylelib/Umap.py#L82
Not sure why _storage_options is also in there, might have been also used in older Umap versions ... I would not have added that for nothing ...