Beispiel #1
0
        /// <summary>
        /// Bypasses <see cref="NtsSpatialContext.MakeLineString(IList{Shapes.IPoint})"/> so that we can more
        /// efficiently get the <see cref="LineString"/> without creating a <see cref="List{T}">List{Shapes.IPoint}</see>.
        /// </summary>
        protected override IShape ParseLineStringShape(WktShapeParser.State state)
        {
            if (!m_ctx.UseNtsLineString)
            {
                return(base.ParseLineStringShape(state));
            }

            if (state.NextIfEmptyAndSkipZM())
            {
                return(m_ctx.MakeLineString(new List <Shapes.IPoint>()));
            }

            GeometryFactory geometryFactory = m_ctx.GeometryFactory;

            Coordinate[] coordinates = CoordinateSequence(state);
            return(MakeShapeFromGeometry(geometryFactory.CreateLineString(coordinates)));
        }