[postgis-users] overlapping of two geometries with different coordinatsystem
Nicolas Ribot
nicky666 at gmail.com
Tue Jun 21 06:04:09 PDT 2005
> I've a postgis-table with some attributes and geometry-column with the
> SRID 25832. Now I want to make a spatialquery in which I use another
> SRID like follows:
>
> SELECT * FROM pktlage
> WHERE point_etrs89 && setSRID('BOX3D(3439540.0 5766038.0,3440650.83
> 5767171.05)'::box3d, 31467);
>
> The result is empty, but I know for sure there have to be some hits.
> Isn't it possible to use two different SRID's in one query?
>
Hello,
Are you sure your box3D coordinates are in the same coordinate system
(CS) as point_etrs89 is ?
If it is not the case, you have to reproject your box3d into the
point_etrs89 CS. Just forcing a SRID is not enough for the query to
work.
Something like:
SELECT * FROM pktlage
WHERE point_etrs89 && transform(setSRID('BOX3D(3439540.0
5766038.0,3440650.835767171.05)'::box3d, 31467), 25832);
Your box3d extent will then be reprojected from the 31467 CS to the 25832 one.
Nicolas
More information about the postgis-users
mailing list