I'm new to GeoServer andI want to buffer an area around a point. I'm using a DWithin WFS filter but not getting any results. Please tell me the correct format to use DWithin.

My GET request:


Result obtained:

no buffering is done.. all the points are obtained. What to do?

  • I don't think you can have two cql_filters try using an AND – Ian Turton Jan 29 '15 at 9:11
  • Good comment but main issue is that DWITHIN does not make sense at all. Use one filter at a time and combine them only after you know that each part is OK. – user30184 Jan 29 '15 at 9:19

Here is an example of the syntax for DWITHIN

http://demo.opengeo.org/geoserver/wfs?request=getfeature&version=1.0.0&service=wfs&typename=topp:states&outputformat=json&cql_filter=DWITHIN(the_geom,Point(-88 38),0.1,kilometers)

Note that DWITHIN takes three parameters: reference geometry, distance, and distance unit. However, GeoServer does not really support units so that it could convert kilometers to degrees. In this example the topp:states is having degrees as units and degrees is also used for building the buffer even I wrote kilometers as units. Units does not really do anything but it is a compulsory parameter for the DWITHIN and degrees does not belong to the list of accepted units. I consider this as a bug in GeoServer.

Acceptable units are one of: "feet", "meters", "statute miles", "nautical miles", "kilometers".

  • how can we use multiple filters..? i tried using wfs filters but it results in index out of bound error...i don't know the cause of this error – user3266988 Feb 8 '15 at 17:04

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.