Package mil.nga.proj
Class CRSParser
- java.lang.Object
-
- mil.nga.proj.CRSParser
-
public class CRSParser extends Object
Coordinate Reference System Well-known text parser- Author:
- osbornb
-
-
Constructor Summary
Constructors Constructor Description CRSParser()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
convert(List<Axis> axes)
Convert the list of axes to a proj4j axis orderstatic org.locationtech.proj4j.CoordinateReferenceSystem
convert(CompoundCoordinateReferenceSystem compound)
Convert a compound crs into a proj4 coordinate reference systemstatic org.locationtech.proj4j.CoordinateReferenceSystem
convert(CRS crsObject)
Convert a CRS object into a proj4 coordinate reference systemstatic org.locationtech.proj4j.datum.Ellipsoid
convert(Ellipsoid ellipsoid)
Convert an Ellipsoidstatic org.locationtech.proj4j.CoordinateReferenceSystem
convert(GeoCoordinateReferenceSystem geo)
Convert a geodetic or geographic crs into a proj4 coordinate reference systemstatic org.locationtech.proj4j.datum.Datum
convert(GeoDatum geoDatum)
Convert a Datumstatic org.locationtech.proj4j.datum.Datum
convert(GeoDatum geoDatum, double[] transform)
Convert a Datumstatic org.locationtech.proj4j.CoordinateReferenceSystem
convert(ProjectedCoordinateReferenceSystem projected)
Convert a projected crs into a proj4 coordinate reference systemstatic org.locationtech.proj4j.CoordinateReferenceSystem
convertAsParams(CRS crsObject)
Convert a CRS object into proj4 params, then to a proj4 coordinate reference systemstatic org.locationtech.proj4j.datum.Datum
convertDatum(GeoCoordinateReferenceSystem geo)
Convert a Datumstatic double[]
convertDatumTransform(CRS crs)
Retrieve and convert CRS object TOWGS84 arraysstatic double[]
convertDatumTransform(OperationMethod method)
Convert the operation method into datum transformstatic double
convertValue(double value, Unit fromUnit, Unit toUnit)
Convert the value from a unit to anotherstatic double
convertValue(double value, Unit fromUnit, Units toUnit)
Convert the value from a unit to anotherstatic org.locationtech.proj4j.proj.Projection
createProjection(String projectionName, CoordinateSystem coordinateSystem)
Create a proj4j projection for the projection name and coordinate systemstatic org.locationtech.proj4j.proj.Projection
createProjection(CoordinateSystem coordinateSystem)
Create a proj4j projection for the coordinate systemstatic org.locationtech.proj4j.proj.Projection
createProjection(CoordinateSystem coordinateSystem, MapProjection mapProjection)
Create a proj4j projection for the coordinate system and map projectionstatic org.locationtech.proj4j.CRSFactory
getCRSFactory()
Get the CRS Factorystatic org.locationtech.proj4j.datum.Datum
getDatum(String name)
Get a predefined proj4j datum by name or short namestatic org.locationtech.proj4j.datum.Ellipsoid
getEllipsoid(String name)
Get a predefined proj4j ellipsoid by name or short namestatic double
getValue(OperationParameter parameter, Unit unit)
Get the operation parameter value in the specified unitstatic double
getValue(OperationParameter parameter, Unit unit, Unit inUnit)
Get the operation parameter value in the specified unitstatic double
getValue(OperationParameter parameter, Unit unit, Units inUnit)
Get the operation parameter value in the specified unitstatic double
getValue(OperationParameter parameter, Unit unit, org.locationtech.proj4j.units.Unit inUnit)
Get the operation parameter value in the specified unitstatic double
getValue(OperationParameter parameter, Units unit)
Get the operation parameter value in the specified unitstatic double
getValue(OperationParameter parameter, org.locationtech.proj4j.units.Unit unit)
Get the operation parameter value in the specified unitstatic org.locationtech.proj4j.CoordinateReferenceSystem
parse(String wkt)
Parse crs well-known text into a proj4 coordinate reference systemstatic org.locationtech.proj4j.CoordinateReferenceSystem
parseAsParams(String wkt)
Parse crs well-known text into proj4 params, then to a proj4 coordinate reference systemstatic void
updateParams(org.locationtech.proj4j.proj.Projection projection, OperationMethod method, Unit unit)
Update the method parameters in the projectionstatic void
updateParams(org.locationtech.proj4j.proj.Projection projection, OperationMethod method, Unit unit, OperationParameter parameter)
Update the method parameter in the projectionstatic void
updateProjection(org.locationtech.proj4j.proj.Projection projection, org.locationtech.proj4j.datum.Ellipsoid ellipsoid, GeoDatum geoDatum)
Update the projection ellipsoid and prime meridianstatic void
updateUnits(org.locationtech.proj4j.proj.Projection projection, CoordinateSystem coordinateSystem)
Update the units
-
-
-
Method Detail
-
getCRSFactory
public static org.locationtech.proj4j.CRSFactory getCRSFactory()
Get the CRS Factory- Returns:
- crs factory
-
getDatum
public static org.locationtech.proj4j.datum.Datum getDatum(String name)
Get a predefined proj4j datum by name or short name- Parameters:
name
- name or short name- Returns:
- datum or null
- Since:
- 1.1.0
-
getEllipsoid
public static org.locationtech.proj4j.datum.Ellipsoid getEllipsoid(String name)
Get a predefined proj4j ellipsoid by name or short name- Parameters:
name
- name or short name- Returns:
- ellipsoid or null
-
parse
public static org.locationtech.proj4j.CoordinateReferenceSystem parse(String wkt)
Parse crs well-known text into a proj4 coordinate reference system- Parameters:
wkt
- crs well-known text- Returns:
- coordinate reference system
-
parseAsParams
public static org.locationtech.proj4j.CoordinateReferenceSystem parseAsParams(String wkt)
Parse crs well-known text into proj4 params, then to a proj4 coordinate reference system- Parameters:
wkt
- crs well-known text- Returns:
- coordinate reference system
- Since:
- 1.1.0
-
convert
public static org.locationtech.proj4j.CoordinateReferenceSystem convert(CRS crsObject)
Convert a CRS object into a proj4 coordinate reference system- Parameters:
crsObject
- CRS object- Returns:
- coordinate reference system
-
convertAsParams
public static org.locationtech.proj4j.CoordinateReferenceSystem convertAsParams(CRS crsObject)
Convert a CRS object into proj4 params, then to a proj4 coordinate reference system- Parameters:
crsObject
- CRS object- Returns:
- coordinate reference system
- Since:
- 1.1.0
-
convert
public static org.locationtech.proj4j.CoordinateReferenceSystem convert(GeoCoordinateReferenceSystem geo)
Convert a geodetic or geographic crs into a proj4 coordinate reference system- Parameters:
geo
- geodetic or geographic crs- Returns:
- coordinate reference system
-
convert
public static org.locationtech.proj4j.CoordinateReferenceSystem convert(ProjectedCoordinateReferenceSystem projected)
Convert a projected crs into a proj4 coordinate reference system- Parameters:
projected
- projected crs- Returns:
- coordinate reference system
-
convert
public static org.locationtech.proj4j.CoordinateReferenceSystem convert(CompoundCoordinateReferenceSystem compound)
Convert a compound crs into a proj4 coordinate reference system- Parameters:
compound
- compound crs- Returns:
- coordinate reference system
-
convertDatum
public static org.locationtech.proj4j.datum.Datum convertDatum(GeoCoordinateReferenceSystem geo)
Convert a Datum- Parameters:
geo
- geo CRS- Returns:
- proj4j datum
- Since:
- 1.1.0
-
convert
public static org.locationtech.proj4j.datum.Datum convert(GeoDatum geoDatum)
Convert a Datum- Parameters:
geoDatum
- crs wkt geo datum- Returns:
- proj4j datum
-
convert
public static org.locationtech.proj4j.datum.Datum convert(GeoDatum geoDatum, double[] transform)
Convert a Datum- Parameters:
geoDatum
- crs wkt geo datumtransform
- transform- Returns:
- proj4j datum
- Since:
- 1.1.0
-
convert
public static org.locationtech.proj4j.datum.Ellipsoid convert(Ellipsoid ellipsoid)
Convert an Ellipsoid- Parameters:
ellipsoid
- crs wkt ellipsoid- Returns:
- proj4j ellipsoid
-
convertDatumTransform
public static double[] convertDatumTransform(CRS crs)
Retrieve and convert CRS object TOWGS84 arrays- Parameters:
crs
- CRS object- Returns:
- transform
- Since:
- 1.1.0
-
convertDatumTransform
public static double[] convertDatumTransform(OperationMethod method)
Convert the operation method into datum transform- Parameters:
method
- operation method- Returns:
- transform
-
updateProjection
public static void updateProjection(org.locationtech.proj4j.proj.Projection projection, org.locationtech.proj4j.datum.Ellipsoid ellipsoid, GeoDatum geoDatum)
Update the projection ellipsoid and prime meridian- Parameters:
projection
- projectionellipsoid
- ellipsoidgeoDatum
- geo datum
-
createProjection
public static org.locationtech.proj4j.proj.Projection createProjection(CoordinateSystem coordinateSystem)
Create a proj4j projection for the coordinate system- Parameters:
coordinateSystem
- coordinate system- Returns:
- projection
-
createProjection
public static org.locationtech.proj4j.proj.Projection createProjection(CoordinateSystem coordinateSystem, MapProjection mapProjection)
Create a proj4j projection for the coordinate system and map projection- Parameters:
coordinateSystem
- coordinate systemmapProjection
- map projection- Returns:
- projection
-
createProjection
public static org.locationtech.proj4j.proj.Projection createProjection(String projectionName, CoordinateSystem coordinateSystem)
Create a proj4j projection for the projection name and coordinate system- Parameters:
projectionName
- projection namecoordinateSystem
- coordinate system- Returns:
- projection
-
updateUnits
public static void updateUnits(org.locationtech.proj4j.proj.Projection projection, CoordinateSystem coordinateSystem)
Update the units- Parameters:
projection
- proj4j projectioncoordinateSystem
- coordinate system- Since:
- 1.1.0
-
updateParams
public static void updateParams(org.locationtech.proj4j.proj.Projection projection, OperationMethod method, Unit unit)
Update the method parameters in the projection- Parameters:
projection
- proj4j projectionmethod
- operation methodunit
- unit- Since:
- 1.1.0
-
updateParams
public static void updateParams(org.locationtech.proj4j.proj.Projection projection, OperationMethod method, Unit unit, OperationParameter parameter)
Update the method parameter in the projection- Parameters:
projection
- proj4j projectionmethod
- operation methodunit
- unitparameter
- operation parameter- Since:
- 1.1.0
-
convert
public static String convert(List<Axis> axes)
Convert the list of axes to a proj4j axis order- Parameters:
axes
- list of axes- Returns:
- axis order
-
getValue
public static double getValue(OperationParameter parameter, org.locationtech.proj4j.units.Unit unit)
Get the operation parameter value in the specified unit- Parameters:
parameter
- operation parameterunit
- desired unit- Returns:
- value
-
getValue
public static double getValue(OperationParameter parameter, Unit unit, org.locationtech.proj4j.units.Unit inUnit)
Get the operation parameter value in the specified unit- Parameters:
parameter
- operation parameterunit
- unitinUnit
- in unit- Returns:
- value
- Since:
- 1.1.0
-
getValue
public static double getValue(OperationParameter parameter, Units unit)
Get the operation parameter value in the specified unit- Parameters:
parameter
- operation parameterunit
- desired unit- Returns:
- value
- Since:
- 1.1.0
-
getValue
public static double getValue(OperationParameter parameter, Unit unit, Units inUnit)
Get the operation parameter value in the specified unit- Parameters:
parameter
- operation parameterunit
- unitinUnit
- in unit- Returns:
- value
- Since:
- 1.1.0
-
getValue
public static double getValue(OperationParameter parameter, Unit unit)
Get the operation parameter value in the specified unit- Parameters:
parameter
- operation parameterunit
- desired unit- Returns:
- value
-
getValue
public static double getValue(OperationParameter parameter, Unit unit, Unit inUnit)
Get the operation parameter value in the specified unit- Parameters:
parameter
- operation parameterunit
- unitinUnit
- in unit- Returns:
- value
- Since:
- 1.1.0
-
convertValue
public static double convertValue(double value, Unit fromUnit, Units toUnit)
Convert the value from a unit to another- Parameters:
value
- value to convertfromUnit
- from unittoUnit
- to unit- Returns:
- value
- Since:
- 1.1.0
-
-