This project has moved and is read-only. For the latest updates, please go here.

Getting the exterior rings of a vector layer

Topics: General Topics
Feb 13, 2007 at 11:28 AM

What I basically want to do is set the interior rings property of a polygon to be equal to the exterior rings of another polygon. Any idea as to how I would go about this? I can't seem to get the exterior rings from a vector layer as a LinearRing no matter what I try!


Feb 13, 2007 at 12:59 PM
Persevere and you'll figure it out. I should remember that! Anyway, I managed to get something that works -

SharpMap.Data.Providers.GeometryProvider inside = new SharpMap.Data.Providers.GeometryProvider(
foreach (SharpMap.Geometries.MultiPolygon multi in inside.Geometries)
    foreach (SharpMap.Geometries.Polygon poly in multi)

Where "area" is the vector layer I needed to get the data from, "map" is the map I am working with, and "mask" is the polygon I was adding the interior rings to.