Class LegacyShapeReader

  • All Implemented Interfaces:
    ShapeIO, ShapeReader

    @Deprecated
    public class LegacyShapeReader
    extends java.lang.Object
    implements ShapeReader
    Deprecated.
    Reads a shape from the old format.
    • Point: X Y
      1.23 4.56
    • Rect: XMin YMin XMax YMax
      1.23 4.56 7.87 4.56
    • {CIRCLE} '(' {POINT} {DISTANCE} ')'
      CIRCLE is "CIRCLE" or "Circle" (no other case), and POINT is "X Y" order pair of doubles, or "Y,X" (lat,lon) pair of doubles, and DISTANCE is "d=RADIUS" or "distance=RADIUS" where RADIUS is a double that is the distance radius in degrees.
    • Method Detail

      • readShapeOrNull

        public static Shape readShapeOrNull​(java.lang.String str,
                                            SpatialContext ctx)
                                     throws InvalidShapeException
        Deprecated.
        Reads the shape specification as defined in the class javadocs. If the first character is a letter but it doesn't complete out "Circle" or "CIRCLE" then this method returns null, offering the caller the opportunity to potentially try additional parsing. If the first character is not a letter then it's assumed to be a point or rectangle. If that doesn't work out then an InvalidShapeException is thrown.
        Throws:
        InvalidShapeException
      • getFormatName

        public java.lang.String getFormatName()
        Deprecated.
        Specified by:
        getFormatName in interface ShapeIO
        Returns:
        the format name
      • read

        public Shape read​(java.lang.Object value)
                   throws java.io.IOException,
                          java.text.ParseException,
                          InvalidShapeException
        Deprecated.
        Specified by:
        read in interface ShapeReader
        Parameters:
        value - -- the input value, could be a String or other object
        Returns:
        a shape valid shape (not null)
        Throws:
        java.io.IOException
        java.text.ParseException
        InvalidShapeException
      • read

        public Shape read​(java.io.Reader reader)
                   throws java.io.IOException,
                          java.text.ParseException,
                          InvalidShapeException
        Deprecated.
        Description copied from interface: ShapeReader
        Read a Shape from the reader.
        Specified by:
        read in interface ShapeReader
        Parameters:
        reader - -- the input. Note, it will not be closed by this function
        Returns:
        a valid Shape (never null)
        Throws:
        java.io.IOException
        java.text.ParseException
        InvalidShapeException