0

I am trying to call a WFS GetFeature service to "implement" onClick get feature attribute popup (info window) but I am getting empty JSON. Here is WFS link that I am calling:

http://geo-polis.gistemp.com/geoserver/wfs?request=GetFeature&version=2.0.0&typeName=geopolis:zwnh_ymhttou&BBOX=37.896877%2C23.79923%2C37.89999%2C23.799334,EPSG:4326&OUTPUTFORMAT=json&service=WFS&

The response that I am getting is:

{"type":"FeatureCollection","totalFeatures":0,"features":[],"crs":null}

Update:

I want to implement the onClick GetFeatureInfo feature on Android, is this right service to use? or is there any other method (WMS) or some thing that I can use?

1

I get the same result as you for the query you have used as an example, but the issue here is not the format of the request, but the area you have requested, and the CRS you have used.

So the following request without a bounding box returns results:

http://geo-polis.gistemp.com/geoserver/wfs?request=GetFeature&version=2.0.0&typeName=geopolis:zwnh_ymhttou&OUTPUTFORMAT=json&

If we look at the GetCapabilities response for the WFS as below, it appears that only EPSG::2100 is supported as a projection system

WFS GetCapabilities response

A working example request would be (GML response):

http://geo-polis.gistemp.com/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=geopolis:zwnh_ymhttou&SRSNAME=EPSG:2100&BBOX=479527.13101878523593768,4199962.16102483868598938,483001.70940413506468758,4203190.46729042567312717&

or (JSON response):

http://geo-polis.gistemp.com/geoserver/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=geopolis:zwnh_ymhttou&SRSNAME=EPSG:2100&BBOX=479527.13101878523593768,4199962.16102483868598938,483001.70940413506468758,4203190.46729042567312717&OUTPUTFORMAT=json&

So that's how to do a subset of the WFS features for this service, but in your update however you talk about doing a GetFeatureInfo request, which is, as you enquire about, an operation of a WMS.

It appears that there is a WMS service from the same server for this data with the following GetCapabilities.

A WMS GetMap request could be:

http://geo-polis.gistemp.com:80/geoserver/ows?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=477984.98100527498172596,4198759.93393220193684101,487566.3494642463629134,4205879.80060623586177826&CRS=EPSG:2100&WIDTH=1286&HEIGHT=955&LAYERS=geopolis:zwnh_ymhttou&STYLES=&FORMAT=image/png&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE&

and a GetFeatureInfo request on this map could be (HTML response):

http://geo-polis.gistemp.com:80/geoserver/ows?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&BBOX=476047.82170363649493083,4198759.93393220193684101,487566.3494642463629134,4205879.80060623586177826&CRS=EPSG:2100&WIDTH=1545&HEIGHT=955&LAYERS=geopolis:zwnh_ymhttou&STYLES=&FORMAT=image/png&QUERY_LAYERS=geopolis:zwnh_ymhttou&INFO_FORMAT=text/html&I=710&J=493&FEATURE_COUNT=10&

or (JSON response)

http://geo-polis.gistemp.com:80/geoserver/ows?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetFeatureInfo&BBOX=476047.82170363649493083,4198759.93393220193684101,487566.3494642463629134,4205879.80060623586177826&CRS=EPSG:2100&WIDTH=1545&HEIGHT=955&LAYERS=geopolis:zwnh_ymhttou&STYLES=&FORMAT=image/png&QUERY_LAYERS=geopolis:zwnh_ymhttou&INFO_FORMAT=application/json&I=710&J=493&FEATURE_COUNT=10&

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.