[gdal-dev] Question regarding OGRPolygon intersection

Even Rouault even.rouault at mines-paris.org
Tue Jun 10 09:17:32 PDT 2014


Silas,

More exactly, GEOS is a port in C++ of JTS. It does exactly what JTS does for
this, so it considers the coordinates as being located on a 2D cartesian plane.
No spherical/ellipsoidal geometry is involved.

Even

> Hi,
>
> I was hoping to use GDAL for testing when two convex polygons intersect. I
> was able to do this with something similar to:
>
> polyOne->Intersects(polyTwo);
>
> Both polyOne and polyTwo are OGRPolygon and are defined in geographic
> coordinates, i.e. latitude and longitude (decimal degrees). I've also set the
> spatial reference of the polygons to 'SetWellKnownGeogCS("WGS84")'. Also,
> I've built GDAL with GEOS.
>
> My question is this, what coordinate system is the intersection calculated
> in?   Looking through the code, it appears that GDAL uses GEOS for the
> intersection test, and GEOS seems to rely on JTS for the intersection test.
> However, JTS describes itself as providing '... algorithms for processing
> linear geometry on the 2-dimensional cartesion plane'.
>
> So, as an example, if my polygons each contain three vertices, are they
> treated as spherical triangles in a geographic coordinate system (with curved
> edges) when the intersection test is performed? Or, are then treated as flat
> triangles with straight edges in some Cartesian / 2D coordinate system.
>
> I appreciate any help answering this question,
>
> Silas
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
>




More information about the gdal-dev mailing list