2

I formulate a GetFeatureInfo request that returns the feature information of the centre point of the map. The GetFeatureInfo request for WMS is:

http://geoservices-inspire.irisnet.be/geoserver/cirb_cibg/ows?request=GetFeatureInfo&FORMAT=text/xml&CRS=CRS:84&SRSKEY=CRS&STYLES=&WIDTH=1500&HEIGHT=1500&version=1.3.0&LAYERS=TN.RoadTransportNetwork.RoadArea&PROJECTION=CRS:84&BBOX=4.2254877427993645,50.750177078705356,4.4957029774594135,50.921063532317916&service=WMS&TRANSPARENT=TRUE&query_layers=TN.RoadTransportNetwork.RoadArea&I=750&J=750

enter image description here

Now, I want to ask, does this feature selected can be shown in an image format. I have tried to use the GetMap request (in WMS) for the above I & J values as:-

http://geoservices-inspire.irisnet.be/geoserver/cirb_cibg/ows?request=GetMap%20&FORMAT=image/png&CRS=CRS:84&SRSKEY=CRS&STYLES=&WIDTH=1500&HEIGHT=1500&version=1.3.0&LAYERS=TN.RoadTransportNetwork.RoadArea&PROJECTION=CRS:84&BBOX=4.2254877427993645,50.750177078705356,4.4957029774594135,50.921063532317916&service=WMS&TRANSPARENT=TRUE&query_layers=TN.RoadTransportNetwork.RoadArea&I=750&J=750

The result is as shown in figure:-

GetFeatureInfo response

Doesn't the map display only the map features containing the above I and J value? Can't image be produced using GetMap request for the particular I and J value? Why is this image displaying full?

1
  • 1
    Can't image be produced using GetMap request for the particular I and J value? No. a GetMap request needs bounding box. A GetFeatureInfo request is a request for what ever information the service wants to supply at a pixel location in a map
    – nmtoken
    Commented Feb 4, 2022 at 11:25

1 Answer 1

2

You can ask that question from the WMS server with GetCapablities.

http://geoservices-inspire.irisnet.be/geoserver/cirb_cibg/ows?service=WMS&version=1.3.0&request=GetCapabilities

The section about GetFeatureInfo request contains the supported formats

<GetFeatureInfo>
<Format>text/plain</Format>
<Format>application/vnd.ogc.gml</Format>
<Format>text/xml</Format>
<Format>application/vnd.ogc.gml/3.1.1</Format>
<Format>text/xml; subtype=gml/3.1.1</Format>
<Format>text/html</Format>
<Format>application/json</Format>

None of these formats is image format. the meaning of the request is to return data about the selected feature and attributes cannot be expressed in image. But you can as the server to send the response back as GeoJSON

http://geoservices-inspire.irisnet.be/geoserver/cirb_cibg/ows?request=GetFeatureInfo%20&FORMAT=text/xml&CRS=CRS:84&SRSKEY=CRS&STYLES=&WIDTH=1500&HEIGHT=1500&version=1.3.0&LAYERS=TN.RoadTransportNetwork.RoadArea&PROJECTION=CRS:84&BBOX=4.2254877427993645,50.750177078705356,4.4957029774594135,50.921063532317916&service=WMS&TRANSPARENT=TRUE&query_layers=TN.RoadTransportNetwork.RoadArea&I=750&J=750&info_format=application/json

The response is

{"type":"FeatureCollection","features":[{"type":"Feature","id":"TN.RoadTransportNetwork.RoadArea.15412","geometry":{"type":"MultiPolygon","coordinates":[[[[4,51],[4,51],[4,51],[4,51],[4,51],[4,51],[4,51],[4,51],[4,51],[4,51],[4,51],[4,51],[4,51],[4,51]]]]},"geometry_name":"the_geom","properties":{"gml_id":"BE.BRUSSELS.BRIC.ADM.SS.10208","gml_identi":"http://urbisdownload-v2.gis.irisnet.be/en/temporality#BE.BRUSSELS.BRIC.ADM.SS.10208","gml_descri":"","insp_ns":"http://urbisdownload-v2.gis.irisnet.be/en/temporality#","insp_id":"BE.BRUSSELS.BRIC.ADM.SS.10208","name_fr":"","name_nl":"","spec":"","bbox":[4,51,4,51]}}],"totalFeatures":"unknown","numberReturned":1,"timeStamp":"2022-02-04T09:19:05.945Z","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:EPSG::4326"}},"bbox":[4,51,4,51]}

Now you could make your application to parse the GeoJSON and render the geometry on the map. But unfortunately the geometry that the server sends is nonsense, a multipolygon with all vertices at coordinates (4,51). I guess that is because the service provider does not want to send accurate geometries with GetFeatureInfo requests.

6
  • I assume 4,51 accurately portrays the point clicked
    – nmtoken
    Commented Feb 4, 2022 at 11:17
  • As rounded info full degrees, yes. The clicked point calculated by the BBOX is at 4.36059536,50,83562031.
    – user30184
    Commented Feb 4, 2022 at 11:25
  • @user30184 could you let me know how you figure out it
    – Walker
    Commented Feb 4, 2022 at 17:38
  • BBOX is BBOX=4.2254877427993645,50.750177078705356,4.4957029774594135,50.921063532317916. Image size in GetMap is WIDTH=1500&HEIGHT=1500. The clicked pixel is in the middle of the BBOX of the GetMap because I=750&J=750.
    – user30184
    Commented Feb 4, 2022 at 18:25
  • @user30184 Yes, it's According to GetFeature Info Request but My query is how you came to know the coordinate value is 4.36059536,50,83562031 for the center point of the map.
    – Walker
    Commented Feb 4, 2022 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.