Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Spatial Queries using CQL in uDig

Andrea Aime ha scritto:
Jody Garnett ha scritto:
I had not thought of that; I always figured that the datastore should
handle this part (especially if the actual units are provided). If
people are keen we could review the postgis code and make a utility
method for the various datastore implementations to call?

Very few data sources actually have the machinery to deal with
dwithin on geographic data.
PostGIS does only starting with version 1.5, Oracle does,
I guess probably DB2 does too, maybe SDE too.
That said, I have no idea if the SQL encoders actually pass
down the unit.

To support shapefiles we'd have to add code to make the in
memory dwithin take care of the math necessary to compute
point to line distances on an ellipsoid (the code I was
referring to before)

Oh, alternatively, we buffer the geometry instead and turn dwithin into
an overlaps check.
To buffer the geometry without too much deformation we project
it using UTM, buffer, project back. If the geometry is large,
we slice it up into parts that sits into the various UTM zones,
buffer each, project back, unite.
We can also make the UTM slices smaller to get greater precision,
afaik UTM zones are designed so that you get 20m linear deformation
at their borders, but if we take a less than 6 degree wide area it
will be less

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.


Back to the top