@Override public ProjectionImpl constructCopy() { return new StereographicAzimuthalProjection(Math.toDegrees(projectionLatitude), Math.toDegrees(projectionLongitude), scaleFactor, Math.toDegrees(trueScaleLatitude), falseEasting, falseNorthing, earth); }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new StereographicAzimuthalProjection(Math.toDegrees(projectionLatitude), Math.toDegrees(projectionLongitude), scaleFactor, Math.toDegrees(trueScaleLatitude), falseEasting, falseNorthing, earth); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new StereographicAzimuthalProjection(Math.toDegrees(projectionLatitude), Math.toDegrees(projectionLongitude), scaleFactor, Math.toDegrees(trueScaleLatitude), falseEasting, falseNorthing, earth); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new StereographicAzimuthalProjection(Math.toDegrees(projectionLatitude), Math.toDegrees(projectionLongitude), scaleFactor, Math.toDegrees(trueScaleLatitude), falseEasting, falseNorthing, earth); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
static public void main(String[] args) { // test-code Earth e = new Earth(6378.137, 0, 298.257224); StereographicAzimuthalProjection proj = new StereographicAzimuthalProjection(90., 0., 0.93306907, 90., 0., 0.,e); double[] lat = {60., 90., 60.}; double[] lon = {0., 0., 10.}; test(proj, lat, lon); proj = new StereographicAzimuthalProjection(90., -45., 0.96985819, 90., 0., 0.,e); test(proj, lat, lon); } }
static public void main(String[] args) { // test-code Earth e = new Earth(6378137., 0, 298.257224); StereographicAzimuthalProjection proj = new StereographicAzimuthalProjection(90., 0., 0.93306907, 90., 0., 0., e); double[] lat = {60., 90., 60.}; double[] lon = {0., 0., 10.}; test(proj, lat, lon); proj = new StereographicAzimuthalProjection(90., -45., 0.96985819, 90., 0., 0., e); test(proj, lat, lon); // southpole proj = new StereographicAzimuthalProjection(-90., 0., -1, -70., 0., 0., e); double[] latS = {-60., -90., -60.}; double[] lonS = {0., 0., 10.}; test(proj, latS, lonS); } }
static public void main(String[] args) { // test-code Earth e = new Earth(6378137., 0, 298.257224); StereographicAzimuthalProjection proj = new StereographicAzimuthalProjection(90., 0., 0.93306907, 90., 0., 0., e); double[] lat = {60., 90., 60.}; double[] lon = {0., 0., 10.}; test(proj, lat, lon); proj = new StereographicAzimuthalProjection(90., -45., 0.96985819, 90., 0., 0., e); test(proj, lat, lon); // southpole proj = new StereographicAzimuthalProjection(-90., 0., -1, -70., 0., 0., e); double[] latS = {-60., -90., -60.}; double[] lonS = {0., 0., 10.}; test(proj, latS, lonS); } }
static public void main(String[] args) { // test-code Earth e = new Earth(6378137., 0, 298.257224); StereographicAzimuthalProjection proj = new StereographicAzimuthalProjection(90., 0., 0.93306907, 90., 0., 0., e); double[] lat = {60., 90., 60.}; double[] lon = {0., 0., 10.}; test(proj, lat, lon); proj = new StereographicAzimuthalProjection(90., -45., 0.96985819, 90., 0., 0., e); test(proj, lat, lon); // southpole proj = new StereographicAzimuthalProjection(-90., 0., -1, -70., 0., 0., e); double[] latS = {-60., -90., -60.}; double[] lonS = {0., 0., 10.}; test(proj, latS, lonS); } }
proj = new ucar.unidata.geoloc.projection.proj4.StereographicAzimuthalProjection(lat0, lon0, scale, latD, false_easting, false_northing, earth); } else { proj = new ucar.unidata.geoloc.projection.Stereographic( lat0, lon0, scale, false_easting, false_northing, earth_radius);
proj = new ucar.unidata.geoloc.projection.proj4.StereographicAzimuthalProjection(lat0, lon0, scale, latD, false_easting, false_northing, earth); } else { proj = new ucar.unidata.geoloc.projection.Stereographic( lat0, lon0, scale, false_easting, false_northing, earth_radius);
proj = new ucar.unidata.geoloc.projection.proj4.StereographicAzimuthalProjection(lat0, lon0, scale, latD, false_easting, false_northing, earth); } else { proj = new ucar.unidata.geoloc.projection.Stereographic( lat0, lon0, scale, false_easting, false_northing, earth_radius);
public GdsHorizCoordSys makeHorizCoordSys() { boolean northPole = (projCenterFlag & 128) == 0; double latOrigin = northPole ? 90.0 : -90.0; // Why the scale factor?. according to GRIB docs: // "Grid lengths are in units of meters, at the 60 degree latitude circle nearest to the pole" // since the scale factor at 60 degrees = k = 2*k0/(1+sin(60)) [Snyder,Working Manual p157] // then to make scale = 1 at 60 degrees, k0 = (1+sin(60))/2 = .933 double scale; if (Double.isNaN(lad)) { // LOOK ?? scale = 0.9330127018922193; } else { scale = (1.0 + Math.sin(Math.toRadians( Math.abs(lad)))) / 2; } ProjectionImpl proj; Earth earth = getEarth(); if (earth.isSpherical()) { proj = new Stereographic(latOrigin, lov, scale); } else { proj = new ucar.unidata.geoloc.projection.proj4.StereographicAzimuthalProjection(latOrigin, lov, scale, lad, 0.0, 0.0, earth); } ProjectionPointImpl start = (ProjectionPointImpl) proj.latLonToProj(new LatLonPointImpl(la1, lo1)); return new GdsHorizCoordSys(getNameShort(), template, 0, scanMode, proj, start.getX(), getDx(), start.getY(), getDy(), getNx(), getNy(), null); }
public GdsHorizCoordSys makeHorizCoordSys() { boolean northPole = (projCenterFlag & 128) == 0; double latOrigin = northPole ? 90.0 : -90.0; // Why the scale factor?. according to GRIB docs: // "Grid lengths are in units of meters, at the 60 degree latitude circle nearest to the pole" // since the scale factor at 60 degrees = k = 2*k0/(1+sin(60)) [Snyder,Working Manual p157] // then to make scale = 1 at 60 degrees, k0 = (1+sin(60))/2 = .933 double scale; if (GribNumbers.isUndefined(lad)) { // LOOK scale = 0.9330127018922193; } else { scale = (1.0 + Math.sin(Math.toRadians(Math.abs(Math.abs(lad))))) / 2; } ProjectionImpl proj; Earth earth = getEarth(); if (earth.isSpherical()) { proj = new Stereographic(latOrigin, lov, scale); } else { proj = new ucar.unidata.geoloc.projection.proj4.StereographicAzimuthalProjection( latOrigin, lov, scale, lad, 0.0, 0.0, earth); } ProjectionPointImpl start = (ProjectionPointImpl) proj.latLonToProj(new LatLonPointImpl(la1, lo1)); return new GdsHorizCoordSys(getNameShort(), template, getOctet4(7), scanMode, proj, start.getX(), dX, start.getY(), dY, getNxRaw(), getNyRaw(), getNptsInLine()); }
public ProjectionCT makeCoordinateTransform(AttributeContainer ctv, String geoCoordinateUnits) { double lon0 = readAttributeDouble( ctv, CF.LONGITUDE_OF_PROJECTION_ORIGIN, Double.NaN); double scale = readAttributeDouble( ctv, CF.SCALE_FACTOR_AT_PROJECTION_ORIGIN, 1.0); double lat0 = readAttributeDouble( ctv, CF.LATITUDE_OF_PROJECTION_ORIGIN, 90.0); double false_easting = readAttributeDouble(ctv, CF.FALSE_EASTING, 0.0); double false_northing = readAttributeDouble(ctv, CF.FALSE_NORTHING, 0.0); if ((false_easting != 0.0) || (false_northing != 0.0)) { double scalef = getFalseEastingScaleFactor(geoCoordinateUnits); // conversion from axis-unit to km false_easting *= scalef; false_northing *= scalef; } double earth_radius = getEarthRadiusInKm(ctv); double semi_major_axis = readAttributeDouble(ctv, CF.SEMI_MAJOR_AXIS, Double.NaN); // meters double semi_minor_axis = readAttributeDouble(ctv, CF.SEMI_MINOR_AXIS, Double.NaN); double inverse_flattening = readAttributeDouble(ctv, CF.INVERSE_FLATTENING, 0.0); ucar.unidata.geoloc.ProjectionImpl proj; // check for ellipsoidal earth if (!Double.isNaN(semi_major_axis) && (!Double.isNaN(semi_minor_axis) || inverse_flattening != 0.0)) { Earth earth = new Earth(semi_major_axis, semi_minor_axis, inverse_flattening); proj = new ucar.unidata.geoloc.projection.proj4.StereographicAzimuthalProjection(lat0, lon0, scale, 90., false_easting, false_northing, earth); } else { proj = new ucar.unidata.geoloc.projection.Stereographic( lat0, lon0, scale, false_easting, false_northing, earth_radius); } return new ProjectionCT(ctv.getName(), "FGDC", proj); } }
public CoordinateTransform makeCoordinateTransform(NetcdfDataset ds, Variable ctv) { double lon0 = readAttributeDouble( ctv, CF.LONGITUDE_OF_PROJECTION_ORIGIN, Double.NaN); double scale = readAttributeDouble( ctv, CF.SCALE_FACTOR_AT_PROJECTION_ORIGIN, 1.0); double lat0 = readAttributeDouble( ctv, CF.LATITUDE_OF_PROJECTION_ORIGIN, 90.0); double false_easting = readAttributeDouble(ctv, CF.FALSE_EASTING, 0.0); double false_northing = readAttributeDouble(ctv, CF.FALSE_NORTHING, 0.0); if ((false_easting != 0.0) || (false_northing != 0.0)) { double scalef = getFalseEastingScaleFactor(ds, ctv); // conversion from axis-unit to km false_easting *= scalef; false_northing *= scalef; } double earth_radius = getEarthRadiusInKm(ctv); double semi_major_axis = readAttributeDouble(ctv, CF.SEMI_MAJOR_AXIS, Double.NaN); // meters double semi_minor_axis = readAttributeDouble(ctv, CF.SEMI_MINOR_AXIS, Double.NaN); double inverse_flattening = readAttributeDouble(ctv, CF.INVERSE_FLATTENING, 0.0); ucar.unidata.geoloc.ProjectionImpl proj; // check for ellipsoidal earth if (!Double.isNaN(semi_major_axis) && (!Double.isNaN(semi_minor_axis) || inverse_flattening != 0.0)) { Earth earth = new Earth(semi_major_axis, semi_minor_axis, inverse_flattening); proj = new ucar.unidata.geoloc.projection.proj4.StereographicAzimuthalProjection(lat0, lon0, scale, 90., false_easting, false_northing, earth); } else { proj = new ucar.unidata.geoloc.projection.Stereographic( lat0, lon0, scale, false_easting, false_northing, earth_radius); } return new ProjectionCT(ctv.getShortName(), "FGDC", proj); } }
public CoordinateTransform makeCoordinateTransform(NetcdfDataset ds, Variable ctv) { double lon0 = readAttributeDouble( ctv, CF.LONGITUDE_OF_PROJECTION_ORIGIN, Double.NaN); double scale = readAttributeDouble( ctv, CF.SCALE_FACTOR_AT_PROJECTION_ORIGIN, 1.0); double lat0 = readAttributeDouble( ctv, CF.LATITUDE_OF_PROJECTION_ORIGIN, 90.0); double false_easting = readAttributeDouble(ctv, CF.FALSE_EASTING, 0.0); double false_northing = readAttributeDouble(ctv, CF.FALSE_NORTHING, 0.0); if ((false_easting != 0.0) || (false_northing != 0.0)) { double scalef = getFalseEastingScaleFactor(ds, ctv); // conversion from axis-unit to km false_easting *= scalef; false_northing *= scalef; } double earth_radius = getEarthRadiusInKm(ctv); double semi_major_axis = readAttributeDouble(ctv, CF.SEMI_MAJOR_AXIS, Double.NaN); // meters double semi_minor_axis = readAttributeDouble(ctv, CF.SEMI_MINOR_AXIS, Double.NaN); double inverse_flattening = readAttributeDouble(ctv, CF.INVERSE_FLATTENING, 0.0); ucar.unidata.geoloc.ProjectionImpl proj; // check for ellipsoidal earth if (!Double.isNaN(semi_major_axis) && (!Double.isNaN(semi_minor_axis) || inverse_flattening != 0.0)) { Earth earth = new Earth(semi_major_axis, semi_minor_axis, inverse_flattening); proj = new ucar.unidata.geoloc.projection.proj4.StereographicAzimuthalProjection(lat0, lon0, scale, 90., false_easting, false_northing, earth); } else { proj = new ucar.unidata.geoloc.projection.Stereographic( lat0, lon0, scale, false_easting, false_northing, earth_radius); } return new ProjectionCT(ctv.getShortName(), "FGDC", proj); } }