koopjs / winnow

Deprecated
Apache License 2.0
90 stars 18 forks source link

Support the use of a provider's idField as OBJECTID and provide alternative if not specified #68

Closed rgwozdz closed 6 years ago

rgwozdz commented 6 years ago

This PR contains following changes:

  1. Prevents mutation of a provider's metadata object. Before this, if a metadata.idField had not been set, it was added by winnow and set to OBJECTID. This caused some issues with checking to see if a provider had or had not set the metadata.idField for certain code executions.

  2. If an idField has been set in the provider, use a feature's value for this property as the OBJECTID. Then delete the idField property from the feature's attributes - this prevents sending the same data on two attributes (the idField and the OBJECTID)

  3. If an idField has NOT been set in the provider, create an integer hash from the stringified feature and use that as the OBJECTID.

  4. If an idField has been set in the provider and is thus used as an OBJECTID, incoming queries that request OBJECTID as one of the outFields need to be remapped to the idField so that a proper SELECT can occur.

dmfenton commented 6 years ago

don't forget to add a changelog entry