Skip to content

Working with the ArcGIS Pro add in

mfgumban edited this page May 1, 2020 · 1 revision

Overview

The ArcGIS Pro add-in uses Koop as its server and relies on Geo Data Service service descriptors to access data in MarkLogic.

Add-in interaction with Geo Data Services

  • geoSearchService is used to run search queries against MarkLogic within the context of feature layers.
  • geoQueryService is used (via Koop) when searches are turned into full-fledged feature layers. Saved searches end up as feature layers.
  • modelService is used to check for available service descriptors and which ones are configured for search.

Search vs. Query

The geoQueryService REST extension is primarily designed for querying data in MarkLogic and retrieving them as GeoJSON features. This approach uses "SQL-like" syntax to define queries and requires data to have a flat (table-like) structure. This services heavily relies on MarkLogic's Optic API and TDE templates to achieve this.

On the other hand, geoSearchService leverages MarkLogic's Search API for querying data. Internally, it dynamically constructs search options based on the service request and provides a response similar to MarkLogic's v1/search. This allows for full-text queries, faceting, point clustering, and other features inherent to the Search API.

Service Descriptor Configuration

Prerequisites

To enable search for a service descriptor, you must configure a MarkLogic search options document as part of your MarkLogic deployment. It is up to you to determine the search constraints and other search options based on your use case. The search options should have at least one (1) geospatial constraint. For a working example, see the sample project's search options.

Optionally, you may also want to configure a MarkLogic content transform to transform documents into HTML. If set, the add-in will use the content transform when viewing search results as documents.

Modifying your service descriptor

  1. Add a search section to your service descriptor to specify the search options and (optionally) the content transform.
  2. Modify one of your feature layers and add a search section containing a geoConstraint property with the name of your geospatial constraint. This will act as your "reference" feature layer.
  3. Add additional layers to provide "slots" for the add-in to save searches. The layers can have the same configuration your "reference" feature layer, but it is important that they don't have a search section.
  4. Add a readOnly property to the feature layer and set it to true. This will prevent the feature layer from being overwritten when the add-in attempts to save searches.

You can find a working example used by the example project here. Below is an excerpt:

{
  "info" : {
    "name" : "GDeltExample"
  },

  "search": {
    "options": "example-gkg-options",
    "docTransform": "example-gkg-transform"
  },

  "layers" : [
    {
      "id": 0,
      "name" : "GKG",
      "description": "All GDelt articles",
      "geometryType": "Point",
      "idField": "OBJECTID",
      "displayField": "name",
      "extent" : {
        "xmin" : -180,
        "ymin" : -90,
        "xmax" : 180,
        "ymax" : 90,
        "spatialReference" : {
          "wkid" : 4326,
          "latestWkid" : 4326
        }
      },
      "schema": "GDeltGKG",
      "view" : "Article",
      "geometry" : {
        "type" : "Point",
        "format" : "geojson",
        "coordinateSystem" : "wgs84",
        "xpath" : "//geometry"
      },
      "search": {
        "geoConstraint": "Location"
      },
      "readOnly": true
    }
    // ...other feature layers
  ]
}

Clone this wiki locally