Beispiel #1
0
        public IPnt ReadPoint(Stream stream)
        {
            using (BinaryReader reader = InitializeReader(stream))
            {
                ReadWkbType(reader, true,
                            out WkbGeometryType geometryType, out Ordinates ordinates);

                if (geometryType != WkbGeometryType.Point)
                {
                    throw new NotSupportedException(
                              $"Cannot read {geometryType} as point.");
                }

                IPointFactory <IPnt> builder = new PntFactory();

                return(ReadPointCore(reader, ordinates, builder));
            }
        }
Beispiel #2
0
        public IEnumerable <IPnt> ReadMultiPoint(Stream stream)
        {
            using (BinaryReader reader = InitializeReader(stream))
            {
                ReadWkbType(reader, true,
                            out WkbGeometryType geometryType, out Ordinates ordinates);

                if (geometryType != WkbGeometryType.MultiPoint)
                {
                    throw new NotSupportedException(
                              $"Cannot read {geometryType} as point.");
                }

                uint pointCount = reader.ReadUInt32();

                IPointFactory <IPnt> builder = new PntFactory();

                for (int i = 0; i < pointCount; i++)
                {
                    yield return(ReadPointCore(reader, ordinates, builder));
                }
            }
        }