예제 #1
0
        internal static DotSpatial.Topology.Polygon ToDotSpatialPolygon(GeoAPI.Geometries.IPolygon geom)
        {
            DotSpatial.Topology.LinearRing exteriorRing = ToDotSpatialLinearRing((GeoAPI.Geometries.ILinearRing)geom.ExteriorRing);

            DotSpatial.Topology.LinearRing[] interiorRings = new DotSpatial.Topology.LinearRing[geom.InteriorRings.Count()];

            //foreach (GeoAPI.Geometries.ILineString interiorRing in geom.InteriorRings)
            for (int i = 0; i < geom.InteriorRings.Count(); i++)
            {
                DotSpatial.Topology.LinearRing hole = ToDotSpatialLinearRing((GeoAPI.Geometries.ILinearRing)geom.InteriorRings[i]);
                interiorRings[i] = hole;
            }

            return(new DotSpatial.Topology.Polygon(exteriorRing, interiorRings));
        }
예제 #2
0
        internal static DotSpatial.Topology.Polygon ToDotSpatialPolygon(GeoAPI.Geometries.IPolygon geom)
        {
            DotSpatial.Topology.LinearRing exteriorRing = ToDotSpatialLinearRing((GeoAPI.Geometries.ILinearRing)geom.ExteriorRing);

            DotSpatial.Topology.LinearRing[] interiorRings = new DotSpatial.Topology.LinearRing[geom.InteriorRings.Count()];

            //foreach (GeoAPI.Geometries.ILineString interiorRing in geom.InteriorRings)
            for (int i = 0; i < geom.InteriorRings.Count(); i++)
            {
                DotSpatial.Topology.LinearRing hole = ToDotSpatialLinearRing((GeoAPI.Geometries.ILinearRing)geom.InteriorRings[i]);
                interiorRings[i] = hole;
            }

            return new DotSpatial.Topology.Polygon(exteriorRing, interiorRings);
        }