Ok so I have a PostgreSQL Table, to which I added a PostGIS geometry column using:
SELECT AddGeometryColumn ('public','my_table','geom',4326,'POINT',2);
UPDATE public.my_table SET geom = st_geometryfromtext('POINT('|| lon ||' '|| lat ||')',4326);
I then publish this table as WFS 1.0.0 using Geoserver 2.12.0. When I make a query using filter
DWITHIN(geom, Point(lon lat), distanceInDegrees, meters)
my query returns geojson with zero features.
If I query using
DWITHIN(geom, Point(lon lat), distanceInMeters, meters)
then I get correct results within the specified radius. I simply cannot figure out why the units are meters and not degrees when native EPSG is 4326? In the past when I have published layers as 4326, DWITHIN always took only degree units.
The layer configs in Geoserver:
native srs - EPSG:4326
declared srs - EPSG:4326
srs handing - Force Declared