@Override public CoordinateAxis2D getLatAxis() { return (CoordinateAxis2D) cs.getLatAxis(); }
@Override public CoordinateAxis2D getLatAxis() { return (CoordinateAxis2D) cs.getLatAxis(); }
CoordinateAxis axis = georeferencing.isLonLat() ? cs.getLatAxis() : cs.getYaxis(); boolean flipYAxis = needFlipYAxis(axis);
public double readLatitudeCoord(Variable fromVar, int[] index) throws IOException, InvalidRangeException { CoordinateAxis axis = cs.getLatAxis(); if (null == axis) throw new IllegalArgumentException("There is no latitude coordinate"); return readValue( axis, fromVar, index); }
public double readLatitudeCoord(Variable fromVar, int[] index) throws IOException, InvalidRangeException { CoordinateAxis axis = cs.getLatAxis(); if (null == axis) throw new IllegalArgumentException("There is no latitude coordinate"); return readValue( axis, fromVar, index); }
@Override public CoordinateAxis getYHorizAxis() { return cs.isLatLon() ? cs.getLatAxis() : cs.getYaxis(); }
@Override public CoordinateAxis getYHorizAxis() { return cs.isLatLon() ? cs.getLatAxis() : cs.getYaxis(); }
static private boolean isGrid(java.util.List<CoordinateSystem> csysList) { CoordinateSystem use = null; for (CoordinateSystem csys : csysList) { if (use == null) use = csys; else if (csys.getCoordinateAxes().size() > use.getCoordinateAxes().size()) use = csys; } if (use == null) return false; CoordinateAxis lat = use.getLatAxis(); CoordinateAxis lon = use.getLonAxis(); if ((lat != null) && (lat.getSize() <= 1)) return false; // COARDS singletons if ((lon != null) && (lon.getSize() <= 1)) return false; // hueristics - cant say i like this, multidim point features could easily violate return (use.getRankDomain() > 2) && (use.getRankDomain() <= use.getRankRange()); }
static private boolean isGrid(java.util.List<CoordinateSystem> csysList) { CoordinateSystem use = null; for (CoordinateSystem csys : csysList) { if (use == null) use = csys; else if (csys.getCoordinateAxes().size() > use.getCoordinateAxes().size()) use = csys; } if (use == null) return false; CoordinateAxis lat = use.getLatAxis(); CoordinateAxis lon = use.getLonAxis(); if ((lat != null) && (lat.getSize() <= 1)) return false; // COARDS singletons if ((lon != null) && (lon.getSize() <= 1)) return false; // hueristics - cant say i like this, multidim point features could easily violate return (use.getRankDomain() > 2) && (use.getRankDomain() <= use.getRankRange()); }
public static Document genCoordRefSysAsGML( ucar.nc2.dataset.CoordinateSystem coordSys ) { if ( coordSys == null ) throw new IllegalArgumentException( "CoordinateSystem must be non-null."); if ( ! coordSys.isGeoReferencing()) throw new IllegalArgumentException( "CoordinateSystem must be a georeferencing CS."); /*Element xyCrsElem; if ( coordSys.isGeoXY()) { xyCrsElem = genProjectedCRS( coordSys.getProjection()); } */ if ( !coordSys.isGeoXY()) { coordSys.getLatAxis(); coordSys.getLonAxis(); } Element rootElem = new Element( "CompoundCRS", gmlNS ); rootElem.addContent( "" ); rootElem.addNamespaceDeclaration( gmlNS ); rootElem.addNamespaceDeclaration( xlinkNS ); // rootElem.setAttribute( "version", this.getVersion() ); return new Document( rootElem ); }
private boolean isSwath(java.util.List<CoordinateSystem> csysList) { CoordinateSystem use = null; for (CoordinateSystem csys : csysList) { if (use == null) use = csys; else if (csys.getCoordinateAxes().size() > use.getCoordinateAxes().size()) use = csys; } if (use == null) return false; CoordinateAxis lat = use.getLatAxis(); CoordinateAxis lon = use.getLonAxis(); CoordinateAxis time = use.getTaxis(); if ((lat == null) || (lat.getRank() != 2)) return false; if ((lon == null) || (lon.getRank() != 2)) return false; if ((time == null)) return false; // must have time - otherwise it can be a grid // lat/lon must have the same dimensions if (!lat.getDimension(0).equals(lon.getDimension(0))) return false; if (!lat.getDimension(1).equals(lon.getDimension(1))) return false; Set<Dimension> dims = new HashSet<Dimension>(10); for (Dimension d : lat.getDimensions()) dims.add(d); for (Dimension d : lon.getDimensions()) dims.add(d); // diff with grid - time dimension(s) are a subset of lat/lon dimensions for (Dimension d : time.getDimensions()) { if (!dims.contains(d)) return false; } return true; }
private boolean isSwath(java.util.List<CoordinateSystem> csysList) { CoordinateSystem use = null; for (CoordinateSystem csys : csysList) { if (use == null) use = csys; else if (csys.getCoordinateAxes().size() > use.getCoordinateAxes().size()) use = csys; } if (use == null) return false; CoordinateAxis lat = use.getLatAxis(); CoordinateAxis lon = use.getLonAxis(); CoordinateAxis time = use.getTaxis(); if ((lat == null) || (lat.getRank() != 2)) return false; if ((lon == null) || (lon.getRank() != 2)) return false; if ((time == null)) return false; // must have time - otherwise it can be a grid // lat/lon must have the same dimensions if (!lat.getDimension(0).equals(lon.getDimension(0))) return false; if (!lat.getDimension(1).equals(lon.getDimension(1))) return false; Set<Dimension> dims = new HashSet<Dimension>(10); for (Dimension d : lat.getDimensions()) dims.add(d); for (Dimension d : lon.getDimensions()) dims.add(d); // diff with grid - time dimension(s) are a subset of lat/lon dimensions for (Dimension d : time.getDimensions()) { if (!dims.contains(d)) return false; } return true; }
public static Document genCoordRefSysAsGML( ucar.nc2.dataset.CoordinateSystem coordSys ) { if ( coordSys == null ) throw new IllegalArgumentException( "CoordinateSystem must be non-null."); if ( ! coordSys.isGeoReferencing()) throw new IllegalArgumentException( "CoordinateSystem must be a georeferencing CS."); Element xyCrsElem; if ( coordSys.isGeoXY()) { xyCrsElem = genProjectedCRS( coordSys.getProjection()); } else { coordSys.getLatAxis(); coordSys.getLonAxis(); } Element rootElem = new Element( "CompoundCRS", gmlNS ); rootElem.addContent( "" ); rootElem.addNamespaceDeclaration( gmlNS ); rootElem.addNamespaceDeclaration( xlinkNS ); // rootElem.setAttribute( "version", this.getVersion() ); return new Document( rootElem ); }
yaxis = cs.getLatAxis();
horizYaxis = latAxis = cs.getLatAxis(); isLatLon = true;
horizYaxis = latAxis = cs.getLatAxis(); isLatLon = true;
horizYaxis = latAxis = cs.getLatAxis(); isLatLon = true;
yaxis = cs.getLatAxis();
yaxis = cs.getLatAxis();
yaxis = cs.getLatAxis(); isLatLon = true;