Class GCTPCStyleProjection

All Implemented Interfaces:
Cloneable, ProjectionConstants
Direct Known Subclasses:
AlaskaConformalProjection, AlbersConicalEqualAreaProjection, AzimuthalEquidistantProjection, EquidistantConicProjection, EquirectangularProjection, GeneralVerticalNearsidePerspectiveProjection, GeographicProjection, GnomonicProjection, HammerProjection, HotineObliqueMercatorProjection, InterruptedGoodeHomolosineProjection, InterruptedMollweideProjection, LambertAzimuthalEqualAreaProjection, LambertConformalConicProjection, MercatorProjection, MillerCylindricalProjection, MollweideProjection, OblatedEqualAreaProjection, OrthographicProjection, PolarStereographicProjection, PolyconicProjection, RobinsonProjection, SinusoidalProjection, SpaceObliqueMercatorProjection, StatePlaneProjection, StereographicProjection, TransverseMercatorProjection, UniversalTransverseMercatorProjection, VanderGrintenProjection, WagnerIVProjection, WagnerVIIProjection

public abstract class GCTPCStyleProjection extends GCTPStyleProjection
The GCTPCStyleProjection class provides method signatures that correspond directly with the GCTPC code modules for ease of converting GCTPC code to Java.
Since:
3.3.0
Author:
Peter Hollemans
  • Field Details

  • Constructor Details

    • GCTPCStyleProjection

      protected GCTPCStyleProjection(int system, int zone, double rMajor, double rMinor, int[] dimensions, AffineTransform affine) throws NoninvertibleTransformException
      Creates a GCTP C style projection.
      Parameters:
      system - the map projection system.
      zone - the map projection zone for State Plane and UTM projections.
      rMajor - the semi-major axis in meters.
      rMinor - the semi-minor axis in meters.
      dimensions - the dimensions of the data grid as [rows, columns].
      affine - the affine transform for translating data [row, column] to map [x, y].
      Throws:
      NoninvertibleTransformException
  • Method Details

    • projfor

      protected abstract long projfor(double lat, double lon, double[] x, double[] y)
      Performs the actual forward calculation as specified in the GCTP C code. This method is as close as possible to the native C function signature.
      Parameters:
      lat - the latitude to convert.
      lon - the longitude to convert.
      x - the map coordinate x value (modified).
      y - the map coordinate y value (modified).
      Returns:
      OK on success, or not OK on failure.
    • mapTransformFor

      public void mapTransformFor(double[] lonLat, double[] xy)
      Description copied from class: MapProjection
      Performs a forward map transformation from (latitude, longitude) coordinates to map (x, y).
      Specified by:
      mapTransformFor in class MapProjection
      Parameters:
      lonLat - the longitude and latitude in radians.
      xy - the x and y in meters or Double.NaN if the transform could not be computed (modified).
    • projinv

      protected abstract long projinv(double x, double y, double[] lon, double[] lat)
      Performs the actual inverse calculation as specified in the GCTP C code. This method is as close as possible to the native C function signature.
      Parameters:
      lat - the latitude to convert.
      lon - the longitude to convert.
      x - the map coordinate x value (modified).
      y - the map coordinate y value (modified).
      Returns:
      OK on success, or not OK on failure.
    • mapTransformInv

      public void mapTransformInv(double[] xy, double[] lonLat)
      Description copied from class: MapProjection
      Performs an inverse map transformation from map (x, y) coordinates to (latitude, longitude).
      Specified by:
      mapTransformInv in class MapProjection
      Parameters:
      xy - the x and y in meters.
      lonLat - the longitude and latitude in radians or Double.NaN if the transform could not be computed (modified).
    • sprintf

      protected static void sprintf(char[] buffer, String format, Object... args)
    • p_error

      protected static void p_error(char[] what, char[] where)
      These are some GCTP error reporting methods that log at the FINER level. Some of the GCTP functions log errors when a coordinate transform fails due to not being on the map. For example a GVNSP coordinate transform logs an error when the (x,y) to (lat,lon) calculation fails because the (x,y) is a space view pixel. In order to keep the coordinate transform code fast when transforming large numbers of possibly invalid coordinates and avoid creating new strings whenever an error is found, we check the logger level first in these method to make sure the creation of a message string is needed.
    • p_error

      protected static void p_error(String what, String where)
    • p_error

      protected static void p_error(char[] what, String where)
    • ptitle

      protected static void ptitle(String title)
      These are some GCTP parameter reporting methods that log at the FINE level.
    • radius

      protected void radius(double r)
    • radius2

      protected void radius2(double rmaj, double rmin)
    • cenlon

      protected void cenlon(double lon)
    • cenlonmer

      protected void cenlonmer(double lon)
    • cenlat

      protected void cenlat(double lat)
    • origin

      protected void origin(double lat)
    • stanparl

      protected void stanparl(double lat1, double lat2)
    • stparl1

      protected void stparl1(double lat)
    • offsetp

      protected void offsetp(double fe, double fn)
    • genrpt

      protected static void genrpt(double a, String what)
    • genrpt_long

      protected static void genrpt_long(long a, String what)
    • setParameters

      public void setParameters(double[] parameters)
      Sets the GCTPC style parameter set. This is the parameter set that will be returned by getParameters().
      Parameters:
      parameters - the parameters to set.
    • getParameters

      public double[] getParameters()
      Description copied from class: MapProjection
      Gets a set of GCTP-style projection parameters if available.
      Overrides:
      getParameters in class MapProjection
      Returns:
      the parameters array.
    • phi1z

      public static double phi1z(double eccent, double qs, long[] flag)
      Convenience function for phi1z.
    • phi2z

      public static double phi2z(double eccent, double ts, long[] flag)
      Convenience function for phi2z.
    • phi3z

      public static double phi3z(double ml, double e0, double e1, double e2, double e3, long[] flag)
      Convenience function for phi3z.
    • phi4z

      public static long phi4z(double eccent, double e0, double e1, double e2, double e3, double a, double b, double[] c, double[] phi)
      Convenience function for phi4z.
    • paksz

      public static double paksz(double ang, long[] iflg)
      Converts DMS packed angle into degrees.
      Parameters:
      ang - the DMS packed angle.
      iflg - the error flag number (modified).
      Returns:
      the unpacked angle in degrees.