public ProfileFeatureImpl( String name, double lat, double lon, double time, int npts) { super(name); this.latlonPoint = new LatLonPointImpl(lat,lon); this.time = time; this.npts = npts; }
public ProfileFeatureImpl( String name, DateUnit timeUnit, String altUnits, double lat, double lon, double time, int npts) { super(name, timeUnit, altUnits); this.latlonPoint = new LatLonPointImpl(lat,lon); this.time = time; this.npts = npts; }
public ProfileFeatureImpl( String name, CalendarDateUnit timeUnit, String altUnits, double lat, double lon, double time, int nfeatures) { super(name, timeUnit, altUnits); this.latlonPoint = new LatLonPointImpl(lat,lon); this.time = time; if (nfeatures >= 0) { getInfo(); // create the object info.nfeatures = nfeatures; } }
/** * Convert projection coordinates to a LatLonPoint * Note: a new object is now created on each call for the return value, as of 4.0.46 * * @param ppt convert from these projection coordinates * @return LatLonPoint convert to these lat/lon coordinates */ public LatLonPoint projToLatLon(ProjectionPoint ppt) { return projToLatLon(ppt, new LatLonPointImpl()); }
/** * Convert a LatLonPoint to projection coordinates * Note: a new object is now created on each call for the return value, as of 4.0.46 * * @param lat latitude of point to convert * @param lon longitude of point to convert * @return ProjectionPointImpl convert to these projection coordinates */ public ProjectionPoint latLonToProj(double lat, double lon) { return latLonToProj(new LatLonPointImpl(lat, lon)); }
protected void setBoundingBox() { Attribute lon_range = netcdfDataset.findGlobalAttribute("lon_range"); double lon_start = lon_range.getNumericValue(0).doubleValue(); double lon_end = lon_range.getNumericValue(1).doubleValue(); Attribute lat_range = netcdfDataset.findGlobalAttribute("lat_range"); double lat_start = lat_range.getNumericValue(0).doubleValue(); double lat_end = lat_range.getNumericValue(1).doubleValue(); boundingBox = new LatLonRect(new LatLonPointImpl(lat_start, lon_start), new LatLonPointImpl(lat_end, lon_end)); }
static private void doOne(ProjectionImpl proj, double lat, double lon) { LatLonPointImpl startL = new LatLonPointImpl(lat, lon); ProjectionPoint p = proj.latLonToProj(startL); LatLonPointImpl endL = (LatLonPointImpl) proj.projToLatLon(p); System.out.println("start = " + startL.toString(8)); System.out.println("xy = " + p.toString()); System.out.println("end = " + endL.toString(8)); }
static private void doOne(ProjectionImpl proj, double lat, double lon) { LatLonPointImpl startL = new LatLonPointImpl(lat, lon); ProjectionPoint p = proj.latLonToProj(startL); LatLonPointImpl endL = (LatLonPointImpl) proj.projToLatLon(p); System.out.println("start = " + startL.toString(8)); System.out.println("xy = " + p.toString()); System.out.println("end = " + endL.toString(8)); }
public LatLonPoint getLatLon() { if (llpt == null) llpt = new LatLonPointImpl(location.getLatitude(), location.getLongitude()); return llpt; }
/** * Get the upper left corner of the bounding box. * * @return upper left corner of the bounding box */ public LatLonPointImpl getUpperLeftPoint() { return new LatLonPointImpl(upperRight.getLatitude(), lowerLeft.getLongitude()); }
protected void setBoundingBox() { LatLonRect bb; if (origin == null) return; double dLat = Math.toDegrees( getMaximumRadialDist() / Earth.getRadius()); double latRadians = Math.toRadians( origin.getLatitude()); double dLon = dLat * Math.cos(latRadians); double lat1 = origin.getLatitude() - dLat/2; double lon1 = origin.getLongitude() - dLon/2; bb = new LatLonRect( new LatLonPointImpl( lat1, lon1), dLat, dLon); boundingBox = bb; }
public List<Station> getStations(LatLonRect boundingBox) throws IOException { if (boundingBox == null) return stations; LatLonPointImpl latlonPt = new LatLonPointImpl(); List<Station> result = new ArrayList<Station>(); for (Station s : stations) { latlonPt.set(s.getLatitude(), s.getLongitude()); if (boundingBox.contains(latlonPt)) result.add(s); } return result; }
static public LatLonRect getBoundingBox(NetcdfDataset ds) { double lat_max = getAttAsDouble( ds, "geospatial_lat_max"); double lat_min = getAttAsDouble( ds, "geospatial_lat_min"); double lon_max = getAttAsDouble( ds, "geospatial_lon_max"); double lon_min = getAttAsDouble( ds, "geospatial_lon_min"); return new LatLonRect(new LatLonPointImpl(lat_min, lon_min), lat_max-lat_min, lon_max-lon_min); }
static public LatLonRect getBoundingBox(NetcdfDataset ds) { double lat_max = getAttAsDouble( ds, "geospatial_lat_max"); double lat_min = getAttAsDouble( ds, "geospatial_lat_min"); double lon_max = getAttAsDouble( ds, "geospatial_lon_max"); double lon_min = getAttAsDouble( ds, "geospatial_lon_min"); return new LatLonRect(new LatLonPointImpl(lat_min, lon_min), lat_max-lat_min, lon_max-lon_min); }
static public LatLonRect getBoundingBox(NetcdfDataset ds) { double lat_max = getAttAsDouble( ds, "geospatial_lat_max"); double lat_min = getAttAsDouble( ds, "geospatial_lat_min"); double lon_max = getAttAsDouble( ds, "geospatial_lon_max"); double lon_min = getAttAsDouble( ds, "geospatial_lon_min"); return new LatLonRect(new LatLonPointImpl(lat_min, lon_min), lat_max-lat_min, lon_max-lon_min); }
public List<Station> getStations(LatLonRect boundingBox) throws IOException { if (boundingBox == null) return getStations(); LatLonPointImpl latlonPt = new LatLonPointImpl(); List<Station> result = new ArrayList<>(); for (StationFeature s : stations) { latlonPt.set(s.getLatitude(), s.getLongitude()); if (boundingBox.contains(latlonPt)) result.add(s); } return result; }
private LatLonRect getBoundingBox(List stnList) { ucar.unidata.geoloc.Station s = (ucar.unidata.geoloc.Station) stnList.get(0); LatLonPointImpl llpt = new LatLonPointImpl(); llpt.set(s.getLatitude(), s.getLongitude()); LatLonRect rect = new LatLonRect(llpt, .001, .001); for (int i = 1; i < stnList.size(); i++) { s = (ucar.unidata.geoloc.Station) stnList.get(i); llpt.set(s.getLatitude(), s.getLongitude()); rect.extend(llpt); } return rect; }
public LatLonPoint getLocation(StructureData sdata) { StructureMembers members = sdata.getStructureMembers(); double lat = sdata.convertScalarDouble( members.findMember( latVName)); double lon = sdata.convertScalarDouble( members.findMember(lonVName)); return new LatLonPointImpl(lat, lon); }
@Test public void testLCseam() { // test seam crossing LambertConformal lc = new LambertConformal(40.0, 180.0, 20.0, 60.0); ProjectionPointImpl p1 = (ProjectionPointImpl) lc.latLonToProj(new LatLonPointImpl(0.0, -1.0), new ProjectionPointImpl()); ProjectionPointImpl p2 = (ProjectionPointImpl) lc.latLonToProj(new LatLonPointImpl(0.0, 1.0), new ProjectionPointImpl()); if (show) { System.out.printf(" p1= x=%f y=%f%n", p1.getX(), p1.getY()); System.out.printf(" p2= x=%f y=%f%n", p2.getX(), p2.getY()); } assert lc.crossSeam(p1, p2); }
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); }