Class BursaWolfInfo
java.lang.Object
org.apache.sis.referencing.factory.sql.BursaWolfInfo
Private structure for
EPSGDataAccess.createBursaWolfParameters(PrimeMeridian, Integer)
usage.
Those information are for compatibility with Well Known Text (WKT) version 1 formatting.
That legacy format had a TOWGS84
element which needs the information provided by this class.
Note that TOWGS84
is a deprecated element as of WKT 2 (ISO 19162).
Note: this class contains many hard-coded EPSG codes relative to Bursa-Wolf parameters.
- Since:
- 0.7
- Version:
- 0.8
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
The value ofAREA_OF_USE_CODE
.private org.opengis.metadata.extent.Extent
The domain of validity as anExtent
object.(package private) static final int
Last Bursa-Wolf method.(package private) final int
The value ofCOORD_OP_METHOD_CODE
.(package private) static final int
First Bursa-Wolf method.(package private) final int
The value ofCOORD_OP_CODE
.private static final int
Rotation frame method.(package private) final int
The target datum inferred from value ofTARGET_CRS_CODE
.(package private) static final int
The target CRS for which to collect Bursa-Wolf parameters.(package private) static final int
The datum ofTARGET_CRS
. -
Constructor Summary
ConstructorsConstructorDescriptionBursaWolfInfo
(int operation, int method, int targetCRS, int domainOfValidity) Fills a structure with the specified values. -
Method Summary
Modifier and TypeMethodDescription(package private) static void
filter
(GeodeticAuthorityFactory factory, BursaWolfInfo[] candidates, List<BursaWolfInfo> addTo) Given an array ofBursaWolfInfo
instances, retains only the instances having the largest domain of validity for each target datum.(package private) org.opengis.metadata.extent.Extent
Gets the domain of validity.(package private) boolean
Returnstrue
if this operation is a frame rotation.(package private) static void
setBursaWolfParameter
(BursaWolfParameters parameters, int code, double value, javax.measure.Unit<?> unit, Locale locale) Sets a Bursa-Wolf parameter from an EPSG parameter.toString()
MUST returns the operation code.
-
Field Details
-
TARGET_CRS
static final int TARGET_CRSThe target CRS for which to collect Bursa-Wolf parameters. Apache SIS accepts an arbitrary number of targets, but theTOWGS84
element only needs the parameters toward the EPSG:4326 coordinate reference system. For now we fix the number of target CRS to only 1, but we can increase that amount in a future SIS version if needed. However, it is better to restrict the target CRS to those that use a world-wide datum only.- See Also:
-
TARGET_DATUM
static final int TARGET_DATUMThe datum ofTARGET_CRS
.- See Also:
-
MIN_METHOD_CODE
static final int MIN_METHOD_CODEFirst Bursa-Wolf method.- See Also:
-
MAX_METHOD_CODE
static final int MAX_METHOD_CODELast Bursa-Wolf method.- See Also:
-
ROTATION_FRAME_CODE
private static final int ROTATION_FRAME_CODERotation frame method.- See Also:
-
operation
final int operationThe value ofCOORD_OP_CODE
. -
method
final int methodThe value ofCOORD_OP_METHOD_CODE
. -
target
final int targetThe target datum inferred from value ofTARGET_CRS_CODE
. -
domainOfValidity
private final int domainOfValidityThe value ofAREA_OF_USE_CODE
. -
extent
private org.opengis.metadata.extent.Extent extentThe domain of validity as anExtent
object.
-
-
Constructor Details
-
BursaWolfInfo
BursaWolfInfo(int operation, int method, int targetCRS, int domainOfValidity) Fills a structure with the specified values.
-
-
Method Details
-
setBursaWolfParameter
static void setBursaWolfParameter(BursaWolfParameters parameters, int code, double value, javax.measure.Unit<?> unit, Locale locale) throws FactoryDataException Sets a Bursa-Wolf parameter from an EPSG parameter. This method recognizes only the parameters that do not depend on time (EPSG:8605 to 8611). This method does not recognize the time-dependent parameters (EPSG:1040 to 1046) because they are not used in WKT 1TOWGS84
elements.- Parameters:
parameters
- the Bursa-Wolf parameters to modify.code
- the EPSG code for a parameter from the [PARAMETER_CODE] column.value
- the value of the parameter from the [PARAMETER_VALUE] column.unit
- the unit of the parameter value from the [UOM_CODE] column.locale
- the locale, used only if an error message need to be formatted.- Throws:
FactoryDataException
- if the code is unrecognized.
-
isFrameRotation
boolean isFrameRotation()Returnstrue
if this operation is a frame rotation. Frame rotations methods are:- EPSG:9607 for the operation that does not depend on time.
- EPSG:1056 for the time-dependent operation (not handled by this class).
-
toString
MUST returns the operation code. This is required byEPSGDataAccess.sort(String, Object[])
. -
getDomainOfValidity
org.opengis.metadata.extent.Extent getDomainOfValidity(GeodeticAuthorityFactory factory) throws org.opengis.util.FactoryException Gets the domain of validity. The result is cached.- Parameters:
factory
- the factory to use for creatingExtent
instances.- Throws:
org.opengis.util.FactoryException
-
filter
static void filter(GeodeticAuthorityFactory factory, BursaWolfInfo[] candidates, List<BursaWolfInfo> addTo) throws org.opengis.util.FactoryException Given an array ofBursaWolfInfo
instances, retains only the instances having the largest domain of validity for each target datum. If two instances have the same domain of validity, the first one is retained. This presume that the instances have already been sorted for preference order before to invoke this method.- Parameters:
factory
- the factory to use for creatingExtent
instances.candidates
- the Bursa-Wolf parameters candidates.addTo
- where to add the instances retained by this method.- Throws:
org.opengis.util.FactoryException
-