TerriaJS / de-australia-map

Digital Earth Australia platform developed for publishing Satellite Imagery processed by Geoscience Australia (GA) and National Computational Infrastructure (NCI)
http://de-australia.terria.io/
2 stars 1 forks source link

DE Australia - share links - comments from DEA team - adding unique IDs #66

Closed AnaBelgun closed 3 years ago

AnaBelgun commented 3 years ago

https://github.com/GeoscienceAustralia/dea-config/issues/588

A challenge with using DEA Maps to share links to our data is that small changes to the Terria config can cause Terria share links to break. This occurs when a layer is renamed (e.g. Coastal/NIDEM > Coastal/Intertidal Elevation) or moved to a new directory (e.g. (e.g. Coastal/NIDEM > Intertidal/NIDEM). Given how frequently we change the structure of the DEA Maps catalogue, this means that Terria share links go out of date quickly, which is problematic as it means our documentation or public-facing websites (CMI and DEA website) go out of date too.

A lot of these issues could be resolved if we included a unique Terria id config option in each of the layers in the DEA Maps Terria config. According to the Terria documentation:

id: An optional unique id for this member, that is stable across renames and moves. Use uniqueId to get the canonical unique id for this CatalogMember, which is present even if there is no id. https://docs.terria.io/guide/connecting-to-data/catalog-type-details/wms/

This is could be a pretty simple fix for a big reduction in future effort; see the unique IDs used for the DEA Coastlines Terria config below (although see #588 (comment) for a better suggestion for unique IDs):

https://github.com/GeoscienceAustralia/dea-config/blob/master/dev/terria/dea-maps.json#L1004

AnaBelgun commented 3 years ago

from @meh9 Looks good to me.

Note that I usually use a random hash instead of your example of "dea_coastlines" above - otherwise when things are renamed people often get the urge to change the id as well, if it's a random hash then they usually leave it alone!

E.g. https://github.com/TerriaJS/aremi-natmap/blob/master/datasources/aremi/custodian/Geoscience_Australia/Bathymetry_Seabed.ejs#L2

AnaBelgun commented 3 years ago

from Robbi That's a good idea! Plus it would avoid needing to come up with/use some kind of consistent naming convention for those fields

AnaBelgun commented 3 years ago

More comments on how share keys work: So... if we kept the “ids” the same as they were originally but made changes to the “share keys”, will that break existing share links? It might break really old ones. shareKeys should only ever be added to, and as soon as you add an id to that item you no longer need to keep adding to them. You can think of the shareKeys as a list of all the places an item has been before it was given an id.