Ejemplo n.º 1
0
        /// <summary>
        /// Parses a multipolyugon tagged text.
        /// </summary>
        /// <param name="tokens">The list of tokens.</param>
        /// <returns>A multipolygon specified by tokens.</returns>
        /// <remarks><![CDATA[<multipolygon tagged text> ::=  multipolygon {z}{m} <multipolygon text>]]></remarks>
        private static MultiPolygon ParseMultiPolygonTaggedText(WktTokensBuffer tokens)
        {
            WktReader.Expect("multipolygon", tokens);
            WktReader.Expect(TokenType.WHITESPACE, tokens);

            bool is3D       = false;
            bool isMeasured = false;

            WktToken t = tokens.Peek(true);

            if (WktReader.TryParseDimensions(t, out is3D, out isMeasured))
            {
                tokens.GetToken(true);
                WktReader.Expect(TokenType.WHITESPACE, tokens);
            }

            return(WktReader.ParseMultiPolygonText(tokens, is3D, isMeasured));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Parses a multipolyugon tagged text.
        /// </summary>
        /// <param name="tokens">The list of tokens.</param>
        /// <returns>A GeometryCollection specified by tokens.</returns>
        /// <remarks><![CDATA[<GeometryCollection tagged text> ::=  GeometryCollection {z}{m} <GeometryCollection text>]]></remarks>
        private static GeometryCollection <Geometry> ParseGeometryCollectionTaggedText(WktTokensBuffer tokens)
        {
            WktReader.Expect("geometrycollection", tokens);
            WktReader.Expect(TokenType.WHITESPACE, tokens);

            bool is3D       = false;
            bool isMeasured = false;

            WktToken t = tokens.Peek(true);

            if (WktReader.TryParseDimensions(t, out is3D, out isMeasured))
            {
                tokens.GetToken(true);
                WktReader.Expect(TokenType.WHITESPACE, tokens);
            }

            return(WktReader.ParseGeometryCollectionText(tokens, is3D, isMeasured));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Parses a linestring tagged text.
        /// </summary>
        /// <param name="tokens">The list of tokens.</param>
        /// <returns>A linestring specified by tokens.</returns>
        /// <remarks><![CDATA[<linestring tagged text> ::=  linestring {z}{m} <linestring text>]]></remarks>
        private static LineString ParseLineStringTaggedText(WktTokensBuffer tokens)
        {
            WktReader.Expect("linestring", tokens);
            WktReader.Expect(TokenType.WHITESPACE, tokens);

            bool is3D       = false;
            bool isMeasured = false;

            WktToken t = tokens.Peek(true);

            if (WktReader.TryParseDimensions(t, out is3D, out isMeasured))
            {
                tokens.GetToken(true);
                WktReader.Expect(TokenType.WHITESPACE, tokens);
            }

            return(WktReader.ParseLineStringText(tokens, is3D, isMeasured));
        }