Package mil.nga.proj

Class CRSParser


  • public class CRSParser
    extends Object
    Coordinate Reference System Well-known text parser
    Author:
    osbornb
    • Constructor Summary

      Constructors 
      Constructor Description
      CRSParser()  
    • Constructor Detail

      • CRSParser

        public CRSParser()
    • 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 datum
        transform - 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 - projection
        ellipsoid - ellipsoid
        geoDatum - 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 system
        mapProjection - 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 name
        coordinateSystem - coordinate system
        Returns:
        projection
      • updateUnits

        public static void updateUnits​(org.locationtech.proj4j.proj.Projection projection,
                                       CoordinateSystem coordinateSystem)
        Update the units
        Parameters:
        projection - proj4j projection
        coordinateSystem - 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 projection
        method - operation method
        unit - 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 projection
        method - operation method
        unit - unit
        parameter - 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 parameter
        unit - 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 parameter
        unit - unit
        inUnit - 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 parameter
        unit - 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 parameter
        unit - unit
        inUnit - 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 parameter
        unit - 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 parameter
        unit - unit
        inUnit - 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 convert
        fromUnit - from unit
        toUnit - to unit
        Returns:
        value
        Since:
        1.1.0
      • convertValue

        public static double convertValue​(double value,
                                          Unit fromUnit,
                                          Unit toUnit)
        Convert the value from a unit to another
        Parameters:
        value - value to convert
        fromUnit - from unit
        toUnit - to unit
        Returns:
        value