Find

URL:
https://<root>/<serviceName>/MapServer/exts/MaritimeChartService/MapServer/find
Methods:
GETPOST
Required Capability:
Maritime Chart Service
Version Introduced:
10.9

Description

The use of this resource requires an ArcGIS GIS Server Standard or Advanced license and an ArcGIS Maritime server extension license.

The find operation is performed on a map service resource used to discover features based on their OBJNAM and NOBJNM attribute values as well as searching for datasets in your map service.

Each result includes its layer ID, layer name, cell name, compilation scale, geometry and geometry type, and other attributes of that result as name-value pairs.

Request parameters

ParameterDetails

userid

(Optional)

This is a required parameter when Entitlements is enabled.

Syntax

Use dark colors for code blocksCopy
1
<userid value>

Example

Use dark colors for code blocksCopy
1
userid=Marloe

searchtext

(Required)

A literal search text. If the layer has a search field associated with it, the server searches for this text in this field. This parameter is shorthand for a where clause of where<searchfields> like '%<searchtext>%'. The text is not case sensitive.

Syntax

Use dark colors for code blocksCopy
1
text=<string>

Example

Use dark colors for code blocksCopy
1
searchtext=Rossett Island

returnGeometry

(Optional)

If true, the result set will include the geometries associated with each result. The default is true.

Values: true | false

searchfields

(Optional)

The screen image display parameters (width, height, and DPI) of the active map.

By default the find operation searches both OBJNAM and NOBNJM for the text in the searchtext parameter regardless of the value you put in searchfields. The exception to this is if you want to search for a dataset. When searching for a dataset or set of datasets you must specify DSNM in the searchfields parameter.

Syntax

Use dark colors for code blocksCopy
1
searchfields=<string>

Example

Use dark colors for code blocksCopy
1
searchfields=DSNM

sr

(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 sr is not specified, the geometry is returned in the spatial reference of the map.

Syntax

Use dark colors for code blocksCopy
1
sr=<WKID>

Example

Use dark colors for code blocksCopy
1
2
3
sr=4326
sr={"wkid":4326}
sr={"wkt": "Replace with actual well-known text"}

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

Response properties

PropertyDetails

format (f)

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

Values: json|html

Syntax:

Use dark colors for code blocksCopy
1
f=json

Example usage

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

Example 1

The following is an example of the find operation searching for a dataset containing GB4X in the name. An output spatial reference of 4326 was used and the rest are using default values.

Use dark colors for code blocksCopy
1
https://nsdemo.esri.com/arcgis/rest/services/SampleWorldCities/MapServer/exts/MaritimeChartService/MapServer/find?userid=&searchtext=GB4X&searchfields=DSNM&sr=4326&f=pjson

Example 2

The following is an example of the find operation searching for features containing Rosset Island in either the OBJNAM or NOBJNM attribute. An output spatial reference of 4326 was used and 'returnGeometry' was set to 'false'. Default values are used for the rest of the parameters.

Use dark colors for code blocksCopy
1
https://nsdemo.esri.com/arcgis/rest/services/SampleWorldCities/MapServer/exts/MaritimeChartService/MapServer/find?searchtext=Rossett+Island&returngeometry=false&searchfields=&sr=4326&f=pjson

JSON Response syntax

Example 1

The following is the syntax of a response for example 1, searching for a dataset with GB4X in the name.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
 "results": [
    {
     "layerId": <value>,
     "layerName": "<layerNameValue>",
     "value": "<datasetName>",
     "displayFieldName": "<fieldName>",
     "foundFieldName": "<fieldName>",
     "value": "<datasetName>",
   "attributes": {
      "DSNM": "<subFieldValue>",
      "EDTN": "<subFieldValue>",
      "UPDN": "<subFieldValue>",
      "CSCL": "<subFieldValue>"
   },
   "geometryType": "esriGeometryPolygon", //only returns esriGeomteryPolygon for DSNM
    "geometry": {<geometry>}     //only when returnGeometry=true (default)
    "spatialReference": {
     "wkid": <srValue>
    },
   }
  ]
}

Example 2

The following is the syntax of a response for example 2, searching for Rosset Island in either OBJNAM or NOBJNM attributes.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
 {
  "results": [
   {
    "layerId": <value>,
    "layerName": "<layerNameValue>",
    "value": "<recordID>",
    "displayFieldName": "rcid",
    "foundFieldName": "<searchFieldValue>",
    "value": "<RecordID>",
    "attributes": {
     "rcid": "<subFieldValue>",
     "LNAM": "<subFieldValue>",
     "objectType": "<subFieldValue>",
     "objectTypeDescription": "<subFieldValue>",
     "OBJNAM": "<subFieldValue>",
     "cellName": "<subFieldValue>",
     "compilationScale": "<subFieldValue>"
     }
    }
   ]
  }

JSON Response examples

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

Example 1

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
 {
  "results": [
   {
    "layerId": 0,
    "layerName": "S57 Cells",
    "value": "GB4X0000.000",
    "displayFieldName": "DSNM",
    "foundFieldName": "DSNM",
    "value": "GB4X0000.000",
    "attributes": {
     "DSNM": "GB4X0000.000",
     "EDTN": "4",
     "UPDN": "0",
     "CSCL": "45000"
    },
    "geometryType": "esriGeometryPolygon",
    "geometry": {
     "spatialReference": {
      "wkid": 4326
     },
     "rings": [
      [
       [
        60.7749955000,
        -32.6250103000
       ],
       [
        60.7749955000,
        -32.3294577000
       ],
       [
        61.3172987000,
        -32.3294577000
       ],
       [
        61.3172987000,
        -32.6250103000
       ],
       [
        60.7749955000,
        -32.6250103000
       ]
      ]
     ]
    }
   }
  ]
 }

Example 2

The following is an example of a response for example 2, searching for Rosset Island in either OBJNAM or NOBJNM attributes.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 {
  "layerId": 0,
  "layerName": "S57 Cells",
  "value": "439",
  "displayFieldName": "rcid",
  "foundFieldName": "OBJNAM",
  "value": "439",
  "attributes": {
   "rcid": "439",
   "LNAM": "GB120871051300174",
   "objectType": "LNDARE",
   "objectTypeDescription": "Land area",
   "OBJNAM": "Rossett Island",
   "NOBJNM": "Rössett Inseln",
   "cellName": "GB5X01NE.000",
   "compilationScale": "22000"
  }
 }

JSON error response syntax

This example shows the syntax of an error response.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
 {
 "error": {
  "code": <value>,
  "message": "<errorMessage>",
  "details": [
   "<detailedMessage>"
   ]
  }
 }

JSON error response example

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
 {
 "error": {
  "code": 400,
  "message": "Bad Request",
  "details": [
   "searchText must be specified"
  ]
 }
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.