Skip to content

Object IDs for working with Esri Tools

Preston edited this page Oct 30, 2019 · 1 revision

The features returned by the Koop provider service with an Esri client should contain a field named OBJECTID or a field that can be identified as the OBJECTID in to the Esri Feature Service clients. The OBJECTID must be an unsigned integer. In order to support pagination across large result sets, the OBJECTIDs need to be increasing numbers. They don't have to be contiguous to but should be fairly evenly distributed between the minimum and maximum values.

OBJECTIDs can either be added to the documents and then exposed as a column in a TDE view or computed by an expression in a TDE template column using using existing field(s) in the documents. The computed value must be passable as an unsigned integer. The value should also be unique for the given geospatial point or region.

For example, you can add the following to each JSON document for a reasonably likely unique id:

koopObjectId: xdmp.hash32(sem.uuidString())

Your column for this value needs to be defined in your TDE:

<column>
    <name>OBJECTID</name>
    <scalar-type>long</scalar-type>
    <val>koopObjectId</val>
</column>

Your feature service configuration then identifies the appropiate idField column:

 "layers": [
    {
      "id": 0,
      "name": "GeoJSON Data",
      "description": "My data in GeoJSON",
      "geometryType": "Polygon",
      "idField": "OBJECTID",
      "extent": {
        "xmin": 8,
        "ymin": 119,
        "xmax": 14,
        "ymax": 128,
        "spatialReference": {
          "wkid": 4326,
          "latestWkid": 4326
        }
      }
    }

Clone this wiki locally