public class IlvWKTCoordinateSystemDictionary extends Object
IlvWKTCoordinateSystemDictionary provides utility methods to
read, sort, change, and save a set of national coordinate systems.
| Name | Description |
| Category definition lines | Free text prefixed by the CATID string.
Example: --- US State Plane Systems |
| Coordinate System definition lines | Follows the Well-Known-Text format (WTK).
Example: GEOGCS["wgs", DATUM["WGS 84", SPHEROID["WGS84",
6378137.0, 298.257223563]], PRIMEM["Greenwich", 0.0]] |
| EPSG Numbers | Stored in the name of the coordinate system and separated by the
EPSGTAG string.
Example: PROJCS["NAD27 / MTM zone 8|32088"
This indicates that this coordinate system has the EPSG number 32088. |
| Modifier and Type | Class and Description |
|---|---|
static class |
IlvWKTCoordinateSystemDictionary.CoordinateSystemNode
CoordinateSystemNode is a node class that stores a coordinate
system. |
| Modifier and Type | Field and Description |
|---|---|
static int |
CATEGORY
Used to set the coordinate systems to be be arranged by category.
|
static String |
CATID
Used to indicate category lines in the input stream.
|
static int |
EPSG
Used to set the coordinate systems to be arranged by EPSG number.
|
static String |
EPSGTAG
Used to separate human readable name from EPSG Numbers.
|
static int |
NAME
Used to set the coordinate systems to be arranged by name.
|
static int |
NOEPSG
Used to indicate a CoordinateSystemNode with no EPSG id.
|
| Constructor and Description |
|---|
IlvWKTCoordinateSystemDictionary()
Creates a coordinate system dictionary using the default Perforce JViews
coordinate system resource file found in
ilog.views.maps.srs.wkt.wktdictionary.txt. |
IlvWKTCoordinateSystemDictionary(InputStream stream)
Reads the initial coordinate systems and categories from an input stream
to create a coordinate system dictionary.
|
| Modifier and Type | Method and Description |
|---|---|
IlvCoordinateSystem |
getCoordinateSystem(int epsgNumber)
Retrieves a coordinate system from the dictionary using an EPSG id.
|
IlvCoordinateSystem |
getCoordinateSystem(String csName)
Retrieves a coordinate system from the dictionary.
|
DefaultTreeModel |
makeTreeModel(int treeModelPolicy)
Creates a tree model sorted according to the display policy.
|
IlvWKTCoordinateSystemDictionary.CoordinateSystemNode |
registerCoordinateSystem(String category,
IlvCoordinateSystem cs)
Registers a new coordinate system.
|
int |
unregisterCategories(String catNameRegex,
boolean match)
Removes all coordinate system categories matching a regular expression
from the dictionary.
|
boolean |
unregisterCategory(String catName)
Removes a coordinate system category from the dictionary using the
category name.
|
boolean |
unregisterCoordinateSystem(String csName)
Removes a coordinate system from the dictionary.
|
void |
write(PrintWriter out)
Writes the formatted categories and coordinate system to a formatted
output stream.
|
public static final String CATID
public static final String EPSGTAG
public static final int NOEPSG
public static final int CATEGORY
makeTreeModel(int),
Constant Field Valuespublic static final int EPSG
makeTreeModel(int),
Constant Field Valuespublic static final int NAME
makeTreeModel(int),
Constant Field Valuespublic IlvWKTCoordinateSystemDictionary()
ilog.views.maps.srs.wkt.wktdictionary.txt.public IlvWKTCoordinateSystemDictionary(InputStream stream)
Note: the data format is described in the class header.
stream - The stream to read from. Set to null to create an
empty dictionary.public void write(PrintWriter out)
out - An ASCII writer for the dictionary data.public DefaultTreeModel makeTreeModel(int treeModelPolicy)
The tree model created returned by this method contains a hierarchy of
DefaultMutableTreeNode objects.
Some of the nodes returned contain a IlvWKTCoordinateSystemDictionary.CoordinateSystemNode
object containing information about the coordinate system.
treeModelPolicy - Set to one of the following:
IllegalArgumentException - if the treeModelPolicy
parameter does not contain one of the allowed values.IlvWKTCoordinateSystemDictionary.CoordinateSystemNodepublic IlvWKTCoordinateSystemDictionary.CoordinateSystemNode registerCoordinateSystem(String category, IlvCoordinateSystem cs)
category - The existing category name or the category to be created.cs - The coordinate system to register.public boolean unregisterCoordinateSystem(String csName)
csName - The name of the coordinate system to be removed.csName is in the dictionary,
true is returned.public IlvCoordinateSystem getCoordinateSystem(String csName)
csName - The name of the coordinate system to retrieve.null is returned.public IlvCoordinateSystem getCoordinateSystem(int epsgNumber)
epsgNumber - The EPSG id of the coordinate system to retrieve.epsgNumber. If
the coordinate system does not exist in the dictionary, null
is returned.public boolean unregisterCategory(String catName)
catName - The name of the category to remove.catName was in the dictionary,
true is returned.public int unregisterCategories(String catNameRegex, boolean match)
| Expression | Description |
unregisterCategories("US State.*",false) |
Remove all categories except those beginning with "US State Plane". |
unregisterCategories(".*Polyconic.*",true) |
Remove categories containing "Polyconic". |
catNameRegex - A regular expression for the category name.match - Set to true to remove matching categories. Set to
false to remove non-matching categories.String.matches(java.lang.String)© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.