public class Proj4Factory extends GeodeticAuthorityFactory implements CRSAuthorityFactory
"Proj4" name space.
The main methods in this class are:
getAuthority()createCoordinateReferenceSystem(String)createOperation(CoordinateReferenceSystem, CoordinateReferenceSystem, boolean)createParameterizedTransform(ParameterValueGroup)FactoryException otherwise.Defined in the sis-gdal module
| Constructor and Description |
|---|
Proj4Factory()
Creates a default factory.
|
Proj4Factory(Map<String,?> properties)
Creates a new Proj.4 factory.
|
| Modifier and Type | Method and Description |
|---|---|
CoordinateReferenceSystem |
createCoordinateReferenceSystem(String code)
Creates a new CRS from the given Proj.4 definition.
|
IdentifiedObject |
createObject(String code)
Creates a new geodetic object from the given Proj.4 definition.
|
CoordinateOperation |
createOperation(CoordinateReferenceSystem sourceCRS,
CoordinateReferenceSystem targetCRS,
boolean force)
Creates an operation for conversion or transformation between two coordinate reference systems.
|
MathTransform |
createParameterizedTransform(ParameterValueGroup parameters)
Creates a transform from a group of parameters.
|
Citation |
getAuthority()
Returns the project that defines the codes recognized by this factory.
|
Set<String> |
getAuthorityCodes(Class<? extends IdentifiedObject> type)
Returns the set of authority codes for objects of the given type.
|
Set<OperationMethod> |
getAvailableMethods(Class<? extends SingleOperation> type)
Returns some map projection methods supported by Proj.4.
|
Set<String> |
getCodeSpaces()
Returns the code space of the authority.
|
ParameterValueGroup |
getDefaultParameters(String method)
Returns the default parameter values for a math transform using the given operation method.
|
OperationMethod |
getOperationMethod(String name)
Returns the operation method of the given name.
|
createCartesianCS, createCompoundCRS, createCoordinateOperation, createCoordinateSystem, createCoordinateSystemAxis, createCylindricalCS, createDatum, createDerivedCRS, createEllipsoid, createEllipsoidalCS, createEngineeringCRS, createEngineeringDatum, createExtent, createFromCoordinateReferenceSystemCodes, createGeocentricCRS, createGeodeticDatum, createGeographicCRS, createImageCRS, createImageDatum, createOperationMethod, createParameterDescriptor, createParametricCRS, createParametricCS, createParametricDatum, createPolarCS, createPrimeMeridian, createProjectedCRS, createSphericalCS, createTemporalCRS, createTemporalDatum, createTimeCS, createUnit, createVerticalCRS, createVerticalCS, createVerticalDatum, getDescriptionText, newIdentifiedObjectFinder, toString, trimNamespacegetVendorclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcreateCompoundCRS, createDerivedCRS, createEngineeringCRS, createGeocentricCRS, createGeographicCRS, createImageCRS, createProjectedCRS, createTemporalCRS, createVerticalCRSgetDescriptionTextgetVendorpublic Proj4Factory()
public Proj4Factory(Map<String,?> properties)
properties argument is an optional map
for specifying common properties shared by the objects to create. Some available properties are
listed there.
Unknown properties, or properties that do not apply, or properties for which Proj4Factory supplies
itself a value, are ignored.properties - common properties for the objects to create, or null if none.public Citation getAuthority()
getAuthority in interface AuthorityFactorygetAuthority in class GeodeticAuthorityFactoryCitations.PROJ4.AbstractFactory.getVendor()public Set<String> getCodeSpaces()
createCoordinateReferenceSystem(String) before the definition string is passed to Proj.4
"Proj4:+init=epsg:4326".
Note that this is not equivalent to the standard "EPSG:4326" definition since the
axis order is not the same. The "Proj4:" prefix specifies that the remaining part of the string is
a Proj.4 definition; the presence of an "epsg" word in the definition does not change that fact.
getCodeSpaces in class GeodeticAuthorityFactory"Proj4".public Set<String> getAuthorityCodes(Class<? extends IdentifiedObject> type) throws FactoryException
"+proj=lcc").getAuthorityCodes in interface AuthorityFactorytype - the spatial reference objects type.FactoryException - if access to the underlying database failed.public Set<OperationMethod> getAvailableMethods(Class<? extends SingleOperation> type)
String proj = IdentifiedObjects.getName(method, Citations.PROJ4);The
proj names obtained as above can be given in argument to the
getOperationMethod(String) and getDefaultParameters(String) methods.type - SingleOperation.class for fetching all operation methods, or
Projection.class for fetching only map projection methods.DefaultMathTransformFactory.getAvailableMethods(Class)public OperationMethod getOperationMethod(String name) throws FactoryException
getAvailableMethods(Class). Some examples of Proj.4 projection names
are given below (not all of them are supported by this Proj.4 wrapper).
| Name | Meaning |
|---|---|
aea | Albers Equal-Area Conic |
aeqd | Azimuthal Equidistant |
cass | Cassini-Soldner |
cea | Cylindrical Equal Area |
eck4 | Eckert IV |
eck6 | Eckert VI |
eqdc | Equidistant Conic |
gall | Gall Stereograpic |
geos | Geostationary Satellite View |
gnom | Gnomonic |
krovak | Krovak Oblique Conic Conformal |
laea | Lambert Azimuthal Equal Area |
lcc | Lambert Conic Conformal |
merc | Mercator |
mill | Miller Cylindrical |
moll | Mollweide |
nzmg | New Zealand Map Grid |
omerc | Oblique Mercator |
ortho | Orthographic |
sterea | Oblique Stereographic |
stere | Stereographic |
robin | Robinson |
sinu | Sinusoidal |
tmerc | Transverse Mercator |
vandg | VanDerGrinten |
DefaultCoordinateOperationFactory instance.
It works because the Apache SIS operation methods declare the Proj.4 projection names as
aliases.name - the name of the operation method to fetch.FactoryException - if the requested operation method can not be fetched.DefaultCoordinateOperationFactory.getOperationMethod(String)public ParameterValueGroup getDefaultParameters(String method) throws NoSuchIdentifierException
getAvailableMethods(Class).
The returned parameters can be given to createParameterizedTransform(ParameterValueGroup).method - the case insensitive name of the coordinate operation method to search for.OperationMethod identified by the given name.NoSuchIdentifierException - if there is no method registered for the given name or identifier.public MathTransform createParameterizedTransform(ParameterValueGroup parameters) throws FactoryException
OperationMethod name is inferred from
the parameter group name.
Each parameter value is formatted as a Proj.4 parameter in a definition string.
ParameterValueGroup p = factory.getDefaultParameters("Mercator");
p.parameter("semi_major").setValue(6378137.000);
p.parameter("semi_minor").setValue(6356752.314);
MathTransform mt = factory.createParameterizedTransform(p);
The corresponding Proj.4 definition string is:
+proj=merc +a=6378137.0 +b=6356752.314
parameters - the parameter values.FactoryException - if the object creation failed. This exception is thrown
if some required parameter has not been supplied, or has illegal value.getDefaultParameters(String),
getAvailableMethods(Class)public IdentifiedObject createObject(String code) throws FactoryException
createCoordinateReferenceSystem(String).createObject in interface AuthorityFactorycreateObject in class GeodeticAuthorityFactorycode - the Proj.4 definition of the geodetic object to create.FactoryException - if the geodetic object can not be created for the given definition.AbstractIdentifiedObjectpublic CoordinateReferenceSystem createCoordinateReferenceSystem(String code) throws FactoryException
"Proj4:" prefix (ignoring case), if present, is ignored.
"+axis=" parameter — for example "neu" for
North, East and Up respectively — regardless the number of dimensions
in the CRS to create. Apache SIS makes the vertical direction optional:
"neu"), a three-dimensional CRS is created."ne"), a two-dimensional CRS is created."+init=epsg:4326" (not equivalent to the standard EPSG::4326 definition)"+proj=latlong +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0" (default to two-dimensional CRS)"+proj=latlon +a=6378137.0 +b=6356752.314245179 +pm=0.0 +axis=ne" (explicitely two-dimensional)"+proj=latlon +a=6378137.0 +b=6356752.314245179 +pm=0.0 +axis=neu" (three-dimensional)createCoordinateReferenceSystem in interface CRSAuthorityFactorycreateCoordinateReferenceSystem in class GeodeticAuthorityFactorycode - the Proj.4 definition of the CRS object to create.FactoryException - if the CRS object can not be created for the given definition.Proj4.createCRS(String, int)public CoordinateOperation createOperation(CoordinateReferenceSystem sourceCRS, CoordinateReferenceSystem targetCRS, boolean force) throws FactoryException
force is false, then this method returns null.sourceCRS - the source coordinate reference system.targetCRS - the target coordinate reference system.force - whether to force the creation of a Proj.4 transform
even if the given CRS are not wrappers around Proj.4 data structures.null if the given CRS are not wrappers around Proj.4 data structures and force is false.FactoryException - if force is true and this method can not create Proj.4 transform
for the given pair of coordinate reference systems.Proj4.createOperation(CoordinateReferenceSystem, CoordinateReferenceSystem, boolean),
DefaultCoordinateOperationFactory.createOperation(CoordinateReferenceSystem, CoordinateReferenceSystem)Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.