Hoetmaaiers
Hoetmaaiers

Reputation: 3503

WFS GetFeature request feature with lat/lng literal

According to the Geoserver documentation: https://docs.geoserver.org/master/en/user/services/wms/reference.html#getfeatureinfo it is preferred to use the WFS GetFeature service over WMS GetFeatureInfo as literally cited:

The GetFeatureInfo operation requests the spatial and attribute data for the features at a given location on a map. It is similar to the WFS GetFeature operation, but less flexible in both input and output. Since GeoServer provides a WFS service we recommend using it instead of GetFeatureInfo whenever possible.

I have been looking for a way to request all matching features for a lat/lng point and the shape of a layers geometry via WFS GetFeature. I can't find it and the cql_filter combiantion with within or intersects won't get me any further. Any good documeantion or examples someone has to share?

Upvotes: 1

Views: 978

Answers (1)

frankiie
frankiie

Reputation: 498

Don't know if you are still needed, but just provides for others who need.

WFS GetFeature request feature with lat/lng literal:

{youHost}/geoserver/wfs?service=WFS&version=1.0.0&request=GetFeature&typeName={yourTypeName}&srsName=EPSG:4326&maxFeatures=10000&format_options=callback:getJson&cql_filter=INTERSECTS(geom, POINT ({long} {lat}))

Upvotes: 2

Related Questions