[Geoserver-users] Dwithin return all features

Hi all,

I test Dwithin with Geoserver 2.4 as following request:

http://localhost:8080/geoserver24/wfs?service=WFS&version=1.0.0&request=GetFeature&typeName=btdulich:diem_du_lich&outputFormat=json&sortby=priority+D&CQL_FILTER=Dwithin%28the_geom,LineString%28-71.05845%2042.359351,%20-71.0494%2042.3591%29,100,meters%29&srsName=EPSG:4326

response returns all features which are out of 100 meters from LineString.

response must return no features.

Origin EPSG of layer “btdulich:diem_du_lich” is 4326.

is my request is correct ?

I need your help to solve. Thanks in advance!

Bui.

Unless things have changed recently (I dont think so), Geoserver ignores the units parameter and treats the value as whatever the units of native SRS is. Thus your code is returning everything within 100 degrees! Try it with 0.0009.

Notice: This email and any attachments are confidential.
If received in error please destroy and immediately notify us.
Do not copy or disclose the contents.

On Mon, Sep 23, 2013 at 4:28 AM, Phil Scadden <p.scadden@anonymised.com> wrote:

Unless things have changed recently (I dont think so), Geoserver ignores
the units parameter and treats the value as whatever the units of native
SRS is. Thus your code is returning everything within 100 degrees! Try
it with 0.0009.

Depends on the store containing the data, there are two cases in which it
should work:
* store is postgis, and the data is stored as geography -> the unit is
ignored, but treated as meters
* oracle, the unit should be taken into consideration

Patches/funding to make this work for other stores would be appreciated :slight_smile:

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it for more
information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

-------------------------------------------------------