[gdal-dev] Geometry.Intersects and .Intersection
Henneke, Amanda M
amanda.m.henneke at boeing.com
Thu Apr 16 11:06:45 EDT 2009
Hello everyone-
Has anyone played with Geometry.Intersects or Geometry.Intersection?
I have an instance where the Geometry.Intersects method returns true on
two LinearRings, but then when I do the Intersection, it's returning
nothing (null). I'm not sure why this would be. I found a few things
on the web about the versions of FWTools. I am using 1.3.5 with the C#
API for GDAL/OGR.
Any help/advice would be appreciated. I've included a code snippet:
bool bIntersects = geoRing.Intersect(geoOldRing);
if (iPt > 0 && bIntersects)
{
Geometry geoRingDiff =
geoRing.Intersection(geoOldRing);
if (geoRingDiff != null)
{
wkbGeometryType gType =
geoRingDiff.GetGeometryType();
string text = "";
geoRingDiff.ExportToWkt(out text);
Console.WriteLine(text);
geoRingDiff.CloseRings();
geoRingNew = geoRing.Difference(geoRingDiff);
geoOldRing = geoRingNew.Clone();
// Add the ring to the polygon layer
geoPolygon.AddGeometry(geoRingNew);
}
}
Thanks,
Amanda
More information about the gdal-dev
mailing list