koopjs / koop

Transform, query, and download geospatial data on the web.
http://koopjs.github.io
Other
651 stars 125 forks source link

Generate feature OBJECTID as numeric hash of a specific field #966

Open rgwozdz opened 2 months ago

rgwozdz commented 2 months ago

For datasets that have no unique identifier with property name OBJECTID or no feature ID field targeted by metadata.idField, Koop auto-generates an integer OBJECTID by hashing the entire feature. While this is useful for the edge-case in which a feature has no unique identifier, it's potentially problematic because:

My assumption is that most datasets will have some unique-identifier, though it is often the case that such identifiers are NOT integers. It is increasingly common for IDs to be strings. Provider developers can point idField to a string property, but some ArcGIS clients will not be able to properly consume such services (the JS API appears to work, but ArcGIS Pro does not). It would therefore be nice if a developer could direct the hasher to one specific property to hash into an integer.

As an add-on here, it seems like ArcGIS clients now support 64-bit integer IDs, so we should hash to that datatype as we move forward.