Closed jkerr5 closed 5 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')
];
@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.
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.