Skip To Content

Query Datasets

  • URL: https://<catalog-url>/<serviceName> MapServer/exts/MaritimeChartService/MapServer/queryDatasets
  • Required Capability:Maritime Chart Service
  • Version Introduced:10.9

Description

The queryDatasets operation returns any dataset that matches the request. This operation can be used to provide a comprehensive report on the datasets loaded in the system.

Request parameters

All parameters are based on REST protocol. By default, if nothing is provided in the text or where parameter, it will return all datasets.

ParameterDetails

userid

(Optional)

This is a required parameter when Entitlements is enabled.

Syntax

<userid value>

Example

userid=Marloe
text

(Required)

A literal search text. The dataset field used is dsnm (dataset name), and the server searches for this text in this field. This parameter is shorthand for a where clause of where dsnm like '%<text>%'. The text is not case sensitive.

Syntax

text=<string>

Example

text=USS
Note:

The text parameter takes precedence over where if both are set.

where

(Optional)

A where clause for the query filter. Any legal SQL where clause operating on the fields in the layer is allowed.

Syntax

where=<where clause>

Exzample

where=intu=5

Example for S-63 permits

//permit_expiration_date is not null
(permit_expiration_date, 'unixepoch')= 'YYYY-MM-DD'
Note:

If both the text and where parameters are set, text will take precedence.

orderBy

(Optional)

One or more field names or expressions that the records can be ordered by. Use ASC for ascending or DESC for descending order.

Ascending order is the default if <ORDER> is not specified.

Syntax

orderByfields=expression1 <ORDER>, expression2 <ORDER>

Example

orderByFields=dsnm ASC, intu DESC
limit

(Optional)

Specifies the number of records in the response returned by the queryDatasets operation.

Example

limit=50
offset

(Optional)

Specifies the number of records to skip in the response returned by the queryDatasets operation.

Example

offset=50

For example, to query 20 at a time, the first queryDatasets request uses limit=20. The next query uses limit=20 and offset=20. To continue and get records 41-60, the query is run with limit=20 and offset=40.

minscale

(Optional)

Specifies the minimum scale used to query datasets contained in your system. It must be used with maxscale. Datasets with a compilation scale of data cscl value equal or greater than the minscale and less than or equal to the maxscale value are returned in the response.

Example

minscale=22000

The minscale value must be greater than 0.

maxscale

(Optional)

Specifies the maximum scale used to query datasets contained in your system. It must be used with minscale. Datasets with a compilation scale of data cscl value equal or greater than the minscale and less than or equal to the maxscale value are returned in the response.

Example

maxscale=22000

The maxscale value must be greater than or equal to the minscale value.

geometryType

(Optional)

The type of geometry specified by the geometry parameter. The geometry type can be an envelope, point, line, or polygon.

Values: esriGeometryPoint | esriGeomteryPolyLine | esriGeomteryPolygon | esriGeometryEnvelope

geometry

(Optional)

The geometry to apply as the spatial filter. The structure of the geometry is the same as the structure of the JSON geometry objects returned by the ArcGIS REST API. In addition to the JSON structures for envelopes and points, you can specify the geometry with a comma-separated syntax.

Syntax

geometryType=<geometryType>&geometry={geometry}

Example

geometryType=esriGeometryEnvelope&geometry={xmin: -104, ymin: 35.6, xmax: -94.32, ymax:41}

insr

(Optional)

The spatial reference of the input geometry. The spatial reference can be specified as either a well-known ID or as a spatial reference JSON object. If the insr is not specified, the geometry is assumed to be in the spatial reference of the map.

Syntax

insr=<WKID>

Example

insr=102100

All values in the crs.xml are supported. This file is stored at <ArcGIS Maritime server installation location>\MaritimeServer\<version number>\maritimechartservice\controlfiles\crs.xml.

outsr

(Optional)

The spatial reference of the returned geometry. The spatial reference can be specified as a well-known ID or as a  spatial reference JSON object. If outsr is not specified, the geometry is returned in the spatial reference of the map.

Syntax

outsr=<WKID>

Example

outsr=4326

All values in the crs.xml file are supported. This file is stored at <installation location>\MaritimeServer\<version number>\maritimechartservice\controlfiles\crs.xml.

returnGeometry

(Optional)

If true, the result set includes the geometries associated with each result. The default is false.

Values: true | false

Response properties

PropertyDetails
format (f)

Specifies the response format. The default response format is html.

Values: json | html

Syntax:

f=json

Note:

Some browsers have a limit to the number of html-formatted responses. There is no limit with JSON.

Example usage

The following examples describe various ways to use the queryDatasets operation. All responses are in PJSON format.

Example 1

The following is an example of the queryDatasets operation using the WHERE clause and LIKE operator to search for datasets starting with GB. This query returns six datasets. The returnGeometry parameter is set to true. Default values are used for the rest of the parameters.

https://nsdemo.esri.com/arcgis/rest/services/SampleWorldCities/MapServer/exts/MaritimeChartService/MapServer/queryDatasets?userid=&text=&where=dsnm+like+%27GB%25%27&orderby=&limit=&offset=&outfields=&minscale=&maxscale=&geometrytype=&geometry=&insr=&outsr=&returngeometry=&f=pjson

Example 2

The following is an example of the queryDatasets operation using a subset of outfields (dsnm, edtn, updn, isdt, uadt, cscl) as well as the WHERE clause and LIKE operator values from Example 1. Default values are used for the rest of parameters.

https://nsdemo.esri.com/arcgis/rest/services/SampleWorldCities/MapServer/exts/MaritimeChartService/MapServer/queryDatasets?userid=&text=&where=dsnm+like+%27GB%25%27&orderby=&limit=&offset=&outfields=dsnm%2C+edtn%2C+updn%2C+isdt%2C+uadt%2C+cscl&minscale=&maxscale=&geometrytype=&geometry=&insr=&outsr=&returngeometry=&f=pjson

Example 3

The following is an example of using the queryDatasets operation to search for S-63 datasets that have a permit expiring before October 3, 1994. The outfields parameter is used to return only the permit_expiration_date field. Default values are used for the rest of parameters. No datasets will be returned in this example.

https://nsdemo.esri.com/arcgis/rest/services/SampleWorldCities/MapServer/exts/MaritimeChartService/MapServer/queryDatasets?userid=&text=&where=date(permit_expiration_date,+'unixepoch')+<+'1994-10-03'&orderby=&limit=&offset=&outfields=permit_expiration_date&minscale=&maxscale=&geometrytype=&geometry=&insr=&outsr=&returngeometry=&f=pjson

JSON Response syntax

The following is the syntax of a response for example 1, using the WHERE clause and LIKE operator to search for datasets starting with GB and returnGeomtry=true. A total of six datasets are returned; however, only the first one is shown in this example.


{ 
  "spatialReference": { 
  "wkid": <outsrValue> 
 }, 
  "geometryType": "esriGeometryPolygon",  //only returns esriGeometryPolygon 
  "charts": [ 
  { 
   "visible": <value>, 
   "dsid": { 
    "description": "<dsidDescription>", 
    "expp": { 
     "value": <subfieldValue>, 
     "mappedValue": "<valueDescription>", 
     "description": "<subfieldDescription>" 
    }, 
    "intu": { 
     "value": <subfieldValue>, 
     "mappedValue": "<valueDescription>", 
     "description": "<subfieldDescription>" 
    }, 
    "dsnm": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    }, 
    "edtn": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    }, 
    "updn": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    }, 
    "isdt": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    }, 
    "sted": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    }, 
    "uadt": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    }, 
    "prsp": { 
     "value": <subfieldValue>, 
     "mappedValue": "<valueDescription>", 
     "description": "<subfieldDescription>" 
    }, 
    "psdn": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    }, 
    "pred": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    }, 
    "prof": { 
     "value": <subfieldValue>, 
     "mappedValue": "<valueDescription>", 
     "description": "<subfieldDescription>" 
    }, 
    "agen": { 
     "value": <subfieldValue>, 
     "mappedValue": "<valueDescription>", 
     "description": "<subfieldDescription>" 
    }, 
    "comt": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    } 
   }, 
   "dssi": { 
    "description": "<dssiDescription>", 
    "dstr": { 
     "value": <subfieldValue>, 
     "mappedValue": "<valueDescription>", 
     "description": "<subfieldDescription>" 
    }, 
    "aall": { 
     "value": <subfieldValue>, 
     "mappedValue": "<valueDescription>", 
     "description": "<subfieldDescription>" 
    }, 
    "nall": { 
     "value": <subfieldValue>, 
     "mappedValue": "<valueDescription>", 
     "description": "<subfieldDescription>" 
    }, 
    "nomr": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    }, 
    "nocr": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    }, 
    "nogr": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    }, 
    "nolr": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    }, 
    "noin": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    }, 
    "nocn": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    }, 
    "noed": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    }, 
    "nofa": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    } 
   }, 
   "dspm": { 
    "description": "<dspmDescription>", 
    "hdat": { 
     "value": <subfieldValue>, 
     "mappedValue": "<valueDescription>", 
     "description": "<subfieldDescription>" 
    }, 
    "vdat": { 
     "value": <subfieldValue>, 
     "mappedValue": "<valueDescription>", 
     "description": "<subfieldDescription>" 
    }, 
    "sdat": { 
     "value": <subfieldValue>, 
     "mappedValue": "<valueDescription>", 
     "description": "<subfieldDescription>" 
    }, 
    "cscl": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    }, 
    "duni": { 
     "value": <subfieldValue>, 
     "mappedValue": "<valueDescription>", 
     "description": "<subfieldDescription>" 
    }, 
    "huni": { 
     "value": <subfieldValue>, 
     "mappedValue": "<valueDescription>", 
     "description": "<subfieldDescription>" 
    }, 
    "puni": { 
     "value": <subfieldValue>, 
     "mappedValue": "<valueDescription>", 
     "description": "<subfieldDescription>" 
    }, 
    "coun": { 
     "value": <subfieldValue>, 
     "mappedValue": "<valueDescription>", 
     "description": "<subfieldDescription>" 
    }, 
    "comf": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    }, 
    "somf": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    }, 
    "comt": { 
     "value": "<subfieldValue>", 
     "description": "<subfieldDescription>" 
    } 

   }, 

    "permit_expiration_date": {    //Only appears for S-63 datasets 

    "value": "<subfieldValue>", 

          "description": "<subfieldDescription>" 
   }, 
   "geometry": {<geometry>}  // only when returnGeometry=true (false is default) 
  }

JSON Response examples

The following sections describe JSON response examples corresponding to the usage examples listed above.

Example 1

The following is an example response for example 1, using the WHERE clause and LIKE operator to search for datasets starting with GB and returnGeomtry=true. A total of six datasets are returned; however, only the first one is shown in this example.


{ 
 "spatialReference": { 
  "wkid": 4326 
 }, 
 "geometryType": "esriGeometryPolygon", 
 "charts": [ 
  { 
   "visible": false, 
   "dsid": { 
    "description": "Data Set Identification field", 
    "expp": {
     "value": 1,
     "mappedValue": "New", 
     "description": "Exchange purpose" 
    }, 
    "intu": { 
     "value": 5, 
     "mappedValue": "Harbour", 
     "description": "Intended usage" 
    }, 
    "dsnm": { 
     "value": "GB5X01NE.000", 
     "description": "Data set name" 
    }, 
    "edtn": { 
     "value": "2", 
     "description": "Edition number" 
    }, 
    "updn": { 
     "value": "0", 
     "description": "Update number" 
    }, 
    "isdt": { 
     "value": "20070713", 
     "description": "Issue date" 
    }, 
    "sted": { 
     "value": "03.1", 
     "description": "Edition number of S-57" 
    }, 
    "uadt": { 
     "value": "20070713", 
     "description": "Update application date" 
    }, 
    "prsp": { 
     "value" 1, 
     "mappedValue": "ENC", 
     "description": "Product specification" 
    }, 
    "psdn": { 
     "value": "", 
     "description": "Product specification description" 
    }, 
    "pred": { 
     "value": "2.0", 
     "description": "Product specification edition number" 
    }, 
    "prof": { 
     "value": 1, 
     "mappedValue": "EN - ENC new", 
     "description": "Application profile identification" 
    }, 
    "agen": { 
     "value": 540, 
     "mappedValue": "GB", 
     "description": "Producing agency" 
    }, 
    "comt": { 
     "value": "", 
     "description": "Comment" 
    } 
   }, 
   "dssi": { 
    "description": "Data Set Structure Information field", 
    "dstr": { 
     "value": 2, 
     "mappedValue": "chain node", 
     "description": "Data structure" 
    }, 
    "aall": { 
     "value": 1, 
     "mappedValue": "level 1", 
     "description": "ATTF lexical level" 
    }, 
    "nall": { 
     "value": 1, 
     "mappedValue": "level 1", 
     "description": "NATF lexical level" 
    }, 
    "nomr": { 
     "value": 6, 
     "description": "Number of meta records" 
    }, 
    "nocr": { 
     "value": 0, 
     "description": "Number of cartographic records" 
    }, 
    "nogr": { 
     "value": 292, 
     "description": "Number of geo records" 
    }, 
    "nolr": { 
     "value": 2, 
     "description": "Number of collection records" 
    }, 
    "noin": { 
     "value": 66, 
     "description": "Number of isolated node records" 
    }, 
    "nocn": { 
     "value": 305, 
     "description": "Number of connected node records" 
    }, 
    "noed": { 
     "value": 403, 
     "description": "Number of edge records" 
    }, 
    "nofa": { 
     "value": 0, 
     "description": "Number of face records" 
    } 
   }, 
   "dspm": { 
    "description": "Data Set Parameter field", 
    "hdat": { 
     "value": 2, 
     "mappedValue": "WGS 84", 
     "description": "Horizontal geodetic datum" 
    }, 
    "vdat": { 
     "value": 17, 
     "mappedValue": "Mean high water springs", 
     "description": "Vertical datum" 
    }, 
    "sdat": { 
     "value": 23, 
     "mappedValue": "Lowest astronomical tide", 
     "description": "Sounding datum" 
    }, 
    "cscl": { 
     "value": 22000, 
     "description": "Compilation scale of data" 
    }, 
    "duni": { 
     "value": 1, 
     "mappedValue": "meters", 
     "description": "Units of depth measurement" 
    }, 
    "huni": { 
     "value": 1, 
     "mappedValue": "meters", 
     "description": "Units of height measurement" 
    }, 
    "puni": { 
     "value": 1, 
     "mappedValue": "meters", 
     "description": "Units of positional accuracy" 
    }, 
    "coun": { 
     "value": 1, 
     "mappedValue": "LL - Latitude/Longitude", 
     "description": "Coordinate units" 
    }, 
    "comf": { 
     "value": 10000000, 
     "description": "Coordinate multiplication factor" 
    }, 
    "somf": { 
     "value": 10, 
     "description": "3-D sounding multiplication factor" 
    }, 
    "comt": { 
     "value": "", 
     "description": "Comment"  
    } 
   }, =
   "geometry": { =
    "rings": [ 
     [ 
      [ 
       60.9666667000, 
       -32.5333333000 
      ], 
      [ =
       60.9666667000, 
       -32.4563735000 
      ], 
      [ 
       60.9972840000, 
       -32.4563735000 
      ], 
      [ 
       60.9972840000, 
       -32.5333333000 
      ], 
      [ 
       60.9666667000, 
       -32.5333333000 
      ] 
     ] 
    ] 
   } 
  }

Example 2

The following is an example of a response for example 2, using a subset of outfields (dsnm, edtn, updn, isdt, uadt, cscl) as well as the WHERE clause and LIKE operator values from Example 1. Default values are used for the rest of parameters. This returns a small subset of subfields and their values. A total of six are returned; however, only the first one is shown in this example.


{ 
 "charts": [ 
  { 
   "dsid": { 
    "description": "Data Set Identification field", 
    "dsnm": { 
     "value": "GB5X01NE.000", 
     "description": "Data set name" 
    }, 
    "edtn": { 
     "value": "2", 
     "description": "Edition number" 
    }, 
    "updn": { 
     "value": "0", 
     "description": "Update number" 
    }, 
    "isdt": { 
     "value": "20070713", 
     "description": "Issue date" 
    }, 
    "uadt": { 
     "value": "20070713", 
     "description": "Update application date" 
    } 
   }, 
   "dspm": { 
    "description": "Data Set Parameter field", 
    "cscl": { 
     "value": 22000, 
     "description": "Compilation scale of data" 
    } 
   } 
  }

Example 3

The following is an example of a response for example 3, where the outfields parameter is used to return only the permit_expiration_date field. Default values are used for the rest of the parameters. This does not return any records since this public services (NSDEMO) does not contain encrypted (S-63) datasets.


{ 
 "charts": [   

 ] 
}

JSON error response syntax

This example shows the syntax of a response for error results from a WHERE clause formatted incorrectly.

{ 
 "error": { 
  "code": <value>, 
  "message": "<errorMessage>", 
  "details": [ 
   "<detailedMessage>" 
  ] 
 } 
}

JSON error response example

Ths example response shows error results from a WHERE clause formatted incorrectly.


{ 
 "error": { 
  "code": 400, 
  "message": "Bad Request", 
  "details": [ 
   "unrecognized token: \"\\\"" 
  ] 
 } 
}