koopjs / winnow

Deprecated
Apache License 2.0
90 stars 18 forks source link

Clean up where-clause generation #165

Closed rgwozdz closed 3 years ago

rgwozdz commented 3 years ago

Specifically refactors portion of where-clause generation that handles OBJECTID predicates. Just cleans up code, does not change functionality. Some background:

  1. If a dataset is flagged for translation to Esri JSON and doesn't have metadata that defines an idField, Winnow will add an OBJECTID field to each feature's attributes and give it a value based on hashing of the feature.

  2. Follow-up queries by the client may include where-clause predicates that include the OBJECTID. Since the dataset doesn't actually have an OBJECTID field, we need to hash each feature on the fly as the where predicate executes so that we have an OBJECTID to make the comparison.

  3. We do this by replacing the where-clause predicate that targets OBJECTID with an inline function that will make the appropriate comparison.