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); }
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); }
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); }
private ProjectionCT makePSProjection() throws NoSuchElementException { double lov = navInfo.getDouble( "Lov"); double la1 = navInfo.getDouble( "La1"); double lo1 = navInfo.getDouble( "Lo1"); // Why the scale factor?. accordining to GRID 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 Stereographic ps = new Stereographic(90.0, lov, .933); // we have to project in order to find the origin ProjectionPointImpl start = (ProjectionPointImpl) ps.latLonToProj( new LatLonPointImpl( la1, lo1)); if (debug) System.out.println("start at proj coord "+start); startx = start.getX(); starty = start.getY(); nx = navInfo.getInt( "Nx"); ny = navInfo.getInt( "Ny"); dx = navInfo.getDouble( "Dx")/1000.0; dy = navInfo.getDouble( "Dy")/1000.0; return new ProjectionCT(grid_name, "FGDC", ps); }
private ProjectionCT makePSProjection() throws NoSuchElementException { double lov = navInfo.getDouble( "Lov"); double la1 = navInfo.getDouble( "La1"); double lo1 = navInfo.getDouble( "Lo1"); // Why the scale factor?. accordining to GRID 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 Stereographic ps = new Stereographic(90.0, lov, .933); // we have to project in order to find the origin ProjectionPointImpl start = (ProjectionPointImpl) ps.latLonToProj( new LatLonPointImpl( la1, lo1)); if (debug) System.out.println("start at proj coord "+start); startx = start.getX(); starty = start.getY(); nx = navInfo.getInt( "Nx"); ny = navInfo.getInt( "Ny"); dx = navInfo.getDouble( "Dx")/1000.0; dy = navInfo.getDouble( "Dy")/1000.0; return new ProjectionCT(grid_name, "FGDC", ps); }
private ProjectionCT makePSProjection() throws NoSuchElementException { double lov = navInfo.getDouble( "Lov"); double la1 = navInfo.getDouble( "La1"); double lo1 = navInfo.getDouble( "Lo1"); // Why the scale factor?. accordining to GRID 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 Stereographic ps = new Stereographic(90.0, lov, .933); // we have to project in order to find the origin ProjectionPointImpl start = (ProjectionPointImpl) ps.latLonToProj( new LatLonPointImpl( la1, lo1)); if (debug) System.out.println("start at proj coord "+start); startx = start.getX(); starty = start.getY(); nx = navInfo.getInt( "Nx"); ny = navInfo.getInt( "Ny"); dx = navInfo.getDouble( "Dx")/1000.0; dy = navInfo.getDouble( "Dy")/1000.0; return new ProjectionCT(grid_name, "FGDC", ps); }