[gdal-dev] Problems with OGRGeometry Intersects

Even Rouault even.rouault at mines-paris.org
Wed Sep 5 07:02:08 PDT 2012


Selon Gabriel Fusca <gabrielfusca at suremptec.com.ar>:

> Hi,
>
> Thanks for the answer.
>
> > OGRPoint querypoint = OGRPoint(Point.x_, Point.y_);
> > querypoint.assignSpatialReference(new OGRSpatialReference(SrWkt.c_str()));
>
> It is not necessary to transform the query point because the Point is at
> the same spatial reference system.

Good.

>
> > pgeometry->Intersects(pquerypoly)
>
> Intersects perform a transformation to verify the intersection of the
> geometries?

No. The geometries passed to Intersects (and all other methods that take 2
geometries as input) must be in the same SRS. So you have to transform one of
them to the SRS of the other with TransformTo().


More information about the gdal-dev mailing list