koopjs / FeatureServer

An open source Geoservices Implementation (deprecated)
https://geoservices.github.io
Other
101 stars 32 forks source link

When `returnCountOnly` and `returnExtentOnly` are true, `outSR` is seemingly ignored #215

Closed LeviRemi closed 2 years ago

LeviRemi commented 2 years ago

Could someone help me understand why outSR is not passed into getExtent() when returnCountOnly and returnExtentOnly are set to true? https://github.com/koopjs/FeatureServer/blob/0bee461f0e1afebd96117c31f70708ef3eb2c3dd/lib/query.js#L182-L185

See getExtent() here: https://github.com/koopjs/FeatureServer/blob/0bee461f0e1afebd96117c31f70708ef3eb2c3dd/lib/query.js#L284-L315

This code is the reason I believe I'm getting the wrong extent returned using ArcGIS Online to "zoom to" a Koop-served Feature Layer.

When querying with returnExtentOnly = true and returnCountOnly = false, I am seeing the accurately projected 102100 extent based on the features in my layer. Screen Shot 2022-02-25 at 3 52 52 PM

However, when querying with returnExtentOnly = true and returnCountOnly = true (the default params when using "zoom to" in the ArcGIS Online Map Viewer), I am getting the same projected coordinates but with an incorrectly labeled SR: Screen Shot 2022-02-25 at 3 58 57 PM

Am I missing some metadata option to make this work correctly? I tried to modify the GeoJSON to include an extent object with a hard-defined bbox in the correct SR, but this extent did not show up in the query results.

rgwozdz commented 2 years ago

Working on a patch...

rgwozdz commented 2 years ago

@LeviRemi - sorry for the delay. The patch is released (v3.3.2). Can you confirm it fixes your noted issue?

LeviRemi commented 2 years ago

@rgwozdz - Thank you for the update. I'm using the default Koop Geoservices Output Plugin, is there any way for you to patch that repo as well? I can test it then.

rgwozdz commented 2 years ago

Ok, I've updated Koop Geoservices.

LeviRemi commented 2 years ago

@rgwozdz The "zoom to" is working great now! Thank you.