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 CoordinateReferenceSystembuildCRS(Map<String, ?> props, ParameterValueGroup parameters, Ellipsoid ellipsoid) Build a ProjectedCoordinateReferenceSystemparsing Conversion parameters and Ellipsoidstatic DefiningConversioncreateConversionFromBase(String name, MathTransform transform) Create aDefiningConversionobject from the inputMathTransformstatic EllipsoidcreateEllipsoid(String name, Map<String, Number> ellipsoidParams) Build a customEllipsoidprovided the name and a Map contains <key,number> parameters describing that ellipsoid.static GeodeticDatumcreateGeodeticDatum(String name, Ellipsoid ellipsoid) Build a DefaultGeodeticDatumon top of a specificEllipsoidinstance, usingDefaultPrimeMeridian.GREENWICHas primeMeridian.static GeographicCRScreateGeographicCRS(String name, GeodeticDatum datum) Build aGeographicCRSgiven the name to be assigned and theGeodeticDatumto be used.static GeographicCRScreateGeographicCRS(String name, GeodeticDatum datum, EllipsoidalCS ellipsoidalCS) Build aGeographicCRSgiven the name to be assigned, theGeodeticDatumto be used and theEllipsoidalCS.static ProjectedCRScreateProjectedCRS(Map<String, ?> props, GeographicCRS baseCRS, DefiningConversion conversionFromBase, MathTransform transform) static ProjectedCRScreateProjectedCRS(Map<String, ?> props, GeographicCRS baseCRS, DefiningConversion conversionFromBase, MathTransform transform, CartesianCS derivedCS) Build aProjectedCRSgiven the baseGeographicCRS, theDefiningConversioninstance from Base as well as theMathTransformfrom the base CRS to returned CRS.static CoordinateReferenceSystemcreateProjection(String projectionName, String code, Double semiMajor, Double inverseFlattening, Map<String, Double> params) Quick method to create aCoordinateReferenceSysteminstance, 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 MathTransformcreateTransform(ParameterValueGroup parameters) static DefiningConversiongetConversion(ParameterValueGroup parameters, String name) static ParameterValueGroupgetDefaultparameters(String projectionName) Get aParameterValueGroupparameters instance for the specified projectionName.static ParameterValueGroupgetProjectionParameters(String projectionName) Get Projection parameters from the specified projection name.static voidupdateEllipsoidParams(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 aCoordinateReferenceSysteminstance, 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 aDefiningConversionobject from the inputMathTransform -
createGeodeticDatum
Build a DefaultGeodeticDatumon top of a specificEllipsoidinstance, usingDefaultPrimeMeridian.GREENWICHas primeMeridian. -
createGeographicCRS
Build aGeographicCRSgiven the name to be assigned and theGeodeticDatumto be used.EllipsoidalCSisDEFAULT_ELLIPSOIDAL_CS -
createGeographicCRS
public static GeographicCRS createGeographicCRS(String name, GeodeticDatum datum, EllipsoidalCS ellipsoidalCS) Build aGeographicCRSgiven the name to be assigned, theGeodeticDatumto 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 aProjectedCRSgiven the baseGeographicCRS, theDefiningConversioninstance from Base as well as theMathTransformfrom the base CRS to returned CRS. The derivedCS isDefaultCartesianCS.PROJECTEDby default. -
createEllipsoid
Build a customEllipsoidprovided 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 ProjectedCoordinateReferenceSystemparsing 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 aParameterValueGroupparameters instance for the specified projectionName.- Throws:
NoSuchIdentifierException
-