Class TLcdOGCModelReferenceFormatter

java.lang.Object
com.luciad.reference.format.TLcdOGCModelReferenceFormatter
All Implemented Interfaces:
ILcdModelReferenceFormatter, ILcdXYWorldReferenceFormatter

public class TLcdOGCModelReferenceFormatter extends Object implements ILcdModelReferenceFormatter, ILcdXYWorldReferenceFormatter
Formatter for references used in OGC standards such as GML, WMS, AIXM 5, and so on.

Supported model references

  • EPSG references, e.g. urn:ogc:def:crs:EPSG::3857 or EPSG:3857
  • Specific OGC references, e.g. urn:ogc:def:crs:OGC:1.3:CRS84
  • Any WKT reference, formatted as urn:ogc:def:crs:WKT::<URL-encoded WKT string>
The formatter tries to maintain but does not guarantee round-trips wrt TLcdOGCModelReferenceParser.
Since:
2016.1
  • Constructor Details

    • TLcdOGCModelReferenceFormatter

      public TLcdOGCModelReferenceFormatter()
  • Method Details

    • formatModelReference

      public String formatModelReference(ILcdModelReference aModelReference)
      Description copied from interface: ILcdModelReferenceFormatter
      Returns the string representation for the specified ILcdModelReference.
      Specified by:
      formatModelReference in interface ILcdModelReferenceFormatter
      Parameters:
      aModelReference - the model reference for which to return a string representation.
      Returns:
      a string representation of the specified model reference.
    • formatXYWorldReference

      public String formatXYWorldReference(ILcdXYWorldReference aXYWorldReference) throws IllegalArgumentException
      Description copied from interface: ILcdXYWorldReferenceFormatter
      Returns the String representation of a ILcdXYWorldReference.
      Specified by:
      formatXYWorldReference in interface ILcdXYWorldReferenceFormatter
      Parameters:
      aXYWorldReference - the ILcdXYWorldReference to be encoded as a String.
      Returns:
      the String representation of a ILcdXYWorldReference.
      Throws:
      IllegalArgumentException - If the given world reference cannot be formatted as a String.
    • setFormatEPSGLonLatWGS84AsEPSG4326

      public void setFormatEPSGLonLatWGS84AsEPSG4326(boolean aFormatEPSGLonLatWGS84AsEPSG4326)

      If true, formats geodetic WGS84 lon-lat references with EPSG as authority as "EPSG:4326" instead of the more unambiguous urn:ogc:def:crs:OGC:1.3:CRS84. In most cases, this flag should be kept in sync with TLcdOGCModelReferenceParser.setParseUnprefixedEPSG4326AsLonLat(boolean). This makes sure that round-trips behave as expected. I.e. when "EPSG:4326" is parsed as a lon-lat reference, the resulting reference should be formatted as "EPSG:4326" again.

      Keeping this flag false makes sure that geodetic WGS84 lon-lat references with EPSG as authority are formatted as "urn:ogc:def:crs:OGC:1.3:CRS84", which is always correctly interpreted as a lon-lat reference, regardless of the TLcdOGCModelReferenceParser.setParseUnprefixedEPSG4326AsLonLat(boolean) flag.

      The default and recommended value is false.

      Parameters:
      aFormatEPSGLonLatWGS84AsEPSG4326 - true to format geodetic WGS84 lon-lat references with EPSG as authority as "EPSG:4326".