Пример #1
0
        private Coordinate[] GetCoordinates(WktStreamTokenizer tokenizer)
        {
            ArrayList coords = new ArrayList();

            string nextToken = this.GetNextEmptyOrOpener(tokenizer);

            if (nextToken == "EMPTY")
            {
                return(new Coordinate[] {});
            }

            do
            {
                Coordinate coord = new Coordinate(this.GetNextNumber(tokenizer), this.GetNextNumber(tokenizer));
                _precisionModel.makePrecise(coord);
                coords.Add(coord);
            }while (this.GetNextCloserOrComma(tokenizer) == ",");

            return((Coordinate[])coords.ToArray(typeof(Coordinate)));
        }
Пример #2
0
        /// <summary>
        /// Converts a Coordinate to &lt;Point&gt; format, then Appends
        /// it to the writer. 
        /// </summary>
        /// <param name="coordinate">The Coordinate to process.</param>
        /// <param name="writer">The output writer to Append to.</param>
        /// <param name="precisionModel">The PrecisionModel to use to convert
        /// from a precise coordinate to an external coordinate</param>
        protected void AppendCoordinate(Coordinate coordinate, StringWriter writer, PrecisionModel precisionModel)
        {
            precisionModel.makePrecise(coordinate);

            writer.Write("{0} {1}", WriteNumber(coordinate.x), WriteNumber(coordinate.y));
        }
Пример #3
0
        /// <summary>
        /// Converts a Coordinate to &lt;Point&gt; format, then Appends
        /// it to the writer.
        /// </summary>
        /// <param name="coordinate">The Coordinate to process.</param>
        /// <param name="writer">The output writer to Append to.</param>
        /// <param name="precisionModel">The PrecisionModel to use to convert
        /// from a precise coordinate to an external coordinate</param>
        protected void AppendCoordinate(Coordinate coordinate, StringWriter writer, PrecisionModel precisionModel)
        {
            precisionModel.makePrecise(coordinate);

            writer.Write("{0} {1}", WriteNumber(coordinate.x), WriteNumber(coordinate.y));
        }