Skip To Content

REST API Syntax

Details of the REST API

The Geoportal REST interface follows the design of the ArcGIS Server REST API. Through the REST API, it is possible to query the locally-hosted resources, and also resources hosted on remote repositories. These two scenarios are shown below. In these scenarios, requestParameter is a placeholder for a REST parameter. REST parameters are discussed later in this topic.

  • To query the local geoportal catalog only, use the following url pattern: http://machineName/geoportal/rest/find/document?requestParameter
  • To query remote repositories, use the following url pattern: http://machineName/geoportal/rest/distributed?rid=repositoryID&requestParameters. Here, the rid parameter is the identification for the repository being searched.

By using multiple rid parameters, you can search multiple repositories at the same time. Use the following url pattern: http://machineName/geoportal/rest/distributed?rid=repositoryID1&rid=repositoryID2&requestParameter

Here is an example: http://exampleserver/geoportal/rest/distributed?rid=local&rid=ArcGIS.COM&start=1&max=10&orderBy=relevance&searchText=water&f=atom

The table below lists the parameters that are available in the Geoportal REST API. For a full description of each parameter, refer to the com.esri.gpt.control.georss and com.esri.gpt.control.rest.searchpackages in the Geoportal Javadoc. For requests that have more than one parameter, the parameters must be concatenated using the ampersand (&) symbol. Use the following url pattern: http://machineName/geoportal/rest/find/document?requestParameter1&requestParameter2&...

requestParameterFunctionAccepted Values

bbox

Query by extent specified as two pairs of coordinates (west-south and east-north)

Comma-delimited string of integers between -180,180 and -90, 90.

spatialRel

Query by spatial relationship. Used in conjunction with bbox parameter.

String value. One of esriSpatialRelWithin (default), esriSpatialRelOverlaps.

searchText

Query by keyword

String value representing a keyword.

contains

Keyword concatenation options. This parameter is obsolete with the Lucene syntax.

For an exact match use double quotes. For example, see the syntax for two terms, Hawaii and quads:

  • Exact: "Hawaii quads"
  • Any: Hawaii quads
  • All: +Hawaii+quads
http://serverName/geoportal/rest/find/document?searchText="Hawaii quads"&f=georss

contentType

Query by content type

String value representing an ESRI content type. See Javadoc for complete list.

dataCategory

Query by data category (ISO 19115 themes)

Comma-delimited list of strings. Keywords identified by the ISO 19115 specification. See JavaDoc for complete list.

after, before

Query by date

Date string in the format yyyy-mm-dd.

orderBy

Result sort options

String value. One of areaAscending, areaDescending, dateAscending, dateDescending (default), format, relevance, title.

max

Specify max number of records to retrieve.

Integer. There is a limit of max=100 on unqualified queries. An 'unqualified query' is when there are no search parameters set. The limit on qualified queries is max=5000. Default: 10.

geometryType

Defines how spatial data will be represented.

String value. One of esriGeometryPoint, esriGeometryPolygon (default), esriGeometryBox.

f

the response format

String value. One of georss (default), atom, json, kml, html, htmlfragment, or csv (starting at version 1.2).

style

CSS stylesheet for HTML results

String value representing a URL to a stylesheet.

target

Behavior of links (open in same or new window).

String value. One of blank (default), parent, self, top.

rid

Id associated with the repository. Multiple rid parameters are allowed for comparing results between different repositories

String value.

rids

Comma Delimited rid. Can be used instead of the multiple ridparameters.

String values.

maxSearchTimeMilliSec

Maximum amount of time allowed to retrieve results.

Integer. Default is 5000 milliseconds.


在本主题中
  1. Details of the REST API