[GIS] How to return more features from GetFeatureInfo

geoservergetfeatureinfowms

I configured WFS service with "Maximum number of features for preview" to 50 but when i try to get features my request returns only one value, for example

{"type":"FeatureCollection","totalFeatures":"unknown","features":[{"type":"Feature","id":"","geometry":null,"properties":{"GRAY_INDEX":-9999}}],"crs":null}

and with &feature_count parameter geoserver accepts only 50 as value but also adding this the ouput is the same the above. Instead I want an output as:

{"type":"FeatureCollection","totalFeatures":"unknown","features":[{"type":"Feature","id":"","geometry":null,"properties":{"GRAY_INDEX":-9999}}, {"type":"Feature","id":"","geometry":null,"properties":{"GRAY_INDEX":4}}],"crs":null}

EDIT1:

In my Geoserver I have multiple time spaced rasters for each layer. When I try the GetFeatureInfo request above I specify also a time range as &time=[from]/[to]. Because the bounding box of these rasters are overlapped, I want that the WMS request returns a list of pixel features when I click on the overlapped area.

EDIT2:

The request is:

geoserver/ows?service=wms&request=GetFeatureInfo&info_format=application/json&feature_count=50&exceptions=application/json&bbox=-4.226473,39.039063,16.516447,79.980469&layers=id210s013016r000-europe&query_layers=id210s013016r000-europe&width=381&height=752&crs=EPSG:4258&time=2016-03-03T23:00:00.000Z/2016-03-04T20:00:00.000Z&i=338&j=134

Best Answer

You are making a GetFeatureInfo request to a WMS service, the WMS is required by the standard to return information about the point you have clicked on. If there is more than one feature at the point then it may return information about all the features (up to featureCount) that are there.

You seem to be asking for information about a raster so the request returns the value of the pixel that is at the point you have clicked on. Since you seem not to have many layers there you will only get back one pixel's value regardless of how high you set featureCount.

If you are trying to fetch an area of the raster then you probably want to look at using a Web Coverage Service (WCS) request.

Related Question