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

Remove requirement for documents to be in GeoJSON #10

Closed jkerr5 closed 5 years ago

jkerr5 commented 6 years ago

The provider implementation assumes the documents are in GeoJSON right now. It should work against documents in any format and rely on the TDE template to map elements to columns in the rows.

Related to #6, the geometry is not transformed so the geometry that is fetched must be in GeoJSON to return correctly.

jkerr5 commented 6 years ago
jkerr5 commented 6 years ago

For polygons, it is straight forward: use the xpath that's in the layer descriptor to select the cts:regions and then use toGeosjon() to convert to geojson https://docs.marklogic.com/geojson.toGeojson

For points, there are a bunch of point formats we support There are 5 types of point indexes

We need some sort of "handler" for each type.

Also, we currently have the point indexes that we use hard-coded:

    const pointPaths = [
      '//geometry[type = "MultiPoint"]//array-node("coordinates")',
      '//geometry[type = "Point"]//array-node("coordinates")'
    ];

To support something other than GeoJSON, we would need these to be configurable as well.

Last, to complete this, we also need to change so the path for the region index is not hard-coded as well:

    const regionPaths = [
      cts.geospatialRegionPathReference('/envelope/ctsRegion')
    ];
jkerr5 commented 6 years ago

@jmamanpara I created a wiki page https://github.com/koopjs/koop-provider-marklogic/wiki/Layer-Descriptor-Geometry-Section to show the different types of geometry properties that could be in a layer descriptor. It's still a work in progress but hopefully it gives you something to start with.