public class Parser extends MathTransformParser
FITTED_CS
element.Format.Field
Modifier and Type | Field and Description |
---|---|
protected CRSFactory |
crsFactory
The factory to use for creating coordinate reference
systems.
|
protected CSFactory |
csFactory
The factory to use for creating coordinate systems.
|
protected DatumFactory |
datumFactory
The factory to use for creating datum.
|
mtFactory
Constructor and Description |
---|
Parser()
Constructs a parser using the default set of symbols and factories.
|
Parser(Symbols symbols)
Constructs a parser for the specified set of symbols using default factories.
|
Parser(Symbols symbols,
DatumFactory datumFactory,
CSFactory csFactory,
CRSFactory crsFactory,
MathTransformFactory mtFactory)
Constructs a parser for the specified set of symbols using the specified factories.
|
Parser(Symbols symbols,
ReferencingFactoryContainer factories)
Constructs a parser for the specified set of symbols using the specified set of factories.
|
Modifier and Type | Method and Description |
---|---|
protected Map<String,Object> |
alterProperties(Map<String,Object> properties)
Returns the properties to be given to the parsed object.
|
static Class<?> |
getClassOf(String element)
Returns the class of the specified WKT element.
|
static String |
getNameOf(Class<?> type)
Returns the WKT name of the specified object type.
|
static void |
main(String[] args)
Read WKT strings from the standard input stream and reformat them to
the standard output stream.
|
protected Object |
parse(Element element)
Parses the next element in the specified Well Know Text (WKT) tree.
|
CoordinateReferenceSystem |
parseCoordinateReferenceSystem(String text)
Parses a coordinate reference system element.
|
parseMathTransform
format, getAuthority, getTree, getWarning, isColorEnabled, parseObject, parseObject, reformat, setAuthority, setColorEnabled
clone, format, formatToCharacterIterator
protected final DatumFactory datumFactory
protected final CSFactory csFactory
protected final CRSFactory crsFactory
public Parser()
public Parser(Symbols symbols)
symbols
- The symbols for parsing and formatting numbers.public Parser(Symbols symbols, ReferencingFactoryContainer factories)
symbols
- The symbols for parsing and formatting numbers.factories
- The factories to use.public Parser(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.public CoordinateReferenceSystem parseCoordinateReferenceSystem(String text) throws ParseException
text
- The text to be parsed.ParseException
- if the string can't be parsed.protected Object parse(Element element) throws ParseException
parse
in class MathTransformParser
element
- The element to be parsed.ParseException
- if the element 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.public static Class<?> getClassOf(String element)
ProjectedCRS.class
for element "PROJCS
".element
- The WKT element name.null
if unknow.public static String getNameOf(Class<?> type)
PROJCS
" for type ProjectedCRS.class
.type
- The GeoAPI class of the specified element.null
if unknow.public static void main(String[] args)
[Ctrl-Z]
if reading from the keyboard), or until an unparsable WKT has
been hit. Optional arguments are:
-authority <name> |
The authority to prefer when choosing WKT entities names. |
-indentation <value> |
Set the indentation (0 for output on a single line) |
-encoding <code> |
Set the character encoding |
-locale <language> |
Set the language for the output (e.g. "fr" for French) |
args
- The command line arguments.Copyright © 1996–2019 Geotools. All rights reserved.