Class CoordinateWriter


  • public class CoordinateWriter
    extends Object
    Handles the writing of coordinates for GML.
    Author:
    Chris Holmes, Ian Schneider
    • Constructor Detail

      • CoordinateWriter

        public CoordinateWriter()
      • CoordinateWriter

        public CoordinateWriter​(int numDecimals)
      • CoordinateWriter

        public CoordinateWriter​(int numDecimals,
                                boolean isDummyZEnabled)
      • CoordinateWriter

        public CoordinateWriter​(int numDecimals,
                                String tupleDelim,
                                String coordDelim)
      • CoordinateWriter

        public CoordinateWriter​(int numDecimals,
                                boolean padWithZeros,
                                boolean forceDecimalEncoding,
                                boolean isDummyZEnabled)
      • CoordinateWriter

        public CoordinateWriter​(int numDecimals,
                                String tupleDelim,
                                String coordDelim,
                                boolean useDummyZ)
      • CoordinateWriter

        public CoordinateWriter​(int numDecimals,
                                boolean padWithZeros,
                                boolean forceDecimalEncoding)
      • CoordinateWriter

        public CoordinateWriter​(int numDecimals,
                                String tupleDelim,
                                String coordDelim,
                                boolean useDummyZ,
                                double zValue)
      • CoordinateWriter

        public CoordinateWriter​(int numDecimals,
                                boolean useDummyZ,
                                int dimension)
      • CoordinateWriter

        public CoordinateWriter​(int numDecimals,
                                boolean padWithZeros,
                                boolean forceDecimalEncoding,
                                String tupleDelim,
                                String coordDelim)
      • CoordinateWriter

        public CoordinateWriter​(int numDecimals,
                                String tupleDelim,
                                String coordDelim,
                                boolean useZ,
                                double z,
                                int dimension)
      • CoordinateWriter

        public CoordinateWriter​(int numDecimals,
                                boolean padWithZeros,
                                boolean forceDecimalEncoding,
                                String tupleDelim,
                                String coordDelim,
                                boolean useDummyZ)
      • CoordinateWriter

        public CoordinateWriter​(int numDecimals,
                                boolean padWithZeros,
                                boolean forceDecimalEncoding,
                                String tupleDelim,
                                String coordDelim,
                                boolean useDummyZ,
                                double zValue)
      • CoordinateWriter

        public CoordinateWriter​(int numDecimals,
                                boolean padWithZeros,
                                boolean forceDecimalEncoding,
                                boolean useDummyZ,
                                int dimension)
      • CoordinateWriter

        public CoordinateWriter​(int numDecimals,
                                boolean padWithZeros,
                                boolean forceDecimalEncoding,
                                String tupleDelim,
                                String coordDelim,
                                boolean useZ,
                                double z,
                                int dimension)
        Create a CoordinateWriter for outputting GML coordinates.

        The use of dimension, z and useZ is based on your needs:

        • dimension: is from your CoordinateReferenceSystem; it is the number of axis used by the coordinate
        • useZ: is used to force the use of 3 dimensions (if needed the z value below will be used for 2D data)
        • z: the dummy z value to use if the coordinate does not have one
        Parameters:
        numDecimals - Number of decimals to use (a speed vs accuracy trade off)
        tupleDelim - delimiter to use between ordinates (usually ',')
        coordDelim - delimiter to use between coordinates (usually ' ')
        useZ - true if the provided zValue should be forced
        z - Dummy z value to use if needed
        dimension - Dimension of coordinates (usually 2 or 3)
    • Method Detail

      • getNumDecimals

        public int getNumDecimals()
      • getPadWithZeros

        public boolean getPadWithZeros()
      • getForceDecimalEncoding

        public boolean getForceDecimalEncoding()
      • isDummyZEnabled

        public boolean isDummyZEnabled()
      • setNamespaceAware

        public void setNamespaceAware​(boolean namespaceAware)
      • setPrefix

        public void setPrefix​(String prefix)
      • setNamespaceUri

        public void setNamespaceUri​(String namespaceUri)
      • writeCoordinates

        public void writeCoordinates​(CoordinateSequence c,
                                     ContentHandler output)
                              throws SAXException
        Write the provided list of coordinates out.

        There are a range of constants that control exactly what is written:

        • useDummyZ: if true dummyZ will be added to each coordiante
        • namespaceAware: is true the prefix and namespaceUri will be used
        Throws:
        SAXException