Class LegacyShapeWriter

  • All Implemented Interfaces:
    ShapeIO, ShapeWriter

    @Deprecated
    public class LegacyShapeWriter
    extends Object
    implements ShapeWriter
    Deprecated.
    Writes a shape in 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

      • writeShape

        public static String writeShape​(Shape shape)
        Deprecated.
        Writes a shape to a String, in a format that can be read by #readShapeOrNull(String, com.spatial4j.core.context.SpatialContext).
        Parameters:
        shape - Not null.
        Returns:
        Not null.
      • writeShape

        public static String writeShape​(Shape shape,
                                        NumberFormat nf)
        Deprecated.
        Overloaded to provide a number format.
      • makeNumberFormat

        public static NumberFormat makeNumberFormat​(int fractionDigits)
        Deprecated.
        A convenience method to create a suitable NumberFormat for writing numbers.
      • getFormatName

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