Class ProjectionBuilder
- Object
-
- ProjectionBuilder
-
public class ProjectionBuilder extends Object
Class used to create an OGCProjectedCRSinstance 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 StringAXIS_UNITstatic EllipsoidalCSDEFAULT_ELLIPSOIDAL_CS
-
Constructor Summary
Constructors Constructor Description ProjectionBuilder()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static 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 containsparameters 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 amap (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 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 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 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 aDefiningConversionobject from the inputMathTransform
-
createGeodeticDatum
public static GeodeticDatum createGeodeticDatum(String name, Ellipsoid ellipsoid)
Build a DefaultGeodeticDatumon top of a specificEllipsoidinstance, usingDefaultPrimeMeridian.GREENWICHas primeMeridian.
-
createGeographicCRS
public static GeographicCRS createGeographicCRS(String name, GeodeticDatum datum)
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
public static Ellipsoid createEllipsoid(String name, Map<String,Number> ellipsoidParams)
Build a customEllipsoidprovided 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 ProjectedCoordinateReferenceSystemparsing 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 aParameterValueGroupparameters instance for the specified projectionName.- Throws:
NoSuchIdentifierException
-
-