|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectParser
MathTransformParser
ReferencingParser
public class ReferencingParser
Well
Known Text (WKT) parser for referencing objects. This include, but is not limited too,
Coordinate Reference System objects. This parser can parse
Math Transform objects as well because they are part of the WKT's
"FITTED_CS" element.
Default axis names
The default axis names differ depending on whatever the parsing shall be strictly compliant to
the legacy WKT specification, or whatever ISO 19111 identifiers shall be used instead. The
following table compares the names:
| CRS type | WKT defaults | ISO abbreviations |
|---|---|---|
| Geographic | Lon, Lat | λ, φ |
| Vertical | H | h |
| Projected | X, Y | x, y |
| Geocentric | X, Y, Z | X, Y, Z |
setISOConform(boolean).
Note that Geotk referencing factories like
WKTParsingAuthorityFactory perform the
above-cited setISOConform(true) method call on their internal parser instance,
for ISO compliance.
| referencing/geotk-referencing (download) | View source code for this class |
| Constructor Summary | |
|---|---|
ReferencingParser()
Creates a parser using the default set of symbols and factories. |
|
ReferencingParser(Symbols symbols,
DatumFactory datumFactory,
CSFactory csFactory,
CRSFactory crsFactory,
MathTransformFactory mtFactory)
Constructs a parser for the specified set of symbols using the specified set of factories. |
|
ReferencingParser(Symbols symbols,
Hints hints)
Creates a parser using the specified set of symbols. |
|
ReferencingParser(Symbols symbols,
ReferencingFactoryContainer factories)
Constructs a parser for the specified set of symbols using the specified set of factories. |
|
| Method Summary | |
|---|---|
protected Map<String,Object> |
alterProperties(Map<String,Object> properties)
Returns the properties to be given to the parsed object. |
boolean |
isAxisIgnored()
Returns true if AXIS[...] elements will be ignored during parsing. |
boolean |
isISOConform()
Returns true if the default names of AXIS[...] elements shall be ISO 19111
identifiers. |
CoordinateReferenceSystem |
parseCoordinateReferenceSystem(String text)
Parses a coordinate reference system element. |
void |
setAxisIgnored(boolean ignored)
Sets whatever AXIS[...] elements will be ignored during parsing. |
void |
setISOConform(boolean conform)
Sets whatever the default names of AXIS[...] elements shall be ISO identifiers. |
| Methods inherited from class MathTransformParser |
|---|
parseMathTransform |
| Methods inherited from class Parser |
|---|
parseObject, parseObject |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReferencingParser()
public ReferencingParser(Symbols symbols,
Hints hints)
symbols - The symbols for parsing and formatting numbers.hints - The hints to be used for fetching the factories, or
null for the system-wide default hints.
public ReferencingParser(Symbols symbols,
ReferencingFactoryContainer factories)
symbols - The symbols for parsing and formatting numbers.factories - The factories to use.
public ReferencingParser(Symbols symbols,
DatumFactory datumFactory,
CSFactory csFactory,
CRSFactory crsFactory,
MathTransformFactory mtFactory)
symbols - The symbols for parsing and formatting numbers.datumFactory - The factory to use for creating datum.csFactory - The factory to use for creating coordinate systems.crsFactory - The factory to use for creating coordinate reference systems.mtFactory - The factory to use for creating math transform objects.| Method Detail |
|---|
public boolean isISOConform()
true if the default names of AXIS[...] elements shall be ISO 19111
identifiers. The default value is false, which mean that the identifiers specified
by the WKT specification are used.
true if the default identifiers of AXIS[...] elements shall be
conform to ISO 19111.public void setISOConform(boolean conform)
AXIS[...] elements shall be ISO identifiers.
conform - true if the default identifiers of AXIS[...] elements shall
be conform to ISO 19111.public boolean isAxisIgnored()
true if AXIS[...] elements will be ignored during parsing.
The default value is false.
true if AXIS[...] elements will be ignored during parsing.public void setAxisIgnored(boolean ignored)
AXIS[...] elements will be ignored during parsing. The default
value is false as we would expect from a WKT compliant parser. However this
flag may occasionally be set to true for compatibility with ESRI softwares,
which ignore AXIS elements. It may also be used as a way to force the longitude
axis to be first.
Note that AXIS elements still need to be well formed even when this flag is set
to true; invalid axis will continue to cause a ParseException despite
their content being ignored.
ignored - true if AXIS[...] elements should be ignored during parsing.
public final CoordinateReferenceSystem parseCoordinateReferenceSystem(String text)
throws ParseException
text - The text to be parsed.
ParseException - if the string can't be parsed.protected Map<String,Object> alterProperties(Map<String,Object> properties)
AUTHORITY element, and returns on output the
properties to give to the object to be created. The default implementation returns
the properties map unchanged. Subclasses may override this method in order
to add or change properties.
Example: if a subclass want to add automatically an authority code when no
AUTHORITY element was explicitly set in the WKT, then it may test for the
IdentifiedObject.IDENTIFIERS_KEY key and add automatically an entry if this
key was missing.
properties - The properties parsed from the WKT file. Entries can be added, removed
or modified directly in this map.
properties
(maybe after modifications), but could also be a new map.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||