Package com.luciad.reference.format
Class TLcdOGCModelReferenceParser
java.lang.Object
com.luciad.reference.format.TLcdOGCModelReferenceParser
- All Implemented Interfaces:
ILcdModelReferenceParser
,ILcdXYWorldReferenceParser
public class TLcdOGCModelReferenceParser
extends Object
implements ILcdModelReferenceParser, ILcdXYWorldReferenceParser
Parser for references used in OGC standards such as GML, WMS, AIXM 5, and so on.
Supported model references
- Most EPSG references, formatted as
urn:ogc:def:crs:EPSG::<code>
,http://www.opengis.net/gml/srs/epsg.xml#<code>
, orEPSG:<code>
. Refer toTLcdEPSGReferenceParser
for a list of the supported codes. - Any WKT reference, formatted as
urn:ogc:def:crs:WKT::<URL-encoded WKT string>
,WKT:<version>:<URL-encoded WKT string>
orWKT:<URL-encoded WKT string>
- Specific OGC references of the form
urn:ogc:def:crs:OGC:<version>:<name>
, with<name>
being one ofCRS84
,CRS83
, orCRS27
- Commonly used reference names:
WGS84
,LL-WGS84
andNAD83
EPSG 4326 axis order in older servers
Many older servers treat EPSG:4326 as a lon-lat reference, even though the EPSG specification dictates a lat-lon order. To interact with these servers, the interpretation of the strings"EPSG:4326"
and "http://www.opengis.net/gml/srs/epsg.xml#4326"
can be changed to lon-lat as follows:
TLcdOGCModelReferenceParser parser = new TLcdOGCModelReferenceParser();
parser.setParseUnprefixedEPSG4326AsLonLat(true);
parser.setParseGMLPrefixedEPSG4326AsLonLat(true);
Other notations of EPSG:4326 (e.g. "urn:ogc:def:crs:EPSG::4326"
) should not give any problems, because they
are only supported by more recent server implementations, which parse the axis order
as expected.- Since:
- 2016.1
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether or not the parser interprets the "http://www.opengis.net/gml/srs/epsg.xml#4326" string as being lon-lat instead of the more correct lat-lon.boolean
Returns whether or not the parser interprets the "EPSG:4326" string as being lon-lat instead of the more correct lat-lon.parseModelReference
(String aUrn) Returns theILcdModelReference
that corresponds to the specified string representation.parseXYWorldReference
(String aUrn) Returns theILcdXYWorldReference
that is formatted as a String.void
setParseGMLPrefixedEPSG4326AsLonLat
(boolean aParseGMLPrefixedEPSG4326AsLonLat) If true, parses the "http://www.opengis.net/gml/srs/epsg.xml#4326" string as a lon-lat reference instead of the more correct lat-lon.void
setParseUnprefixedEPSG4326AsLonLat
(boolean aParseUnprefixedEPSG4326AsLonLat) If true, parses the "EPSG:4326" string as a lon-lat reference instead of the more correct lat-lon.
-
Constructor Details
-
TLcdOGCModelReferenceParser
public TLcdOGCModelReferenceParser()
-
-
Method Details
-
parseModelReference
Description copied from interface:ILcdModelReferenceParser
Returns theILcdModelReference
that corresponds to the specified string representation.- Specified by:
parseModelReference
in interfaceILcdModelReferenceParser
- Parameters:
aUrn
- the String representation to be converted to anILcdModelReference
.- Returns:
- the
ILcdModelReference
that corresponds to the specified string, nevernull
. - Throws:
ParseException
- if this parser cannot convert the specified string into a model reference (e.g. if the code is not supported or if the code was not valid)
-
parseXYWorldReference
Description copied from interface:ILcdXYWorldReferenceParser
Returns theILcdXYWorldReference
that is formatted as a String.- Specified by:
parseXYWorldReference
in interfaceILcdXYWorldReferenceParser
- Parameters:
aUrn
- the String representation of theILcdXYWorldReference
.- Returns:
- the
ILcdXYWorldReference
that is formatted as a String. Nevernull
. - Throws:
ParseException
- If theILcdXYWorldReference
cannot be created from the String.
-
setParseUnprefixedEPSG4326AsLonLat
public void setParseUnprefixedEPSG4326AsLonLat(boolean aParseUnprefixedEPSG4326AsLonLat) If true, parses the "EPSG:4326" string as a lon-lat reference instead of the more correct lat-lon. Older WMS servers and GML versions may rely on this interpretation. The default and recommended value is false. The OGC prepended variant "urn:ogc:def:crs:EPSG::4326" will always be parsed as lat-lon, regardless of this setting.- Parameters:
aParseUnprefixedEPSG4326AsLonLat
- true to parse "EPSG:4326" as a lon-lat reference
-
isParseUnprefixedEPSG4326AsLonLat
public boolean isParseUnprefixedEPSG4326AsLonLat()Returns whether or not the parser interprets the "EPSG:4326" string as being lon-lat instead of the more correct lat-lon.- Returns:
- true if the parser interprets the "EPSG:4326" string as a lon-lat reference.
- See Also:
-
setParseGMLPrefixedEPSG4326AsLonLat
public void setParseGMLPrefixedEPSG4326AsLonLat(boolean aParseGMLPrefixedEPSG4326AsLonLat) If true, parses the "http://www.opengis.net/gml/srs/epsg.xml#4326" string as a lon-lat reference instead of the more correct lat-lon. Older WMS servers and GML versions may rely on this interpretation. The default and recommended value is false. The OGC prepended variant "urn:ogc:def:crs:EPSG::4326" will always be parsed as lat-lon, regardless of this setting.- Parameters:
aParseGMLPrefixedEPSG4326AsLonLat
- true to parse "http://www.opengis.net/gml/srs/epsg.xml#4326" as a lon-lat reference
-
isParseGMLPrefixedEPSG4326AsLonLat
public boolean isParseGMLPrefixedEPSG4326AsLonLat()Returns whether or not the parser interprets the "http://www.opengis.net/gml/srs/epsg.xml#4326" string as being lon-lat instead of the more correct lat-lon.- Returns:
- true if the parser interprets the "http://www.opengis.net/gml/srs/epsg.xml#4326" string as a lon-lat reference.
- See Also:
-