koopjs / koop-provider-marklogic

A Koop Provider that can be used to exposed data in MarkLogic via Esri feature services
https://koopjs.github.io/koop-provider-marklogic/
Other
6 stars 11 forks source link

Examples don't produce geometry information in query results #114

Closed jimkohl closed 5 years ago

jimkohl commented 5 years ago

We've used both the ZipCodes and GKG examples in an attempt to produce FeatureLayers which contain geometry; however these examples are not showing any geometry data.

We've also built our own version which contains geometry and properties that follow the proper GeoJSON format. Our own example creates a FeatureCollection of Points. The data loads fine, and is stored in Marklogic correctly according to the GeoJSON spec.

Upon a featureLayer query:

http://localhost:9080/marklogic/ZipCodes/FeatureServer/0/query

can see the properties which we create, but not the geometry.

In ALL examples we're seeing the following warning (error?) for each record when queried:
"geometry" member required but guessing it is the reason no geometry info is returned:

WARNING: Source data for /marklogic/GDeltExample/FeatureServer/1/query is invalid GeoJSON:
     1) "geometry" member required

This keeps us from presenting the points in our ESRI feature layers.

Has anyone else encountered this issue?

jkerr5 commented 5 years ago

When querying the service using a URL, you have to set returnGeometry=true to get geometry data back. The Esri tools set that or they use outFields=* to return all fields and the geometry. I use a URL like this to test.

http://localhost:9080/marklogic/ZipCodes/FeatureServer/0/query?where=1=1&resultRecordCount=1&returnGeometry=true

Regarding you own FeatureCollection, I'll need more information on how you are structuring the documents to be able to help. I believe there's an email thread in my inbox about this as well so let's discuss that there.

jimkohl commented 5 years ago

James, using returnGeometry=true + changing repackaging data load from FeatureCollection to individual loaded Features resolved the issue! Thanks for your help!

The option is right there in KoopProvider.sjs, somehow missed that.
A note about this option and properties / geometry for consumption in the README.md might be helpful.