예제 #1
0
        private void WriteTin(Tin tin)
        {
            wkbWriter.Write(tin.Geometries.Count);

            foreach (Geometry geometry in tin.Geometries)
            {
                WriteInternal(geometry);
            }
        }
예제 #2
0
        private void WriteTin(Tin tin)
        {
            wktBuilder.Append("(");

            foreach (Geometry geometry in tin.Geometries)
            {
                Write(geometry, true);
                wktBuilder.Append(",");
            }

            wktBuilder.Remove(wktBuilder.Length - 1, 1);
            wktBuilder.Append(")");
        }
예제 #3
0
        private Tin ReadTin(Dimension dimension)
        {
            Tin tin = new Tin();

            uint geometryCount = wkbReader.ReadUInt32();

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

            return(tin);
        }
예제 #4
0
        protected Tin ReadTin(Dimension dimension)
        {
            Tin tin = new Tin();

            tin.Dimension = dimension;

            ExpectGroupStart();

            do
            {
                tin.Geometries.Add(ReadTriangle(dimension));
            } while (IsMatch(","));

            ExpectGroupEnd();

            return(tin);
        }
예제 #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);
        }
예제 #6
0
 public bool Equals(Tin other)
 {
     return(Geometries.SequenceEqual(other.Geometries));
 }