public class TLcdOGCModelReferenceFormatter extends Object implements ILcdModelReferenceFormatter, ILcdXYWorldReferenceFormatter
urn:ogc:def:crs:EPSG::3857
or EPSG:3857
urn:ogc:def:crs:OGC:1.3:CRS84
urn:ogc:def:crs:WKT::<URL-encoded WKT string>
Constructor and Description |
---|
TLcdOGCModelReferenceFormatter() |
Modifier and Type | Method and Description |
---|---|
String |
formatModelReference(ILcdModelReference aModelReference)
Returns the string representation for the specified
ILcdModelReference . |
String |
formatXYWorldReference(ILcdXYWorldReference aXYWorldReference)
Returns the String representation of a
ILcdXYWorldReference . |
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 . |
public String formatModelReference(ILcdModelReference aModelReference)
ILcdModelReferenceFormatter
ILcdModelReference
.formatModelReference
in interface ILcdModelReferenceFormatter
aModelReference
- the model reference for which to return a string representation.public String formatXYWorldReference(ILcdXYWorldReference aXYWorldReference) throws IllegalArgumentException
ILcdXYWorldReferenceFormatter
ILcdXYWorldReference
.formatXYWorldReference
in interface ILcdXYWorldReferenceFormatter
aXYWorldReference
- the ILcdXYWorldReference
to be encoded as a String.ILcdXYWorldReference
.IllegalArgumentException
- If the given world reference cannot be formatted as a String.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
.
aFormatEPSGLonLatWGS84AsEPSG4326
- true
to format geodetic WGS84 lon-lat references with EPSG as authority as "EPSG:4326"
.