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

Add the ability to extract polygon geometries from a field/column #110

Closed jkerr5 closed 5 years ago

jkerr5 commented 5 years ago

If the geometry data is stored in a single field, allow the connector to extract the geometry from that field and return as GeoJSON to Koop.

Must support geometry data in GeoJSON as well as WKT.

jkerr5 commented 5 years ago

110 shows how to specify using a lat/lon column pair to extract point geometries from columns:

"geometrySource" : {
  "fields" : {
    "lat" : "lat",
    "lon" : "lon"
  }
}

This was just a quick implementation to test out the concept though so we can think more about how we want to specify where the geometry comes from in a more general fashion.

The under #10 we implemented the ability to extract geometry data from sources other than GeoJSON. That work is on the feature/10 branch and there's a PR for it. Our master has diverged quite a bit though so there are a lot of conflicts to resolve.

This is important though because there's overlap in the capability implemented on that branch and what we need for this issue. See https://github.com/koopjs/koop-provider-marklogic/wiki/Layer-Descriptor-Geometry-Section for details on the layer specifications that were implemented.

jkerr5 commented 5 years ago

There are really two aspects of the way geometry are used by the connector

  1. Geospatial indexes are used to limit the results when geometry queries are specified
  2. The geometry data are returned to the client when returnGeometry is specified

The geometry data needs to be in the documents and indexes created so 1 can work. We need to know where to get the geometry data so it can be extracted and returned as part of the features for 2 to work.

The work done on https://github.com/koopjs/koop-provider-marklogic/tree/feature/10 addresses 1 and 2 for geometry data in documents but does not support extracting from fields/columns.

It probably makes sense to get feature/10 merged into master and then build on it to add the ability to extract from fields/columns.

jkerr5 commented 5 years ago

10 was merged and #120 added WKT support as well as support for extracting serialized WKT or GeoJSON from a column. Need to reimplement the capability to extract points from a lat/lon column pair now though.

jkerr5 commented 5 years ago

And, we have #96 for the lat/lon point pair capability so closing this one.