Esempio n. 1
0
        private void WriteMultiSurface(MultiSurface multiSurface)
        {
            wkbWriter.Write(multiSurface.Geometries.Count);

            foreach (Geometry geometry in multiSurface.Geometries)
            {
                WriteInternal(geometry);
            }
        }
Esempio n. 2
0
        private MultiSurface ReadMultiSurface(Dimension dimension)
        {
            MultiSurface multiSurface = new MultiSurface();

            uint geometryCount = wkbReader.ReadUInt32();

            for (int i = 0; i < geometryCount; i++)
            {
                multiSurface.Geometries.Add(Read <Surface>());
            }

            return(multiSurface);
        }
Esempio n. 3
0
        private void WriteMultiSurface(MultiSurface multiSurface)
        {
            wktBuilder.Append("(");

            foreach (Geometry geometry in multiSurface.Geometries)
            {
                Write(geometry, geometry.GeometryType == GeometryType.Polygon);
                wktBuilder.Append(",");
            }

            wktBuilder.Remove(wktBuilder.Length - 1, 1);
            wktBuilder.Append(")");
        }
Esempio n. 4
0
        protected MultiSurface ReadMultiSurface(Dimension dimension)
        {
            ExpectGroupStart();
            MultiSurface multiSurface = new MultiSurface();

            multiSurface.Dimension = dimension;

            do
            {
                multiSurface.Geometries.Add((Surface)ReadType(GeometryType.Polygon, dimension, GeometryType.Polygon, GeometryType.CurvePolygon));
            } while (IsMatch(","));

            ExpectGroupEnd();

            return(multiSurface);
        }
Esempio n. 5
0
        protected Geometry CreateGeometry(GeometryType geometryType, Dimension dimension)
        {
            Geometry geometry = null;

            switch (geometryType)
            {
            case GeometryType.Point: geometry = new Point(); break;

            case GeometryType.LineString: geometry = new LineString(); break;

            case GeometryType.Polygon: geometry = new Polygon(); break;

            case GeometryType.MultiPoint: geometry = new MultiPoint(); break;

            case GeometryType.MultiLineString: geometry = new MultiLineString(); break;

            case GeometryType.MultiPolygon: geometry = new MultiPolygon(); break;

            case GeometryType.GeometryCollection: geometry = new GeometryCollection(); break;

            case GeometryType.CircularString: geometry = new CircularString(); break;

            case GeometryType.CompoundCurve: geometry = new CompoundCurve(); break;

            case GeometryType.CurvePolygon: geometry = new CurvePolygon(); break;

            case GeometryType.MultiCurve: geometry = new MultiCurve(); break;

            case GeometryType.MultiSurface: geometry = new MultiSurface(); break;

            case GeometryType.PolyhedralSurface: geometry = new PolyhedralSurface(); break;

            case GeometryType.Tin: geometry = new Tin(); break;

            case GeometryType.Triangle: geometry = new Triangle(); break;

            default: throw new NotSupportedException(geometryType.ToString());
            }

            geometry.Dimension = dimension;

            return(geometry);
        }
Esempio n. 6
0
 public bool Equals(MultiSurface <T> other)
 {
     return(Geometries.SequenceEqual(other.Geometries));
 }