Exemple #1
0
        /// <summary>
        /// Converts a Well-known Text representation to a Geometry.
        /// </summary>
        /// <param name="wellKnownText">
        /// one or more "Geometry Tagged Text" strings (see the OpenGIS
        /// Simple Features Specification) separated by whitespace
        /// </param>
        /// <returns> a Geometry specified by wellKnownText
        /// </returns>
        /// <exception cref="GeometryIOException">
        /// If a parsing problem occurs.
        /// </exception>
        public override Geometry Read(string wellKnownText)
        {
            if (m_objTokenizer == null)
            {
                m_objTokenizer = new StreamTokenizer(wellKnownText);
            }
            else
            {
                m_objTokenizer.Initialize(wellKnownText);
            }

            try
            {
                return(ReadGeometry(m_objTokenizer));
            }
            catch (BaseException ex)
            {
                ExceptionManager.Publish(ex);

                throw new GeometryIOException(ex.ToString(), ex);
            }
            catch (Exception ex)
            {
                ExceptionManager.Publish(ex);

                throw new GeometryIOException(ex.ToString(), ex);
            }
        }