Codota Logo
Stereographic
Code IndexAdd Codota to your IDE (free)

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

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

  • Common ways to obtain Stereographic
private void myMethod () {
Stereographic s =
  • Codota Iconnew Stereographic(p[0], p[1], p[2])
  • Codota Iconnew Stereographic(latt, lont, scale)
  • Codota Iconnew Stereographic(double1, lont, double2)
  • Smart code suggestions by Codota
}
origin: edu.ucar/unidataCommon

/**
 * copy constructor - avoid clone !!
 */
public ProjectionImpl constructCopy() {
 return new Stereographic(getTangentLat(), getTangentLon(), getScale(), getFalseEasting(), getFalseNorthing());
}
origin: edu.ucar/netcdf

/**
 * Construct a polar Stereographic Projection, from the "natural origin" and the tangent point,
 * calculating the scale factor.
 *
 * @param lat_ts_deg Latitude at natural origin (degrees_north)
 * @param latt_deg   tangent point of projection (degrees_north)
 * @param lont_deg   tangent point of projection, also origin of projection coord system  ((degrees_east)
 * @param north      true if north pole, false is south pole
 */
public Stereographic(double lat_ts_deg, double latt_deg, double lont_deg, boolean north) {
 super("PolarStereographic", false);
 this.latts = Math.toRadians(lat_ts_deg);
 this.latt = Math.toRadians(latt_deg);
 this.lont = Math.toRadians(lont_deg);
 this.isPolar = true;
 this.isNorth = north;
 this.earthRadius = EARTH_RADIUS;
 this.falseEasting = 0;
 this.falseNorthing = 0;
 precalculate();
 double scaleFactor = (lat_ts_deg == 90 || lat_ts_deg == -90) ? 1.0 : getScaleFactor(latts, north);
 this.scale = scaleFactor * earthRadius;
 addParameter(CF.GRID_MAPPING_NAME, "polar_stereographic");
 addParameter("longitude_of_projection_origin", lont_deg);
 addParameter("latitude_of_projection_origin", latt_deg);
 addParameter("scale_factor_at_projection_origin", scaleFactor);
}
origin: edu.ucar/unidataCommon

/**
 * Returns true if this represents the same Projection as proj.
 *
 * @param proj projection in question
 * @return true if this represents the same Projection as proj.
 */
public boolean equals(Object proj) {
 if (!(proj instanceof Stereographic)) {
  return false;
 }
 Stereographic oo = (Stereographic) proj;
 return ((this.getScale() == oo.getScale())
     && (this.getTangentLat() == oo.getTangentLat())
     && (this.getTangentLon() == oo.getTangentLon())
     && this.defaultMapArea.equals(oo.defaultMapArea));
}
origin: edu.ucar/netcdf

/**
 * Construct a Stereographic Projection.
 *
 * @param latt           tangent point of projection, also origin of projection coord system
 * @param lont           tangent point of projection, also origin of projection coord system
 * @param scale          scale factor at tangent point, "normally 1.0 but may be reduced"
 * @param false_easting  false easting in units of x coords
 * @param false_northing false northing in units of y coords
 * @param radius         earth radius in km
 */
public Stereographic(double latt, double lont, double scale, double false_easting, double false_northing, double radius) {
 super("Stereographic", false);
 this.latt = Math.toRadians(latt);
 this.lont = Math.toRadians(lont);
 this.earthRadius = radius;
 this.scale = scale * earthRadius;
 this.falseEasting = false_easting;
 this.falseNorthing = false_northing;
 precalculate();
 addParameter(CF.GRID_MAPPING_NAME, CF.STEREOGRAPHIC);
 addParameter(CF.LONGITUDE_OF_PROJECTION_ORIGIN, lont);
 addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, latt);
 addParameter(CF.SCALE_FACTOR_AT_PROJECTION_ORIGIN, scale);
 addParameter(CF.EARTH_RADIUS, earthRadius * 1000);
 if ((false_easting != 0.0) || (false_northing != 0.0)) {
  addParameter(CF.FALSE_EASTING, false_easting);
  addParameter(CF.FALSE_NORTHING, false_northing);
  addParameter(CDM.UNITS, "km");
 }
}
origin: Unidata/thredds

/**
 * Construct a Stereographic Projection using latitude of true scale and calculating scale factor.
 * <p> Since the scale factor at lat = k = 2*k0/(1+sin(lat))  [Snyder,Working Manual p157]
 * then to make scale = 1 at lat, set k0 = (1+sin(lat))/2
 *
 * @param latt    tangent point of projection, also origin of projection coord system
 * @param lont    tangent point of projection, also origin of projection coord system
 * @param latTrue latitude of true scale in degrees north; latitude where scale factor = 1.0
 * @return Stereographic projection
 */
static public Stereographic factory(double latt, double lont, double latTrue) {
 double scale = (1.0 + Math.sin(Math.toRadians(latTrue))) / 2.0;
 return new Stereographic(latt, lont, scale);
}
origin: Unidata/thredds

private ProjectionCT makeStereoProjection(NetcdfDataset ds, String name) throws NoSuchElementException {
 double centralLat = findAttributeDouble(ds, "centralLat");
 double centralLon = findAttributeDouble(ds, "centralLon");
 // scale factor at lat = k = 2*k0/(1+sin(lat))  [Snyder,Working Manual p157]
 // then to make scale = 1 at lat, k0 = (1+sin(lat))/2
 double latDxDy = findAttributeDouble(ds, "latDxDy");
 double latR = Math.toRadians(latDxDy);
 double scale = (1.0 + Math.abs(Math.sin(latR))) / 2;  // thanks to R Schmunk
 // Stereographic(double latt, double lont, double scale)
 Stereographic proj = new Stereographic(centralLat, centralLon, scale);
 // we have to project in order to find the origin
 double lat0 = findAttributeDouble(ds, "lat00");
 double lon0 = findAttributeDouble(ds, "lon00");
 ProjectionPointImpl start = (ProjectionPointImpl) proj.latLonToProj(new LatLonPointImpl(lat0, lon0));
 startx = start.getX();
 starty = start.getY();
 // projection info
 parseInfo.format("---makeStereoProjection start at proj coord %s%n", start);
 double latN = findAttributeDouble(ds, "latNxNy");
 double lonN = findAttributeDouble(ds, "lonNxNy");
 ProjectionPointImpl pt = (ProjectionPointImpl) proj.latLonToProj(new LatLonPointImpl(latN, lonN));
 parseInfo.format("                        end at proj coord %s%n", pt);
 parseInfo.format("                        scale= %f%n", scale);
 return new ProjectionCT(name, "FGDC", proj);
}
origin: Unidata/thredds

@Test
public void testStereo() {
 testProjection(new Stereographic());
 Stereographic p = new Stereographic();
 Stereographic p2 = (Stereographic) p.constructCopy();
 assert p.equals(p2);
}
origin: edu.ucar/netcdf

/**
 * @deprecated
 */
public void setTangentLat(double latt) {
 this.latt =  Math.toRadians(latt);
 precalculate();
}
origin: edu.ucar/unidataCommon

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

/**
 * Get the parameters as a String
 *
 * @return the parameters as a String
 */
public String paramsToString() {
 return " tangent " + origin.toString() + " scale: " + Format.d(getScale(), 6);
}
origin: edu.ucar/unidataCommon

/**
 * Construct a Stereographic Projection using latitude of true scale and calculating scale factor.
 * <p> Since the scale factor at lat = k = 2*k0/(1+sin(lat))  [Snyder,Working Manual p157]
 * then to make scale = 1 at lat, set k0 = (1+sin(lat))/2
 *
 * @param latt    tangent point of projection, also origin of projection coord system
 * @param lont    tangent point of projection, also origin of projection coord system
 * @param latTrue latitude of true scale in degrees north; latitude where scale factor = 1.0
 * @return Stereographic projection
 */
static public Stereographic factory(double latt, double lont, double latTrue) {
 double scale = (1.0 + Math.sin(Math.toRadians(latTrue))) / 2.0;
 return new Stereographic(latt, lont, scale);
}
origin: edu.ucar/netcdf

private ProjectionCT makeStereoProjection(NetcdfDataset ds, String name) throws NoSuchElementException {
 double centralLat = findAttributeDouble(ds, "centralLat");
 double centralLon = findAttributeDouble(ds, "centralLon");
 double rotation = findAttributeDouble(ds, "rotation");
 // scale factor at lat = k = 2*k0/(1+sin(lat))  [Snyder,Working Manual p157]
 // then to make scale = 1 at lat, k0 = (1+sin(lat))/2
 double latDxDy = findAttributeDouble(ds, "latDxDy");
 double latR = Math.toRadians(latDxDy);
 double scale = (1.0 + Math.abs(Math.sin(latR))) / 2;  // thanks to R Schmunk
 // Stereographic(double latt, double lont, double scale)
 Stereographic proj = new Stereographic(centralLat, centralLon, scale);
 // we have to project in order to find the origin
 double lat0 = findAttributeDouble(ds, "lat00");
 double lon0 = findAttributeDouble(ds, "lon00");
 ProjectionPointImpl start = (ProjectionPointImpl) proj.latLonToProj(new LatLonPointImpl(lat0, lon0));
 startx = start.getX();
 starty = start.getY();
 // projection info
 parseInfo.format("---makeStereoProjection start at proj coord %s\n", start);
 double latN = findAttributeDouble(ds, "latNxNy");
 double lonN = findAttributeDouble(ds, "lonNxNy");
 ProjectionPointImpl pt = (ProjectionPointImpl) proj.latLonToProj(new LatLonPointImpl(latN, lonN));
 parseInfo.format("                        end at proj coord %s\n", pt);
 parseInfo.format("                        scale= %f\n", scale);
 return new ProjectionCT(name, "FGDC", proj);
}
origin: edu.ucar/cdm

/**
 * Construct a Stereographic Projection.
 *
 * @param latt           tangent point of projection, also origin of projection coord system
 * @param lont           tangent point of projection, also origin of projection coord system
 * @param scale          scale factor at tangent point, "normally 1.0 but may be reduced"
 * @param false_easting  false easting in units of x coords
 * @param false_northing false northing in units of y coords
 * @param radius         earth radius in km
 */
public Stereographic(double latt, double lont, double scale, double false_easting, double false_northing, double radius) {
 super("Stereographic", false);
 this.latt = Math.toRadians(latt);
 this.lont = Math.toRadians(lont);
 this.earthRadius = radius;
 this.scale = scale * earthRadius;
 this.falseEasting = false_easting;
 this.falseNorthing = false_northing;
 precalculate();
 addParameter(CF.GRID_MAPPING_NAME, CF.STEREOGRAPHIC);
 addParameter(CF.LONGITUDE_OF_PROJECTION_ORIGIN, lont);
 addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, latt);
 addParameter(CF.SCALE_FACTOR_AT_PROJECTION_ORIGIN, scale);
 addParameter(CF.EARTH_RADIUS, earthRadius * 1000);
 if ((false_easting != 0.0) || (false_northing != 0.0)) {
  addParameter(CF.FALSE_EASTING, false_easting);
  addParameter(CF.FALSE_NORTHING, false_northing);
  addParameter(CDM.UNITS, "km");
 }
}
origin: edu.ucar/cdm

/**
 * @deprecated
 */
public void setTangentLat(double latt) {
 this.latt =  Math.toRadians(latt);
 precalculate();
}
origin: edu.ucar/netcdf

@Override
public ProjectionImpl constructCopy() {
 ProjectionImpl result =  new Stereographic(getTangentLat(), getTangentLon(), getScale(), getFalseEasting(), getFalseNorthing(), getEarthRadius());
 result.setDefaultMapArea(defaultMapArea);
 result.setName(name);
 return result;
}
origin: edu.ucar/cdm

/**
 * Construct a Stereographic Projection using latitude of true scale and calculating scale factor.
 * <p> Since the scale factor at lat = k = 2*k0/(1+sin(lat))  [Snyder,Working Manual p157]
 * then to make scale = 1 at lat, set k0 = (1+sin(lat))/2
 *
 * @param latt    tangent point of projection, also origin of projection coord system
 * @param lont    tangent point of projection, also origin of projection coord system
 * @param latTrue latitude of true scale in degrees north; latitude where scale factor = 1.0
 * @return Stereographic projection
 */
static public Stereographic factory(double latt, double lont, double latTrue) {
 double scale = (1.0 + Math.sin(Math.toRadians(latTrue))) / 2.0;
 return new Stereographic(latt, lont, scale);
}
origin: edu.ucar/cdm

private ProjectionCT makeStereoProjection(NetcdfDataset ds, String name) throws NoSuchElementException {
 double centralLat = findAttributeDouble(ds, "centralLat");
 double centralLon = findAttributeDouble(ds, "centralLon");
 double rotation = findAttributeDouble(ds, "rotation");
 // scale factor at lat = k = 2*k0/(1+sin(lat))  [Snyder,Working Manual p157]
 // then to make scale = 1 at lat, k0 = (1+sin(lat))/2
 double latDxDy = findAttributeDouble(ds, "latDxDy");
 double latR = Math.toRadians(latDxDy);
 double scale = (1.0 + Math.abs(Math.sin(latR))) / 2;  // thanks to R Schmunk
 // Stereographic(double latt, double lont, double scale)
 Stereographic proj = new Stereographic(centralLat, centralLon, scale);
 // we have to project in order to find the origin
 double lat0 = findAttributeDouble(ds, "lat00");
 double lon0 = findAttributeDouble(ds, "lon00");
 ProjectionPointImpl start = (ProjectionPointImpl) proj.latLonToProj(new LatLonPointImpl(lat0, lon0));
 startx = start.getX();
 starty = start.getY();
 // projection info
 parseInfo.format("---makeStereoProjection start at proj coord %s%n", start);
 double latN = findAttributeDouble(ds, "latNxNy");
 double lonN = findAttributeDouble(ds, "lonNxNy");
 ProjectionPointImpl pt = (ProjectionPointImpl) proj.latLonToProj(new LatLonPointImpl(latN, lonN));
 parseInfo.format("                        end at proj coord %s%n", pt);
 parseInfo.format("                        scale= %f%n", scale);
 return new ProjectionCT(name, "FGDC", proj);
}
origin: edu.ucar/cdm

/**
 * Construct a polar Stereographic Projection, from the "natural origin" and the tangent point,
 * calculating the scale factor.
 *
 * @param lat_ts_deg Latitude at natural origin (degrees_north)
 * @param latt_deg   tangent point of projection (degrees_north)
 * @param lont_deg   tangent point of projection, also origin of projection coord system  ((degrees_east)
 * @param north      true if north pole, false is south pole
 */
public Stereographic(double lat_ts_deg, double latt_deg, double lont_deg, boolean north) {
 super("PolarStereographic", false);
 this.latts = Math.toRadians(lat_ts_deg);
 this.latt = Math.toRadians(latt_deg);
 this.lont = Math.toRadians(lont_deg);
 this.isPolar = true;
 this.isNorth = north;
 this.earthRadius = EARTH_RADIUS;
 this.falseEasting = 0;
 this.falseNorthing = 0;
 precalculate();
 double scaleFactor = (lat_ts_deg == 90 || lat_ts_deg == -90) ? 1.0 : getScaleFactor(latts, north);
 this.scale = scaleFactor * earthRadius;
 addParameter(CF.GRID_MAPPING_NAME, "polar_stereographic");
 addParameter("longitude_of_projection_origin", lont_deg);
 addParameter("latitude_of_projection_origin", latt_deg);
 addParameter("scale_factor_at_projection_origin", scaleFactor);
}
origin: Unidata/thredds

/**
 * Construct a Stereographic Projection.
 *
 * @param latt           tangent point of projection, also origin of projection coord system
 * @param lont           tangent point of projection, also origin of projection coord system
 * @param scale          scale factor at tangent point, "normally 1.0 but may be reduced"
 * @param false_easting  false easting in units of x coords
 * @param false_northing false northing in units of y coords
 * @param radius         earth radius in km
 */
public Stereographic(double latt, double lont, double scale, double false_easting, double false_northing, double radius) {
 super("Stereographic", false);
 this.latt = Math.toRadians(latt);
 this.lont = Math.toRadians(lont);
 this.earthRadius = radius;
 this.scale = scale * earthRadius;
 this.falseEasting = false_easting;
 this.falseNorthing = false_northing;
 precalculate();
 addParameter(CF.GRID_MAPPING_NAME, CF.STEREOGRAPHIC);
 addParameter(CF.LONGITUDE_OF_PROJECTION_ORIGIN, lont);
 addParameter(CF.LATITUDE_OF_PROJECTION_ORIGIN, latt);
 addParameter(CF.SCALE_FACTOR_AT_PROJECTION_ORIGIN, scale);
 addParameter(CF.EARTH_RADIUS, earthRadius * 1000);
 if ((false_easting != 0.0) || (false_northing != 0.0)) {
  addParameter(CF.FALSE_EASTING, false_easting);
  addParameter(CF.FALSE_NORTHING, false_northing);
  addParameter(CDM.UNITS, "km");
 }
}
origin: edu.ucar/cdm

/**
 * @deprecated
 */
public void setTangentLon(double lont) {
 this.lont = Math.toRadians(lont);
 precalculate();
}
ucar.unidata.geoloc.projectionStereographic

Javadoc

Stereographic projection, spherical earth. Projection plane is a plane tangent to the earth at latt, lont. see John Snyder, Map Projections used by the USGS, Bulletin 1532, 2nd edition (1983), p 153

Most used methods

  • <init>
    Construct a polar Stereographic Projection, from the "natural origin" and the tangent point, calcula
  • addParameter
  • getFalseEasting
    Get the false easting, in km.
  • getFalseNorthing
    Get the false northing, in km.
  • getScale
    Get the scale
  • getScaleFactor
    Calculate polar stereographic scale factor based on the natural latitude and longitude of the origin
  • getTangentLat
    Get the tangent latitude
  • getTangentLon
    Get the tangent longitude
  • precalculate
    precalculate some stuff
  • getEarthRadius
  • latLonToProj
    Convert lat/lon coordinates to projection coordinates.
  • setTangentLon
    Set the tangent longitude
  • latLonToProj,
  • setTangentLon,
  • toString,
  • constructCopy,
  • equals

Popular in Java

  • Finding current android device location
  • addToBackStack (FragmentTransaction)
  • getSharedPreferences (Context)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • BufferedInputStream (java.io)
    Wraps an existing InputStream and buffers the input. Expensive interaction with the underlying input
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
  • Collectors (java.util.stream)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now