Class TLcdOGCModelReferenceFormatter
- All Implemented Interfaces:
ILcdModelReferenceFormatter
,ILcdXYWorldReferenceFormatter
Supported model references
- EPSG references, e.g.
urn:ogc:def:crs:EPSG::3857
orEPSG: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>
- Since:
- 2016.1
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionformatModelReference
(ILcdModelReference aModelReference) Returns the string representation for the specifiedILcdModelReference
.formatXYWorldReference
(ILcdXYWorldReference aXYWorldReference) Returns the String representation of aILcdXYWorldReference
.void
setFormatEPSGLonLatWGS84AsEPSG4326
(boolean aFormatEPSGLonLatWGS84AsEPSG4326) If true, formats geodetic WGS84 lon-lat references with EPSG as authority as"EPSG:4326"
instead of the more unambiguousurn:ogc:def:crs:OGC:1.3:CRS84
.
-
Constructor Details
-
TLcdOGCModelReferenceFormatter
public TLcdOGCModelReferenceFormatter()
-
-
Method Details
-
formatModelReference
Description copied from interface:ILcdModelReferenceFormatter
Returns the string representation for the specifiedILcdModelReference
.- Specified by:
formatModelReference
in interfaceILcdModelReferenceFormatter
- 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 aILcdXYWorldReference
.- Specified by:
formatXYWorldReference
in interfaceILcdXYWorldReferenceFormatter
- Parameters:
aXYWorldReference
- theILcdXYWorldReference
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 unambiguousurn:ogc:def:crs:OGC:1.3:CRS84
. In most cases, this flag should be kept in sync withTLcdOGCModelReferenceParser.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 theTLcdOGCModelReferenceParser.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"
.
-