I think I figured out why this wasn't working, I guess LinearRings aren't considered full-fledged geometry objects, so it only works if you add it to a polygon, then test for intersections.
Thanks anyway... Amanda -----Original Message----- From: Henneke, Amanda M Sent: Thursday, April 16, 2009 10:07 AM To: [email protected] Subject: [gdal-dev] Geometry.Intersects and .Intersection 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 _______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev _______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
