Search for Features by ID

Description

Returns features in a named table in the repository defined by its ID. By default, all information in the response is included. Specify attributes to return a subset of the features.

This operation returns a feature collection JSON that can be passed to a render map or render legend request in the Mapping service.

ACL Authorization Flow

To return features in a named table in the repository defined by its ID, the user (or the role they belong to) needs EXECUTE permission on the Named table.

HTTP GET URL Format

The following format is used for HTTP GET requests:

HTTP GET /tables/tablename/features.rep;[attributes=attname]/key?destinationSrs

Parameters

For information on the parameter types listed below, see Request URL Data Types.

Parameter Type Required Description
tablename String yes The name of the table to return features for. The table is specified by a Regex for the named table to render based on the location of the named table in the Repository. The name of the named table is defined between the /tables portion of the URL and the /features.rep portion of the URL. For example, to return the features for a named table located at /Samples/NamedTables/WorldTable in the Repository, the following URL would be used:
.../FeatureService/tables/Samples/NamedTables
/WorldTable/features.json;...
rep String yes The representation to be returned. Supported representation is json.
attributes=attname String no The attribute names of the feature to be returned in the response. By default all attributes are returned. More than one attribute is defined by a comma separated list. This is a simple way of limiting the amount of information in the response to include only the information requested. Each feature in the resulting feature collection will only contain the specified attributes. For example, if the table contains four attributes, but only two are required in the response, those two attribute names can be specified here (separated by a comma) and the values for the other two will not be returned.
destinationSrs String no The coordinate system to return the resulting geometries. The default is the coordinate system of the data used (for example: epsg:4326).
key String yes The ID of the feature to be returned. This is either the ID (for .tab files) or the primary key (for dbms) of the feature in the table.

Returns

Returns specified features in a named table in the repository.

{
"type":"FeatureCollection","Metadata":[{"type":"String","name":"Country"},
{"type":"String","name":"Capital"},{"type":"String","name":"Continent"}],​
"features":[{"type":"Feature","id":"43","properties":{"Country":"China","Capital":"Beijing",​"Continent":"Asia"}}]	
}

Examples

Returns all the features for record ID=43 (China) for the table WorldTable located in the /Samples/NamedTables directory in the Repository

http://hostname:port/rest/Spatial/FeatureService/tables/Samples/NamedTables/​WorldTable/features.json/43?destinationSrs=epsg:3857

Returns a subset (Country, Capital, and Continent) of the features for record ID=43 (China) for the table WorldTable located in the /Samples/NamedTables directory in the Repository, in the Locale English (US)

http://hostname:port/rest/Spatial/FeatureService/tables/Samples/NamedTables/WorldTable/features.json/43;attributes=Country,Capital,Continent,Obj