Class GeoJSONWriter

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getFormatName()  
      java.lang.String toString​(Shape shape)
      Write a shape to String
      protected void write​(java.io.Writer output, java.text.NumberFormat nf, double... coords)  
      void write​(java.io.Writer output, Shape shape)
      Write a shape to the output writer
      (package private) void writeDistance​(java.io.Writer output, java.text.NumberFormat nf, double dist, boolean isGeo, java.lang.String distProperty, java.lang.String distUnitsProperty)
      Helper method to encode a distance property (with optional unit).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getFormatName

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

        protected void write​(java.io.Writer output,
                             java.text.NumberFormat nf,
                             double... coords)
                      throws java.io.IOException
        Throws:
        java.io.IOException
      • write

        public void write​(java.io.Writer output,
                          Shape shape)
                   throws java.io.IOException
        Description copied from interface: ShapeWriter
        Write a shape to the output writer
        Specified by:
        write in interface ShapeWriter
        Throws:
        java.io.IOException
      • writeDistance

        void writeDistance​(java.io.Writer output,
                           java.text.NumberFormat nf,
                           double dist,
                           boolean isGeo,
                           java.lang.String distProperty,
                           java.lang.String distUnitsProperty)
                    throws java.io.IOException
        Helper method to encode a distance property (with optional unit).

        The distance unit is only encoded when isGeo is true, and it is converted to km.

        The distance unit is encoded within a properties object.

        Parameters:
        output - The writer.
        nf - The number format.
        dist - The distance value to encode.
        isGeo - The flag determining
        distProperty - The distance property name.
        distUnitsProperty - The distance unit property name.
        Throws:
        java.io.IOException
      • toString

        public java.lang.String toString​(Shape shape)
        Description copied from interface: ShapeWriter
        Write a shape to String
        Specified by:
        toString in interface ShapeWriter