0

I want to send GetFeatureInfo request to my GeoServer and get response as JSON.

My query string parameters are like this:

  • request:GetFeatureInfo
  • service:WMS
  • info_format:application/json
  • exceptions:text/javascript
  • version:1.1.0
  • ...
  • ...

But my response comes like this:

Results for FeatureType 'http://localhost:8080/geoserver/App:line':
--------------------------------------------
gid = 590545
geom = ...
name = ...
--------------------------------------------

I want to get response as JSON result.

I set exceptions:application/json but it did not work.

This was working before, but I moved GeoServer to another server. I think some settings are not set in a config file about JSON response.

My GetCapabilities response is like this:

  <GetFeatureInfo>
    <Format>text/plain</Format>
    <Format>application/vnd.ogc.gml</Format>
    <Format>application/vnd.ogc.gml/3.1.1</Format>
    <Format>text/html</Format>
    <Format>text/javascript</Format>
    <Format>application/json</Format>
0

Is APP:line some application schema layer? To show that json infoformat can work, try

http://demo.geo-solutions.it/geoserver/topp/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=topp%3Astates&STYLES&LAYERS=topp%3Astates&INFO_FORMAT=application/json&FEATURE_COUNT=50&X=50&Y=50&SRS=EPSG%3A4326&WIDTH=101&HEIGHT=101&BBOX=-117.1142578125%2C32.8271484375%2C-108.2373046875%2C41.7041015625

  • "App" stands for workspace, "line" is layer name – barteloma Nov 22 '17 at 19:30
  • Do you get json response from your own GeoServer with the above request if you change the server address to localhost:8080? – user30184 Nov 22 '17 at 20:06
  • I fixed solution as change my parameter names to upper case. Lower case named info_format does not work. Why? – barteloma Nov 23 '17 at 8:32
  • Maybe a bug. In WMS standard the keys are not case-sensitive while the values are. Which GeoServer versions you run on your old and new servers? – user30184 Nov 23 '17 at 8:41
  • Geoserver version is 2.5.1 – barteloma Nov 23 '17 at 10:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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