Class ProjectionBuilder
- Object
-
- ProjectionBuilder
-
public class ProjectionBuilder extends Object
Class used to create an OGCProjectedCRS
instance on top of Projection name, parameters and Ellipsoid. A default datum will be created on top of that ellipsoid.
-
-
Field Summary
Fields Modifier and Type Field Description static String
AXIS_UNIT
static EllipsoidalCS
DEFAULT_ELLIPSOIDAL_CS
-
Constructor Summary
Constructors Constructor Description ProjectionBuilder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 containsparameters 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 amap (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 Detail
-
AXIS_UNIT
public static final String AXIS_UNIT
- See Also:
- Constant Field Values
-
DEFAULT_ELLIPSOIDAL_CS
public static final EllipsoidalCS DEFAULT_ELLIPSOIDAL_CS
-
-
Method Detail
-
createProjection
public static CoordinateReferenceSystem createProjection(String projectionName, String code, Double semiMajor, Double inverseFlattening, Map<String,Double> params) throws FactoryException
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 amap (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
public static void updateEllipsoidParams(ParameterValueGroup parameters, Ellipsoid ellipsoid)
Make sure to set SEMI_MINOR and SEMI_MAJOR projection's parameters from the ellipsoid definition
-
createConversionFromBase
public static DefiningConversion createConversionFromBase(String name, MathTransform transform)
Create aDefiningConversion
object from the inputMathTransform
-
createGeodeticDatum
public static GeodeticDatum createGeodeticDatum(String name, Ellipsoid ellipsoid)
Build a DefaultGeodeticDatum
on top of a specificEllipsoid
instance, usingDefaultPrimeMeridian.GREENWICH
as primeMeridian.
-
createGeographicCRS
public static GeographicCRS createGeographicCRS(String name, GeodeticDatum datum)
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
public static Ellipsoid createEllipsoid(String name, Map<String,Number> ellipsoidParams)
Build a customEllipsoid
provided the name and a Map containsparameters describing that ellipsoid. Supported params are NetCDFUtilities.SEMI_MAJOR
,NetCDFUtilities.SEMI_MINOR
,NetCDFUtilities.INVERSE_FLATTENING
-
buildCRS
public static CoordinateReferenceSystem buildCRS(Map<String,?> props, ParameterValueGroup parameters, Ellipsoid ellipsoid) throws NoSuchIdentifierException, FactoryException
Build a ProjectedCoordinateReferenceSystem
parsing Conversion parameters and Ellipsoid
-
getConversion
public static DefiningConversion getConversion(ParameterValueGroup parameters, String name)
-
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
-
-