Exemple #1
0
        public static PolygonN FromCommon(IPolygon commonPolygon)
        {
            List <Ring> rings = new List <Ring>();

            rings.Add(Ring.FromCommon(commonPolygon.ExteriorRing));

            foreach (ILineString commonLineString in commonPolygon.InteriorRings)
            {
                rings.Add(Ring.FromCommon(commonLineString));
            }

            PolygonN agsPolygon = new PolygonN();

            agsPolygon.RingArray = rings.ToArray();

            return(agsPolygon);
        }
Exemple #2
0
        public static Geometry FromCommon(IGeometry commonGeometry)
        {
            switch (commonGeometry.OgcGeometryType)
            {
            case OgcGeometryType.Point: return(PointN.FromCommon((IPoint)commonGeometry));

            case OgcGeometryType.MultiPoint: return(MultipointN.FromCommon((IMultiPoint)commonGeometry));

            case OgcGeometryType.LineString: return(PolylineN.FromCommon((ILineString)commonGeometry));

            case OgcGeometryType.MultiLineString: return(PolylineN.FromCommon((IMultiLineString)commonGeometry));

            case OgcGeometryType.Polygon: return(PolygonN.FromCommon((IPolygon)commonGeometry));

            case OgcGeometryType.MultiPolygon: return(PolygonN.FromCommon((IMultiPolygon)commonGeometry));

            default:
                throw new NotSupportedException("Conversion from an IGeometryCollection to an AppGeo.Ags.Geometry is not supported.");
            }
        }