I am working using spatial filter Dwithin for WFS. I have worked using a simple filter using to show no of earthquake data for the year 2020 in GeoJSON format from the given WFS:- https://emidius.mi.ingv.it/services/italy/wfs/?service=wfs&version=2.0.0&request=GetFeature&typeNames=italy:CPTI_current&outputFormat=application/json&FILTER=%3CFilter%3E%3CPropertyIsEqualTo%3E%3CPropertyName%3EYear%3C/PropertyName%3E%3CLiteral%3E2020%3C/Literal%3E%3C/PropertyIsEqualTo%3E%3C/Filter%3E

However, I could get the value of no of earthquake points at a distance 500m from coordinates 14.964, 37.696 in GeoJSON format.The output is all GeoJSON data being selected which is not true. The link with spatial filter (that I have used for the provided WFS) is as shown:- https://emidius.mi.ingv.it/services/italy/wfs/?service=wfs&version=2.0.0&request=GetFeature&typeNames=italy:CPTI_current&outputFormat=application/json&%20FILTER=%3C%20Filter%3E%3CWithin%3E%3CPropertyName%3Egeometry%3C/PropertyName%3E%3CPoint%3E%3Ccoordinates%3E14.964,%2037.696%3C/%20coordinates%20%3E%3C/Point%3E%3CDistance%20units=%27m%27%3E5000%3C/Distance%3E%3C/Within%3E%3C/Filter%3E

  • You mention a WMS layer, but provide no link to one? Please clarify. Also, spatial operations on WMS-layers usually don't work?
    – Erik
    Jan 26, 2022 at 11:00
  • I was provided with end point for get feature request: emidius.mi.ingv.it/services/italy/wfs/… modified it get feature request and try to apply spatial filter encoding but that's not working.
    – Walker
    Jan 26, 2022 at 11:03
  • That's clearly a WFS service. Please edit your question accordingly.
    – user30184
    Jan 26, 2022 at 11:17
  • Sry I have changed it.
    – Walker
    Jan 26, 2022 at 11:21

1 Answer 1


There are multiple problems with your filter:

  1. The space before FILTER prevents the server parsing and using it
  2. You spelled DWithin wrong (Within is a different filter entirely)
  3. You are using the wrong geometry name (it's geom)
  4. Your unit needs to be meters
  5. Your point should not have a comma separating the coordinates.
  6. Probably a bunch of other stuff

So I switched to using CQL


which works but says there are no earthquakes with in 5 km of your point, but does find 46 if I flip the axis order of your point to give a dwithin(geom, POINT(37.696 14.964), 5, kilometers) and a final URL of:


Or if you prefer the OGC representation:

<?xml version="1.0" encoding="UTF-8"?>                                                                                  
<ogc:Filter xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc">
    <ogc:Distance units="kilometers">5.0</ogc:Distance>                                                                 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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