Class ProjectionBuilder
Object
ProjectionBuilder
Class used to create an OGC
ProjectedCRS
instance on top of Projection name, parameters and Ellipsoid. A
default datum will be created on top of that ellipsoid.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CoordinateReferenceSystem
buildCRS
(Map<String, ?> props, ParameterValueGroup parameters, Ellipsoid ellipsoid) Build a ProjectedCoordinateReferenceSystem
parsing Conversion parameters and Ellipsoidstatic DefiningConversion
createConversionFromBase
(String name, MathTransform transform) Create aDefiningConversion
object from the inputMathTransform
static Ellipsoid
createEllipsoid
(String name, Map<String, Number> ellipsoidParams) Build a customEllipsoid
provided the name and a Map contains <key,number> parameters describing that ellipsoid.static GeodeticDatum
createGeodeticDatum
(String name, Ellipsoid ellipsoid) Build a DefaultGeodeticDatum
on top of a specificEllipsoid
instance, usingDefaultPrimeMeridian.GREENWICH
as primeMeridian.static GeographicCRS
createGeographicCRS
(String name, GeodeticDatum datum) Build aGeographicCRS
given the name to be assigned and theGeodeticDatum
to be used.static GeographicCRS
createGeographicCRS
(String name, GeodeticDatum datum, EllipsoidalCS ellipsoidalCS) Build aGeographicCRS
given the name to be assigned, theGeodeticDatum
to be used and theEllipsoidalCS
.static ProjectedCRS
createProjectedCRS
(Map<String, ?> props, GeographicCRS baseCRS, DefiningConversion conversionFromBase, MathTransform transform) static ProjectedCRS
createProjectedCRS
(Map<String, ?> props, GeographicCRS baseCRS, DefiningConversion conversionFromBase, MathTransform transform, CartesianCS derivedCS) Build aProjectedCRS
given the baseGeographicCRS
, theDefiningConversion
instance from Base as well as theMathTransform
from the base CRS to returned CRS.static CoordinateReferenceSystem
createProjection
(String projectionName, String code, Double semiMajor, Double inverseFlattening, Map<String, Double> params) Quick method to create aCoordinateReferenceSystem
instance, given the OGC ProjectionName, such as "lambert_conformal_conic_2sp"), a custom code number for it, the semiMajor, the inverseFlattening (when infinity, assuming the reference ellipsoid is a spheroid), and the Projection Params through a <key,value> map (as an instance: <"central_meridian",-95>)static MathTransform
createTransform
(ParameterValueGroup parameters) static DefiningConversion
getConversion
(ParameterValueGroup parameters, String name) static ParameterValueGroup
getDefaultparameters
(String projectionName) Get aParameterValueGroup
parameters instance for the specified projectionName.static ParameterValueGroup
getProjectionParameters
(String projectionName) Get Projection parameters from the specified projection name.static void
updateEllipsoidParams
(ParameterValueGroup parameters, Ellipsoid ellipsoid) Make sure to set SEMI_MINOR and SEMI_MAJOR projection's parameters from the ellipsoid definition
-
Field Details
-
AXIS_UNIT
- See Also:
-
DEFAULT_ELLIPSOIDAL_CS
-
-
Constructor Details
-
ProjectionBuilder
public ProjectionBuilder()
-
-
Method Details
-
createProjection
public static CoordinateReferenceSystem createProjection(String projectionName, String code, Double semiMajor, Double inverseFlattening, Map<String, Double> params) throws FactoryExceptionQuick method to create aCoordinateReferenceSystem
instance, given the OGC ProjectionName, such as "lambert_conformal_conic_2sp"), a custom code number for it, the semiMajor, the inverseFlattening (when infinity, assuming the reference ellipsoid is a spheroid), and the Projection Params through a <key,value> map (as an instance: <"central_meridian",-95>)- Throws:
FactoryException
-
getProjectionParameters
public static ParameterValueGroup getProjectionParameters(String projectionName) throws NoSuchIdentifierException Get Projection parameters from the specified projection name.- Throws:
NoSuchIdentifierException
-
updateEllipsoidParams
Make sure to set SEMI_MINOR and SEMI_MAJOR projection's parameters from the ellipsoid definition -
createConversionFromBase
Create aDefiningConversion
object from the inputMathTransform
-
createGeodeticDatum
Build a DefaultGeodeticDatum
on top of a specificEllipsoid
instance, usingDefaultPrimeMeridian.GREENWICH
as primeMeridian. -
createGeographicCRS
Build aGeographicCRS
given the name to be assigned and theGeodeticDatum
to be used.EllipsoidalCS
isDEFAULT_ELLIPSOIDAL_CS
-
createGeographicCRS
public static GeographicCRS createGeographicCRS(String name, GeodeticDatum datum, EllipsoidalCS ellipsoidalCS) Build aGeographicCRS
given the name to be assigned, theGeodeticDatum
to be used and theEllipsoidalCS
. -
createProjectedCRS
public static ProjectedCRS createProjectedCRS(Map<String, ?> props, GeographicCRS baseCRS, DefiningConversion conversionFromBase, MathTransform transform) -
createProjectedCRS
public static ProjectedCRS createProjectedCRS(Map<String, ?> props, GeographicCRS baseCRS, DefiningConversion conversionFromBase, MathTransform transform, CartesianCS derivedCS) Build aProjectedCRS
given the baseGeographicCRS
, theDefiningConversion
instance from Base as well as theMathTransform
from the base CRS to returned CRS. The derivedCS isDefaultCartesianCS.PROJECTED
by default. -
createEllipsoid
Build a customEllipsoid
provided the name and a Map contains <key,number> parameters describing that ellipsoid. Supported params areNetCDFUtilities.SEMI_MAJOR
,NetCDFUtilities.SEMI_MINOR
,NetCDFUtilities.INVERSE_FLATTENING
-
buildCRS
public static CoordinateReferenceSystem buildCRS(Map<String, ?> props, ParameterValueGroup parameters, Ellipsoid ellipsoid) throws NoSuchIdentifierException, FactoryExceptionBuild a ProjectedCoordinateReferenceSystem
parsing Conversion parameters and Ellipsoid -
getConversion
-
createTransform
public static MathTransform createTransform(ParameterValueGroup parameters) throws NoSuchIdentifierException, FactoryException -
getDefaultparameters
public static ParameterValueGroup getDefaultparameters(String projectionName) throws NoSuchIdentifierException Get aParameterValueGroup
parameters instance for the specified projectionName.- Throws:
NoSuchIdentifierException
-