koopjs / koop

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

ArcGIS Javascript API version 4.21 is not sending geometry parameter to Koop Feature services (Point Geometry) #381

Closed GopinathPD closed 1 year ago

GopinathPD commented 2 years ago

Hello Team,

Our application uses Koop.js services on the server side and ArcGIS Javascript API on the client side. We are using Koop Feature service to render point geometry with client side graphical symbols. With the latest ArcGIS Javascript API 4.21 version, we are observing that the UI is not sending the geometry parameter to Koop feature service. If I revert to 4.20 version, it is working as expected. Also with version 4.21 Koop Feature service Polygon geometry is working fine.

I can reproduce the issue with esriGeometryPoint type only. The UI is not sending geometry parameter for any of the requests. If I use the same layer with Polygon feature type, it is working fine with the 4.21 version also. Internally the Koop feature services are returning the features with GeoJSON format. We are using elasticsearch as a data source, but I have hard coded the value with single point feature like below:

let feature = { "type": "Feature", "geometry": { "type": "Point", "coordinates": [-74.57655482714311, 40.64566510349721] }, "properties": { "name": "Testing" } };

Still I can reproduce the issue consistently with Point geometry in the 4.21 version. There's something wrong in handling point geometry from geojson or koop is not returning the expected format as per the latest JS version.

Here's the API URL from version 4.20: https://vzwdt.com/kooppp/es/rest/services/esdev/events1/FeatureServer/2/query?f=json&geometry=%7B%22spatialReference%22%3A%7B%22latestWkid%22%3A3857%2C%22wkid%22%3A102100%7D%2C%22xmin%22%3A-15028131.257090997%2C%22ymin%22%3A5009377.085698988%2C%22xmax%22%3A-10018754.171394993%2C%22ymax%22%3A10018754.171394993%7D&maxAllowableOffset=9783.939620500008&orderByFields=OBJECTID%20ASC&outFields=OBJECTID&outSR=102100&resultType=tile&returnExceededLimitFeatures=false&spatialRel=esriSpatialRelIntersects&where=1%3D1&geometryType=esriGeometryEnvelope&inSR=102100 [vzwdt.com]

f: json geometry: {"spatialReference":{"latestWkid":3857,"wkid":102100},"xmin":-15028131.257090997,"ymin":5009377.085698988,"xmax":-10018754.171394993,"ymax":10018754.171394993} maxAllowableOffset: 9783.939620500008 orderByFields: OBJECTID ASC outFields: OBJECTID outSR: 102100 resultType: tile returnExceededLimitFeatures: false spatialRel: esriSpatialRelIntersects where: 1=1 geometryType: esriGeometryEnvelope inSR: 102100


API URL from version 4.21: URL: https://vzwdt.com/kooppp/es/rest/services/esdev/events1/FeatureServer/2/query?f=json&cacheHint=true&resultOffset=0&resultRecordCount=8000&where=1%3D1&orderByFields=OBJECTID&outFields=OBJECTID&outSR=102100&spatialRel=esriSpatialRelIntersects [vzwdt.com]

f: json cacheHint: true resultOffset: 0 resultRecordCount: 8000 where: 1=1 orderByFields: OBJECTID outFields: OBJECTID outSR: 102100 spatialRel: esriSpatialRelIntersects

Koop and UI Details: "@koopjs/provider-elasticsearch": "3.0.0", "@koopjs/output-vector-tiles": "^2.1.1", "@elastic/elasticsearch": "^7.13.0", "dotenv": "^10.0.0", "express": "4.16.4", "koop": "^4.0.4", "koop-output-geoservices": "^2.0.0"

Angular: 9 ArcGIS Javascript API: 4.20

Any help in resolving the issue is highly appreciated.

redoz commented 2 years ago

@GopinathPD I think we're running into the same issue, were you able to figure this out or come up with a work-around?

GopinathPD commented 2 years ago

Hello Patrik,

Can you try to add below command in your config files?

"capabilities": "Query, Create, Update, Delete, Editing"

This needs to be added in the default.json (or any service definition file)

On Thu, May 12, 2022, 4:38 PM Patrik Husfloen @.***> wrote:

@GopinathPD https://github.com/GopinathPD I think we're running into the same issue, were you able to figure this out or come up with a work-around?

— Reply to this email directly, view it on GitHub https://github.com/koopjs/koop/issues/381#issuecomment-1124859161, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHHKGCOIBQXZ5IJT5OYCS53VJTRA5ANCNFSM5IQZWW3Q . You are receiving this because you were mentioned.Message ID: @.***>

rgwozdz commented 2 years ago

"capabilities": "Query, Create, Update, Delete, Editing"

You can add this, but it's telling the client that Koop supports creating, updating, deleting, and editing features, which it does not (at least at this writing).

This issue seems like it's more of a JavaScript API issue. Any resistance to me closing?

bsvensson commented 1 year ago

This seems to work fine with version 4.22 and later.

rgwozdz commented 1 year ago

Closing.