Пример #1
0
        /// <summary>
        /// Reads a list of coordinates from the BinaryReader.
        /// </summary>
        /// <param name="reader">The reader to read from.</param>
        /// <param name="is3D">Bool value indicating whether coordinates has Z value.</param>
        /// <param name="isMeasured">Bool value indicating whether coordinates has M value.</param>
        /// <returns>Parsed Coordinate.</returns>
        private static IEnumerable <Coordinate> ReadCoordinates(BinaryReader reader, bool is3D, bool isMeasured)
        {
            int pointCount = (int)reader.ReadUInt32();

            List <Coordinate> result = new List <Coordinate>(pointCount);

            for (int i = 0; i < pointCount; i++)
            {
                result.Add(WkbReader.ReadCoordinate(reader, is3D, isMeasured));
            }

            return(result);
        }
Пример #2
0
        /// <summary>
        /// Reads Point from the reader.
        /// </summary>
        /// <param name="reader">The reader used to read data from input stream.</param>
        /// <param name="is3D">bool value indicating whether point beeing read has Z-dimension.</param>
        /// <param name="isMeasured">bool value indicating whether point beeing read has M-value.</param>
        /// <returns>Point read from the input</returns>
        private static Point ReadPoint(BinaryReader reader, bool is3D, bool isMeasured)
        {
            Coordinate position = WkbReader.ReadCoordinate(reader, is3D, isMeasured);

            return(new Point(position));
        }