GetFeatureInfo Requests

Feedback


Request parameters

The main request parameters for the GetFeatureInfo operation are shown in the following table:

Table 1 Main Parameters of GetFeatureInfo Operation Request

Request parameters Whether it is required Description
VERSION=version

Yes

Request version number.

REQUEST=GetFeatureInfo

Yes

Request name.

Request GetFeatureInfo operation. The request name needs to be set to GetFeatureInfo ".

Yes

A partial copy of the

Get Map request parameter.

The VERSION and REQUEST parameters

are not included. Determine the target map of the query, that is, on which map picture to query.

QUERY_LAYERS=layer_list

Yes

A list of layers

to be queried, separated by commas.

INFO_FORMAT=output_format

Yes

The return format (MIME type) of the

feature information.

Can be an application/vnd. Ogc. WMS _ XML. , application/geojson , text/xml , text/html。

FEATURE_COUNT=number

No

Number of elements

to return information (default is 1).

With ( I , J ) as the center point, according to The request parameters BBOX, Width and Height in the GetMap operation determine the radius of the initial search range and search the specified query layer. If the result returned by the query is less than user-specified The number value will double the search radius and continue to search. If the number of query results meets the number of elements returned as required by the user, the results will be returned. Otherwise, the radius will continue to be expanded. When the search radius reaches 8 times of the initial search radius, the query is terminated, the query result is returned, and the query of the next layer is entered.

The query order of layers is consistent with the order in the layer list to be queried.

I=pixel_column

Yes

The feature's X coordinate

in pixels (0 on the leftmost side, increasing to the right).

J=pixel_row

Yes

The Y coordinate of the feature in pixels (0 on the topmost side, increasing downward).

BBOX=minx,miny,maxx,maxy

No

As GetMap.

When querying with this parameter, it supports returning a response body in application/geojson format. The response body contains the LayerName, which is the title in the capability document obtained by the GetCapabilities operation.

Please note: This parameter and the layerDefs parameter must selected one, and can also be set at the same time and will take effect at the same time.

layerDefs

No

Attribute filtering, the syntax is  {<layer1>:<layerDefs1>,<layer2>:<layerDefs2>}, the filter conditions of different layers are separated by ','.

Among them, the value of <layer1>,<layer2> is the value of the layer attribute Name in the capability document; the supported comparison operations inclue =, <>, >, >=, <, <=; the supported string matching operations include BETWEEN AND, IN, like; the supported logical relationship judgement includes AND, OR, NOT. An example is as follows:

layerDefs={"0.11":"Shape_Area <500 and OBJECTID>100","0.12": "STATE_NAME LIKE‘N%'"}   

When querying with this parameter, it supports returning a response body in application/geojson format. The response body contains the LayerName.

Please note: This parameter and the layerDefs parameter must selected one, and can also be set at the same time and will take effect at the same time. This parameter only takes effect for vector layers.

EXCEPTIONS=exception_format

No

Exception reporting format for WMS (default is application/vnd.ogc.se_xml).

Request example

The GetFeatureInfo operation is requested as follows:

<ServiceRoot>?Version=version&REQUEST=GetFeatureInfo&<map_request_copy>& QUERY_LAYERS=layer_list&INFO_FORMAT=output_format&I=pixel_column&J=pixel_row

ServiceRoot is the URI root directory of the service. Please refer to URI settings .

For example, after the native SuperMap iServer WMS 1.3.0 service starts successfully, access GetFeatureInfo operation URI is: http://localhost:8090/iserver/services/map-world/wms130/WorldMap_Day?VERSION=1.3.0&REQUEST=GetFeatureInfo&LAYERS=0.8,0.11,0.3&STYLES=&CRS=CRS:84&BBOX=-180,-90,180,90&WIDTH=800&HEIGHT=400&FORMAT=image/png&QUERY_LAYERS=0.11&INFO_FORMAT=text/xml&I=650&J=150&layerDefs={"0.11":"SMID<200"}&INFO_FORMAT=application/geojson.

The response result of this request example is shown in the Response example .