Package org.locationtech.proj4j.geoapi
Class OperationFactoryWrapper
- java.lang.Object
-
- org.locationtech.proj4j.geoapi.Wrapper
-
- org.locationtech.proj4j.geoapi.OperationFactoryWrapper
-
- All Implemented Interfaces:
java.io.Serializable
,org.opengis.metadata.Identifier
,org.opengis.referencing.ObjectFactory
,org.opengis.referencing.operation.CoordinateOperationFactory
,org.opengis.referencing.ReferenceIdentifier
,org.opengis.util.Factory
final class OperationFactoryWrapper extends Wrapper implements org.opengis.referencing.operation.CoordinateOperationFactory, java.io.Serializable
Wraps a PROJ4J implementation behind the equivalent GeoAPI interface.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) CoordinateTransformFactory
impl
The wrapped PROJ4 implementation.-
Fields inherited from class org.locationtech.proj4j.geoapi.Wrapper
BIDIMENSIONAL, TRIDIMENSIONAL
-
-
Constructor Summary
Constructors Modifier Constructor Description private
OperationFactoryWrapper(CoordinateTransformFactory impl)
Creates a new wrapper for the given PROJ4J implementation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description org.opengis.referencing.operation.CoordinateOperation
createConcatenatedOperation(java.util.Map<java.lang.String,?> properties, org.opengis.referencing.operation.CoordinateOperation... operations)
org.opengis.referencing.operation.Conversion
createDefiningConversion(java.util.Map<java.lang.String,?> properties, org.opengis.referencing.operation.OperationMethod method, org.opengis.parameter.ParameterValueGroup parameters)
org.opengis.referencing.operation.CoordinateOperation
createOperation(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS)
Creates a coordinate operation between the given pair of CRSs.org.opengis.referencing.operation.CoordinateOperation
createOperation(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, org.opengis.referencing.operation.OperationMethod method)
Creates a coordinate operation between the given pair of CRSs, ignoring the given method.java.lang.String
getCode()
{@return the factory name}.org.opengis.metadata.citation.Citation
getVendor()
{@return an identification of the softwware that provides the CRS definitions}.(package private) java.lang.Object
implementation()
{@return the PROJ4J backing implementation}.private static CoordinateReferenceSystem
unwrap(java.lang.String name, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Returns the given CRS as a PROJ4J implementation.(package private) static OperationFactoryWrapper
wrap(CoordinateTransformFactory impl)
Wraps the given implementation.-
Methods inherited from class org.locationtech.proj4j.geoapi.Wrapper
equals, getAlias, getAuthority, getCodeSpace, getDomainOfValidity, getIdentifiers, getName, getRemarks, getScope, getVersion, hashCode, toString, toWKT
-
-
-
-
Field Detail
-
impl
final CoordinateTransformFactory impl
The wrapped PROJ4 implementation.
-
-
Constructor Detail
-
OperationFactoryWrapper
private OperationFactoryWrapper(CoordinateTransformFactory impl)
Creates a new wrapper for the given PROJ4J implementation.
-
-
Method Detail
-
wrap
static OperationFactoryWrapper wrap(CoordinateTransformFactory impl)
Wraps the given implementation.- Parameters:
impl
- the implementation to wrap, ornull
- Returns:
- the wrapper, or
null
if the given implementation was null
-
implementation
java.lang.Object implementation()
{@return the PROJ4J backing implementation}.- Specified by:
implementation
in classWrapper
-
getCode
public java.lang.String getCode()
{@return the factory name}.
-
getVendor
public org.opengis.metadata.citation.Citation getVendor()
{@return an identification of the softwware that provides the CRS definitions}. This is not the authority (EPSG, ESRI, etc).- Specified by:
getVendor
in interfaceorg.opengis.util.Factory
-
unwrap
private static CoordinateReferenceSystem unwrap(java.lang.String name, org.opengis.referencing.crs.CoordinateReferenceSystem crs)
Returns the given CRS as a PROJ4J implementation. This method avoids loading theImporter
class when the given CRS is a PROJ4J wrapper.- Parameters:
name
- "source" or "target", in case an error message needs to be producedcrs
- the CRS to unwrap- Returns:
- the PROJ4J object for the given CRS.
-
createOperation
public org.opengis.referencing.operation.CoordinateOperation createOperation(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS) throws org.opengis.util.FactoryException
Creates a coordinate operation between the given pair of CRSs.- Specified by:
createOperation
in interfaceorg.opengis.referencing.operation.CoordinateOperationFactory
- Parameters:
sourceCRS
- the source coordinate reference systemtargetCRS
- the target coordinate reference system- Returns:
- coordinate operation from source to target
- Throws:
org.opengis.util.FactoryException
- if the operation cannot be created
-
createOperation
public org.opengis.referencing.operation.CoordinateOperation createOperation(org.opengis.referencing.crs.CoordinateReferenceSystem sourceCRS, org.opengis.referencing.crs.CoordinateReferenceSystem targetCRS, org.opengis.referencing.operation.OperationMethod method) throws org.opengis.util.FactoryException
Creates a coordinate operation between the given pair of CRSs, ignoring the given method.- Specified by:
createOperation
in interfaceorg.opengis.referencing.operation.CoordinateOperationFactory
- Parameters:
sourceCRS
- the source coordinate reference systemtargetCRS
- the target coordinate reference systemmethod
- ignored- Returns:
- coordinate operation from source to target
- Throws:
org.opengis.util.FactoryException
- if the operation cannot be created
-
createConcatenatedOperation
public org.opengis.referencing.operation.CoordinateOperation createConcatenatedOperation(java.util.Map<java.lang.String,?> properties, org.opengis.referencing.operation.CoordinateOperation... operations) throws org.opengis.util.FactoryException
- Specified by:
createConcatenatedOperation
in interfaceorg.opengis.referencing.operation.CoordinateOperationFactory
- Throws:
org.opengis.util.FactoryException
-
createDefiningConversion
public org.opengis.referencing.operation.Conversion createDefiningConversion(java.util.Map<java.lang.String,?> properties, org.opengis.referencing.operation.OperationMethod method, org.opengis.parameter.ParameterValueGroup parameters) throws org.opengis.util.FactoryException
- Specified by:
createDefiningConversion
in interfaceorg.opengis.referencing.operation.CoordinateOperationFactory
- Throws:
org.opengis.util.FactoryException
-
-