public class CRSFactory extends Object
CoordinateReferenceSystem
s
from a variety of ways
of specifying them.
This is the primary way of creating coordinate systems
for carrying out projections transformations.
CoordinateReferenceSystems can be used to
define CoordinateTransform
s to perform transformations
on ProjCoordinate
s.
Constructor and Description |
---|
CRSFactory() |
Modifier and Type | Method and Description |
---|---|
CoordinateReferenceSystem |
createFromName(String name)
Creates a
CoordinateReferenceSystem (CRS) from a well-known name. |
CoordinateReferenceSystem |
createFromParameters(String name,
String paramStr)
Creates a
CoordinateReferenceSystem
from a PROJ.4 projection parameter string. |
CoordinateReferenceSystem |
createFromParameters(String name,
String[] params)
Creates a
CoordinateReferenceSystem
defined by an array of PROJ.4 projection parameters. |
Registry |
getRegistry()
Gets the
Registry used by this factory. |
String |
readEpsgFromParameters(String paramStr)
Finds a EPSG Code
from a PROJ.4 projection parameter string.
|
String |
readEpsgFromParameters(String[] params)
Finds a EPSG Code
defined by an array of PROJ.4 projection parameters.
|
public Registry getRegistry()
Registry
used by this factory.public CoordinateReferenceSystem createFromName(String name) throws UnsupportedParameterException, InvalidValueException, UnknownAuthorityCodeException
CoordinateReferenceSystem
(CRS) from a well-known name.
CRS names are of the form: "authority:code",
with the components being:
name
- the name of a coordinate system, with optional authority prefixCoordinateReferenceSystem
corresponding to the given nameUnsupportedParameterException
- if a PROJ.4 parameter is not supportedInvalidValueException
- if a parameter value is invalidUnknownAuthorityCodeException
- if the authority code cannot be foundpublic CoordinateReferenceSystem createFromParameters(String name, String paramStr) throws UnsupportedParameterException, InvalidValueException
CoordinateReferenceSystem
from a PROJ.4 projection parameter string.
An example of a valid PROJ.4 projection parameter string is:
+proj=aea +lat_1=50 +lat_2=58.5 +lat_0=45 +lon_0=-126 +x_0=1000000 +y_0=0 +ellps=GRS80 +units=m
name
- a name for this coordinate system (may be null for an anonymous coordinate system)paramStr
- a PROJ.4 projection parameter stringCoordinateReferenceSystem
UnsupportedParameterException
- if a given PROJ.4 parameter is not supportedInvalidValueException
- if a supplied parameter value is invalidpublic CoordinateReferenceSystem createFromParameters(String name, String[] params) throws UnsupportedParameterException, InvalidValueException
CoordinateReferenceSystem
defined by an array of PROJ.4 projection parameters.
PROJ.4 parameters are generally of the form
"+name=value".name
- a name for this coordinate system (may be null)params
- an array of PROJ.4 projection parametersCoordinateReferenceSystem
UnsupportedParameterException
- if a PROJ.4 parameter is not supportedInvalidValueException
- if a parameter value is invalidpublic String readEpsgFromParameters(String paramStr) throws IOException
An example of a valid PROJ.4 projection parameter string is:
+proj=aea +lat_1=50 +lat_2=58.5 +lat_0=45 +lon_0=-126 +x_0=1000000 +y_0=0 +ellps=GRS80 +units=m
paramStr
- a PROJ.4 projection parameter stringCoordinateReferenceSystem
IOException
- if there was an issue in reading EPSG filepublic String readEpsgFromParameters(String[] params) throws IOException
params
- an array of PROJ.4 projection parametersIOException
- if there was an issue in reading EPSG fileCopyright © 2021. All rights reserved.