@Override protected Mercator createProjection(final ParameterValueGroup p) { if (p == null) return new Mercator(); return new Mercator(value(p, CF.LONGITUDE_OF_PROJECTION_ORIGIN), value(p, CF.STANDARD_PARALLEL), value(p, CF.FALSE_EASTING) / KILOMETRE, value(p, CF.FALSE_NORTHING) / KILOMETRE, earthRadius(p) / KILOMETRE); } }
private CoordinateTransform makeEquitorialMercatorProjection(NetcdfDataset ds) { double lon0 = findAttributeDouble(ds, "XCENT"); double par = findAttributeDouble(ds, "P_ALP"); Mercator p = new Mercator(lon0, par, 0.0, 0.0, earthRadius); return new ProjectionCT("EquitorialMercator", "FGDC", p); }
private CoordinateTransform makeEquitorialMercatorProjection(NetcdfDataset ds) { double lon0 = findAttributeDouble(ds, "XCENT"); double par = findAttributeDouble(ds, "P_ALP"); Mercator p = new Mercator(lon0, par, 0.0, 0.0, earthRadius); return new ProjectionCT("EquitorialMercator", "FGDC", p); }
private CoordinateTransform makeEquitorialMercatorProjection(NetcdfDataset ds) { double lon0 = findAttributeDouble(ds, "XCENT"); double par = findAttributeDouble(ds, "P_ALP"); Mercator p = new Mercator(lon0, par, 0.0, 0.0, earthRadius); return new ProjectionCT("EquitorialMercator", "FGDC", p); }
@Override public ProjectionCT makeCoordinateTransform(AttributeContainer ctv, String geoCoordinateUnits) { double par = readAttributeDouble( ctv, CF.STANDARD_PARALLEL, Double.NaN); if (Double.isNaN(par)) { double scale = readAttributeDouble( ctv, CF.SCALE_FACTOR_AT_PROJECTION_ORIGIN, Double.NaN); if (Double.isNaN(scale)) throw new IllegalArgumentException("Mercator projection must have attribute " + CF.STANDARD_PARALLEL + " or " + CF.SCALE_FACTOR_AT_PROJECTION_ORIGIN); par = ucar.unidata.geoloc.projection.Mercator.convertScaleToStandardParallel(scale); } readStandardParams(ctv, geoCoordinateUnits); ucar.unidata.geoloc.projection.Mercator proj = new ucar.unidata.geoloc.projection.Mercator( lon0, par, false_easting, false_northing, earth_radius); return new ProjectionCT(ctv.getName(), "FGDC", proj); } }
/** * copy constructor - avoid clone !! */ public ProjectionImpl constructCopy() { return new Mercator(getOriginLon(), getParallel(), getFalseEasting(), getFalseNorthing()); }
public CoordinateTransform makeCoordinateTransform(NetcdfDataset ds, Variable ctv) { double par = readAttributeDouble( ctv, CF.STANDARD_PARALLEL, Double.NaN); if (Double.isNaN(par)) { double scale = readAttributeDouble( ctv, CF.SCALE_FACTOR_AT_PROJECTION_ORIGIN, Double.NaN); if (Double.isNaN(scale)) throw new IllegalArgumentException("Mercator projection must have attribute "+CF.STANDARD_PARALLEL+" or "+ CF.SCALE_FACTOR_AT_PROJECTION_ORIGIN); par = ucar.unidata.geoloc.projection.Mercator.convertScaleToStandardParallel(scale); } double lon0 = readAttributeDouble( ctv, CF.LONGITUDE_OF_PROJECTION_ORIGIN, Double.NaN); double lat0 = readAttributeDouble( ctv, CF.LATITUDE_OF_PROJECTION_ORIGIN, Double.NaN); // LOOK not used double false_easting = readAttributeDouble(ctv, CF.FALSE_EASTING, 0.0); double false_northing = readAttributeDouble(ctv, CF.FALSE_NORTHING, 0.0); double earth_radius = getEarthRadiusInKm(ctv); if ((false_easting != 0.0) || (false_northing != 0.0)) { double scalef = getFalseEastingScaleFactor(ds, ctv); false_easting *= scalef; false_northing *= scalef; } ucar.unidata.geoloc.projection.Mercator proj = new ucar.unidata.geoloc.projection.Mercator( lon0, par, false_easting, false_northing, earth_radius); return new ProjectionCT(ctv.getShortName(), "FGDC", proj); } }
@Override public CoordinateTransform makeCoordinateTransform(NetcdfDataset ds, Variable ctv) { double par = readAttributeDouble( ctv, CF.STANDARD_PARALLEL, Double.NaN); if (Double.isNaN(par)) { double scale = readAttributeDouble( ctv, CF.SCALE_FACTOR_AT_PROJECTION_ORIGIN, Double.NaN); if (Double.isNaN(scale)) throw new IllegalArgumentException("Mercator projection must have attribute " + CF.STANDARD_PARALLEL + " or " + CF.SCALE_FACTOR_AT_PROJECTION_ORIGIN); par = ucar.unidata.geoloc.projection.Mercator.convertScaleToStandardParallel(scale); } double lon0 = readAttributeDouble( ctv, CF.LONGITUDE_OF_PROJECTION_ORIGIN, Double.NaN); double lat0 = readAttributeDouble( ctv, CF.LATITUDE_OF_PROJECTION_ORIGIN, Double.NaN); // LOOK not used double false_easting = readAttributeDouble(ctv, CF.FALSE_EASTING, 0.0); double false_northing = readAttributeDouble(ctv, CF.FALSE_NORTHING, 0.0); double earth_radius = getEarthRadiusInKm(ctv); if ((false_easting != 0.0) || (false_northing != 0.0)) { double scalef = getFalseEastingScaleFactor(ds, ctv); false_easting *= scalef; false_northing *= scalef; } ucar.unidata.geoloc.projection.Mercator proj = new ucar.unidata.geoloc.projection.Mercator( lon0, par, false_easting, false_northing, earth_radius); return new ProjectionCT(ctv.getShortName(), "FGDC", proj); } }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new Mercator(getOriginLon(), getParallel(), getFalseEasting(), getFalseNorthing(), getEarthRadius()); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new Mercator(getOriginLon(), getParallel(), getFalseEasting(), getFalseNorthing(), getEarthRadius()); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
@Override public ProjectionImpl constructCopy() { ProjectionImpl result = new Mercator(getOriginLon(), getParallel(), getFalseEasting(), getFalseNorthing(), getEarthRadius()); result.setDefaultMapArea(defaultMapArea); result.setName(name); return result; }
proj = new Mercator(Lo1, Latin);
public GdsHorizCoordSys makeHorizCoordSys() { // put longitude origin at first point - doesnt actually matter // param par standard parallel (degrees). cylinder cuts earth at this latitude. Earth earth = getEarth(); ucar.unidata.geoloc.projection.Mercator proj = new ucar.unidata.geoloc.projection.Mercator(lo1, lad, 0, 0, earth.getEquatorRadius() * .001); // find out where things start ProjectionPoint startP = proj.latLonToProj(new LatLonPointImpl(la1, lo1)); double startx = startP.getX(); double starty = startP.getY(); return new GdsHorizCoordSys(getNameShort(), template, getOctet4(7), scanMode, proj, startx, dX, starty, dY, getNxRaw(), getNyRaw(), getNptsInLine()); }
public GdsHorizCoordSys makeHorizCoordSys() { // put longitude origin at first point - doesnt actually matter // param par standard parallel (degrees). cylinder cuts earth at this latitude. // LOOK dont have an elipsoidal Mercator projection Earth earth = getEarth(); ucar.unidata.geoloc.projection.Mercator proj = new ucar.unidata.geoloc.projection.Mercator(lo1, latin, 0, 0, earth.getEquatorRadius() * .001); // find out where things start ProjectionPoint startP = proj.latLonToProj(new LatLonPointImpl(la1, lo1)); double startx = startP.getX(); double starty = startP.getY(); return new GdsHorizCoordSys(getNameShort(), template, 0, scanMode, proj, startx, getDx(), starty, getDy(), getNx(), getNy(), null); }
double lat0 = srp.getParameter("Latitude_Of_Origin"); double lon0 = srp.getParameter("Central_Meridian"); proj = new Mercator(lon0, lat0, falseEasting, falseNorthing);
Mercator proj = new Mercator( lonDxDy, latDxDy);
Mercator proj = new Mercator( lonDxDy, latDxDy);
Mercator proj = new Mercator( lonDxDy, latDxDy);
break; case EQMGRD3: p = new Mercator( p_gam, p_alp ); break; case TRMGRD3: