overlapping of two geometries with different coordinatsystem

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

overlapping of two geometries with different coordinatsystem

"Weßling, Achim"
Hallo,

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?

--
Mit freundlichem Gruß

Achim Weßling
===========================================
INFOKOM Gütersloh AöR
Fachbereich II - Technische Anwendungen
Herzebrocker Str. 140
33334 Gütersloh
Tel.: 05241/85-2926
[hidden email]
http://www.infokom-gt.de


Reply | Threaded
Open this post in threaded view
|

Re: overlapping of two geometries with different coordinatsystem

Nicolas Ribot-2
> 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

Reply | Threaded
Open this post in threaded view
|

Re: overlapping of two geometries with different coordinatsystem

strk-2
In reply to this post by "Weßling, Achim"
On Tue, Jun 21, 2005 at 03:49:02PM +0200, Achim Weßling wrote:

> Hallo,
>
> 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?

What do SRID(point_etrs89) and extent(point_etrs89) return ?
--strk;

>
> --
> Mit freundlichem Gruß
>
> Achim Weßling
> ===========================================
> INFOKOM Gütersloh AöR
> Fachbereich II - Technische Anwendungen
> Herzebrocker Str. 140
> 33334 Gütersloh
> Tel.: 05241/85-2926
> [hidden email]
> http://www.infokom-gt.de
>
> _______________________________________________
> postgis-users mailing list
> [hidden email]
> http://postgis.refractions.net/mailman/listinfo/postgis-users