public class CRSFactory extends Object
CoordinateReferenceSystems. It can do so :
Case 1 :
CoordinateReferenceSystem from a text
file will be delegated to one of RegistryManager's
registries. If RegistryManager don't know the
authority of the CRS, an exception is returned.Case 2 :
CoordinateReferenceSystem from a OGC
WKT String (PRJ) will be delegated to the
PrjParser.This class also manages a Cache which return
CoordinateReferenceSystems which have already been
parsed.
| Modifier and Type | Class and Description |
|---|---|
class |
CRSFactory.CRSCache<K,V>
A simple cache to manage
CoordinateReferenceSystem |
| Modifier and Type | Field and Description |
|---|---|
protected CRSFactory.CRSCache<String,CoordinateReferenceSystem> |
CRSPOOL |
| Constructor and Description |
|---|
CRSFactory()
Creates a new factory.
|
| Modifier and Type | Method and Description |
|---|---|
CoordinateReferenceSystem |
createFromPrj(File file)
Creates a
CoordinateReferenceSystem defined by an OGC WKT String
(PRJ). |
CoordinateReferenceSystem |
createFromPrj(InputStream stream)
Creates a
CoordinateReferenceSystem defined by an OGC WKT String
(PRJ). |
CoordinateReferenceSystem |
createFromPrj(InputStream stream,
Charset encoding)
Creates a
CoordinateReferenceSystem defined by an OGC WKT String
(PRJ). |
CoordinateReferenceSystem |
createFromPrj(String prjString)
Creates a
CoordinateReferenceSystem defined by an OGC WKT String
(PRJ). |
CoordinateReferenceSystem |
getCRS(String authorityAndSrid)
Returns a
CoordinateReferenceSystem corresponding to
an authority and a srid. |
RegistryManager |
getRegistryManager()
Return the
RegistryManager used in CTS. |
Set<String> |
getSupportedCodes(String registryName)
Return a list of supported codes according an registryName.
|
boolean |
isRegistrySupported(String registryName)
Check if the registry name (ie EPSG, IGNF...) is supported.
|
String[] |
splitRegistryNameAndCode(String authorityAndSrid)
Return the registry name and the code in a string array.
|
protected final CRSFactory.CRSCache<String,CoordinateReferenceSystem> CRSPOOL
public CoordinateReferenceSystem getCRS(String authorityAndSrid) throws CRSException
CoordinateReferenceSystem corresponding to
an authority and a srid.authorityAndSrid - the code of the desired CRS (for instance
EPSG:4326 or IGNF:LAMBE)CRSExceptionpublic String[] splitRegistryNameAndCode(String authorityAndSrid) throws RegistryException
authorityAndSrid - a string following the pattern "name:code"RegistryExceptionpublic RegistryManager getRegistryManager()
RegistryManager used in CTS.public boolean isRegistrySupported(String registryName) throws RegistryException
registryName - (ex : ESPG, IGNF, ESRI)RegistryExceptionpublic CoordinateReferenceSystem createFromPrj(String prjString) throws CRSException
CoordinateReferenceSystem defined by an OGC WKT String
(PRJ).prjString - the OGC WKT String defining the CRSCRSExceptionpublic CoordinateReferenceSystem createFromPrj(InputStream stream, Charset encoding) throws IOException, CRSException
CoordinateReferenceSystem defined by an OGC WKT String
(PRJ).stream - the input stream of bytes defining the OGC WKT Stringencoding - the charset used to read the input streamIOExceptionCRSExceptionpublic CoordinateReferenceSystem createFromPrj(InputStream stream) throws IOException, CRSException
CoordinateReferenceSystem defined by an OGC WKT String
(PRJ).stream - the input stream of bytes defining the OGC WKT StringIOExceptionCRSExceptionpublic CoordinateReferenceSystem createFromPrj(File file) throws IOException, CRSException
CoordinateReferenceSystem defined by an OGC WKT String
(PRJ).file - containing the OGC WKT String that defined the desired CRSIOException - if there is a problem reading the fileCRSExceptionpublic Set<String> getSupportedCodes(String registryName) throws RegistryException
registryName - (ex : EPSG, IGNF, ESRI)RegistryExceptionCopyright © 2019 CNRS. All rights reserved.