Tabnine Logo
FlatEarth
Code IndexAdd Tabnine to your IDE (free)

How to use
FlatEarth
in
ucar.unidata.geoloc.projection

Best Java code snippets using ucar.unidata.geoloc.projection.FlatEarth (Showing top 20 results out of 315)

origin: edu.ucar/unidataCommon

 /** copy constructor - avoid clone !! */
public ProjectionImpl constructCopy() {
 return new FlatEarth( getOriginLat(), getOriginLon(), getRotationAngle());     
}
origin: edu.ucar/netcdf

/**
 * Construct a FlatEarth Projection, two standard parellels.
 * For the one standard parellel case, set them both to the same value.
 *
 * @param lat0     lat origin of the coord. system on the projection plane
 * @param lon0     lon origin of the coord. system on the projection plane
 * @param rotAngle angle of rotation, in degrees
 * @param radius  earth radius in km
 * @throws IllegalArgumentException if lat0, par1, par2 = +/-90 deg
 */
public FlatEarth(double lat0, double lon0, double rotAngle, double radius) {
 super("FlatEarth", false);
 this.lat0 = Math.toRadians(lat0);
 this.lon0 = Math.toRadians(lon0);
 this.rotAngle = Math.toRadians(rotAngle);
 this.radius = radius;
 precalculate();
 addParameter(CF.GRID_MAPPING_NAME, "flat_earth");
 addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, lat0);
 addParameter(CF.LONGITUDE_OF_PROJECTION_ORIGIN, lon0);
 addParameter(ROTATIONANGLE, rotAngle);
 addParameter(CF.EARTH_RADIUS, radius * 1000);
}
origin: edu.ucar/cdm

/**
 * Test
 *
 * @param args not used
 */
public static void main(String[] args) {
 FlatEarth a = new FlatEarth(90, -100, 0.0);
 ProjectionPoint p = a.latLonToProj(89, -101);
 System.out.println("proj point = " + p);
 LatLonPoint ll = a.projToLatLon(p);
 System.out.println("ll = " + ll);
}
origin: edu.ucar/unidataCommon

/**
 * Check for equality with the Object in question
 *
 * @param proj  object to check
 * @return true if they are equal
 */
public boolean equals(Object proj) {
  if ( !(proj instanceof FlatEarth)) {
    return false;
  }
  FlatEarth oo = (FlatEarth) proj;
  return ((this.getOriginLat() == oo.getOriginLat())
      && (this.getOriginLon() == oo.getOriginLon())
      && (this.rotAngle == oo.rotAngle));
}
origin: opengeospatial/geoapi

  @Override protected FlatEarth createProjection(final ParameterValueGroup p) {
    if (p == null) return new FlatEarth();
    return new FlatEarth(value(p, CF.LATITUDE_OF_PROJECTION_ORIGIN),
               value(p, CF.LONGITUDE_OF_PROJECTION_ORIGIN),
               value(p, FlatEarth.ROTATIONANGLE),
               earthRadius(p) / KILOMETRE);
  }
}
origin: Unidata/thredds

@Test
public void testFlatEarth() {
 testProjectionProjMax(new FlatEarth(), 5000, 5000);
 FlatEarth p = new FlatEarth();
 FlatEarth p2 = (FlatEarth) p.constructCopy();
 assert p.equals(p2);
}
origin: edu.ucar/unidataCommon

/**
 * Set the origin longitude.
 * @param lon   the origin longitude.
 */
public void setOriginLon(double lon) {
  origin.setLongitude(lon);
  lon0 = Math.toRadians(lon);
  precalculate();
}
origin: Unidata/thredds

/**
 * Create a String of the parameters.
 *
 * @return a String of the parameters
 */
public String paramsToString() {
 return toString();
}
origin: edu.ucar/cdm

 public CoordinateTransform makeCoordinateTransform(NetcdfDataset ds, Variable ctv) {
  double lon0 = readAttributeDouble( ctv, CF.LONGITUDE_OF_PROJECTION_ORIGIN, Double.NaN);
  double lat0 = readAttributeDouble( ctv, CF.LATITUDE_OF_PROJECTION_ORIGIN, Double.NaN);
  double rot = readAttributeDouble( ctv, ucar.unidata.geoloc.projection.FlatEarth.ROTATIONANGLE, 0.0);
  double earth_radius = getEarthRadiusInKm(ctv);

  ucar.unidata.geoloc.projection.FlatEarth proj = new ucar.unidata.geoloc.projection.FlatEarth(lat0, lon0, rot, earth_radius);
  return new ProjectionCT(ctv.getShortName(), "FGDC", proj);
 }
}
origin: edu.ucar/unidataCommon

/**
 * Clone this projection.
 *
 * @return Clone of this
 */
public Object clone() {
  FlatEarth cl = (FlatEarth) super.clone();
  cl.origin = new LatLonPointImpl(getOriginLat(), getOriginLon());
  return cl;
}
origin: edu.ucar/unidataCommon

/**
* Set the origin latitude.
*
* @param lat   the origin latitude.
*/
public void setOriginLat(double lat) {
  origin.setLatitude(lat);
  lat0 = Math.toRadians(lat);
  precalculate();
}
origin: edu.ucar/netcdf

/**
 * Create a String of the parameters.
 *
 * @return a String of the parameters
 */
public String paramsToString() {
 return toString();
}
origin: edu.ucar/netcdf

/**
 * origin
 */
//private LatLonPointImpl origin;  // why are we keeping this?
@Override
public ProjectionImpl constructCopy() {
 ProjectionImpl result = new FlatEarth(getOriginLat(), getOriginLon(), getRotationAngle());
 result.setDefaultMapArea(defaultMapArea);
 result.setName(name);
 return result;
}
origin: Unidata/thredds

/**
 * Test
 *
 * @param args not used
 */
public static void main(String[] args) {
 FlatEarth a = new FlatEarth(90, -100, 0.0);
 ProjectionPoint p = a.latLonToProj(89, -101);
 System.out.println("proj point = " + p);
 LatLonPoint ll = a.projToLatLon(p);
 System.out.println("ll = " + ll);
}
origin: edu.ucar/netcdf

 public CoordinateTransform makeCoordinateTransform(NetcdfDataset ds, Variable ctv) {
  double lon0 = readAttributeDouble( ctv, CF.LONGITUDE_OF_PROJECTION_ORIGIN, Double.NaN);
  double lat0 = readAttributeDouble( ctv, CF.LATITUDE_OF_PROJECTION_ORIGIN, Double.NaN);
  double rot = readAttributeDouble( ctv, ucar.unidata.geoloc.projection.FlatEarth.ROTATIONANGLE, 0.0);
  double earth_radius = getEarthRadiusInKm(ctv);

  ucar.unidata.geoloc.projection.FlatEarth proj = new ucar.unidata.geoloc.projection.FlatEarth(lat0, lon0, rot, earth_radius);
  return new ProjectionCT(ctv.getShortName(), "FGDC", proj);
 }
}
origin: Unidata/thredds

/**
 * Construct a FlatEarth Projection, two standard parellels.
 * For the one standard parellel case, set them both to the same value.
 *
 * @param lat0     lat origin of the coord. system on the projection plane
 * @param lon0     lon origin of the coord. system on the projection plane
 * @param rotAngle angle of rotation, in degrees
 * @param radius  earth radius in km
 * @throws IllegalArgumentException if lat0, par1, par2 = +/-90 deg
 */
public FlatEarth(double lat0, double lon0, double rotAngle, double radius) {
 super("FlatEarth", false);
 this.lat0 = Math.toRadians(lat0);
 this.lon0 = Math.toRadians(lon0);
 this.rotAngle = Math.toRadians(rotAngle);
 this.radius = radius;
 precalculate();
 addParameter(CF.GRID_MAPPING_NAME, "flat_earth");
 addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, lat0);
 addParameter(CF.LONGITUDE_OF_PROJECTION_ORIGIN, lon0);
 addParameter(ROTATIONANGLE, rotAngle);
 addParameter(CF.EARTH_RADIUS, radius * 1000);
}
origin: edu.ucar/cdm

/**
 * Create a String of the parameters.
 *
 * @return a String of the parameters
 */
public String paramsToString() {
 return toString();
}
origin: edu.ucar/cdm

/**
 * origin
 */
//private LatLonPointImpl origin;  // why are we keeping this?
@Override
public ProjectionImpl constructCopy() {
 ProjectionImpl result = new FlatEarth(getOriginLat(), getOriginLon(), getRotationAngle());
 result.setDefaultMapArea(defaultMapArea);
 result.setName(name);
 return result;
}
origin: edu.ucar/unidataCommon

/**
 * Test
 *
 * @param args not used
 */
public static void main(String[] args) {
  FlatEarth           a = new FlatEarth(90, -100, 0.0);
  ProjectionPointImpl p = a.latLonToProj(89, -101);
  System.out.println("proj point = " + p);
  LatLonPoint ll = a.projToLatLon(p);
  System.out.println("ll = " + ll);
}
origin: Unidata/thredds

 public ProjectionCT makeCoordinateTransform(AttributeContainer ctv, String geoCoordinateUnits) {
  double lon0 = readAttributeDouble( ctv, CF.LONGITUDE_OF_PROJECTION_ORIGIN, Double.NaN);
  double lat0 = readAttributeDouble( ctv, CF.LATITUDE_OF_PROJECTION_ORIGIN, Double.NaN);
  double rot = readAttributeDouble( ctv, ucar.unidata.geoloc.projection.FlatEarth.ROTATIONANGLE, 0.0);
  double earth_radius = getEarthRadiusInKm(ctv);

  ucar.unidata.geoloc.projection.FlatEarth proj = new ucar.unidata.geoloc.projection.FlatEarth(lat0, lon0, rot, earth_radius);
  return new ProjectionCT(ctv.getName(), "FGDC", proj);
 }
}
ucar.unidata.geoloc.projectionFlatEarth

Javadoc

FlatEarth Projection This projection surface is tangent at some point (lat0, lon0) and has a y axis rotated from true North by some angle.

We call it "flat" because it should only be used where the spherical geometry of the earth is not significant. In actuallity, we use the simple "arclen" routine which computes dy along a meridian, and dx along a latitude circle. We rotate the coordinate system to/from a true north system.

See John Snyder, Map Projections used by the USGS, Bulletin 1532, 2nd edition (1983), p 145

Most used methods

  • <init>
    Construct a FlatEarth Projection, two standard parellels. For the one standard parellel case, set th
  • addParameter
  • getOriginLat
    Get the origin latitude.
  • getOriginLon
    Get the origin longitude.
  • getRotationAngle
    Get the rotation angle.
  • latLonToProj
    Convert lat/lon coordinates to projection coordinates.
  • precalculate
    Precalculate some stuff
  • projToLatLon
    Convert lat/lon coordinates to projection coordinates.
  • toString
  • constructCopy
    origin
  • equals
    Check for equality with the Object in question
  • equals

Popular in Java

  • Running tasks concurrently on multiple threads
  • setContentView (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • compareTo (BigDecimal)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Join (org.hibernate.mapping)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now