private List<CoordinateAxis> getCoordAxes(ucar.nc2.dt.GridDataset gds) { Set<CoordinateAxis> axesHash = new HashSet<>(); for (ucar.nc2.dt.GridDataset.Gridset gridset : gds.getGridsets()) { GridCoordSystem gcs = gridset.getGeoCoordSystem(); for (CoordinateAxis axe : gcs.getCoordinateAxes()) axesHash.add(axe); } List<CoordinateAxis> list = Arrays.asList((CoordinateAxis[]) axesHash.toArray( new CoordinateAxis[ axesHash.size()])); Collections.sort(list); return list; }
private List<CoordinateTransform> getCoordTransforms(ucar.nc2.dt.GridDataset gds) { Set<CoordinateTransform> ctHash = new HashSet<>(); for (ucar.nc2.dt.GridDataset.Gridset gridset : gds.getGridsets()) { GridCoordSystem gcs = gridset.getGeoCoordSystem(); for (CoordinateTransform axe : gcs.getCoordinateTransforms()) ctHash.add(axe); } List<CoordinateTransform> list = Arrays.asList((CoordinateTransform[]) ctHash.toArray( new CoordinateTransform[ ctHash.size()])); Collections.sort(list); return list; }
private List<CoordinateTransform> getCoordTransforms(ucar.nc2.dt.GridDataset gds) { Set<CoordinateTransform> ctHash = new HashSet<CoordinateTransform>(); for (ucar.nc2.dt.GridDataset.Gridset gridset : gds.getGridsets()) { GridCoordSystem gcs = gridset.getGeoCoordSystem(); for (CoordinateTransform axe : gcs.getCoordinateTransforms()) ctHash.add(axe); } List<CoordinateTransform> list = Arrays.asList((CoordinateTransform[]) ctHash.toArray( new CoordinateTransform[ ctHash.size()])); Collections.sort(list); return list; }
private Element genDescCovOpsElement() { // OperationsMetadata/Operation (owcs) @name="DescribeCoverage" Element descCovOpsElem = new Element( "Operation", owcsNS ); descCovOpsElem.setAttribute( "name", Request.Operation.DescribeCoverage.toString() ); // Add DCP/HTTP/GET element with xlink to this server. // OperationsMetadata/Operation/DCP/HTTP/{GET|POST} (owcs) [1..*] // - @type=simple, @xlink:title, @xlink:href descCovOpsElem.addContent( new Element( "DCP", owcsNS ).addContent( new Element( "HTTP", owcsNS ).addContent( new Element( "GET", owcsNS ).setAttribute( "href", serverURI.toString(), xlinkNS ) ) ) ); // Add the "Service", "Version", "AcceptVersions", and "Sections" parameters. // OperationsMetadata/Operation/Parameter (owcs) [0..*] descCovOpsElem.addContent( genParamElement( "service", Collections.singletonList( "WCS" ) ) ); descCovOpsElem.addContent( genParamElement( "version", Collections.singletonList( "1.1.0" ) ) ); List<String> idList = new ArrayList<String>(); for ( GridDataset.Gridset gs : this.dataset.getGridsets() ) { idList.add( gs.getGeoCoordSystem().getName()); } descCovOpsElem.addContent( genParamElement( "Identifier", idList ) ); // No constraints or metadata for this operation. // OperationsMetadata/Operation/Constraint (owcs) [0..*] // OperationsMetadata/Operation/Metadata (ows) [0..*] return descCovOpsElem; }
private Element genGetCovOpsElement() { // OperationsMetadata/Operation (owcs) @name="GetCoverage" Element getCovOpsElem = new Element( "Operation", owcsNS ); getCovOpsElem.setAttribute( "name", Request.Operation.GetCoverage.toString() ); // Add DCP/HTTP/GET element with xlink to this server. // OperationsMetadata/Operation/DCP/HTTP/{GET|POST} (owcs) [1..*] // - @type=simple, @xlink:title, @xlink:href getCovOpsElem.addContent( new Element( "DCP", owcsNS ).addContent( new Element( "HTTP", owcsNS ).addContent( new Element( "GET", owcsNS ).setAttribute( "href", serverURI.toString(), xlinkNS ) ) ) ); // Add the "Service", "Version", "AcceptVersions", and "Sections" parameters. // OperationsMetadata/Operation/Parameter (owcs) [0..*] getCovOpsElem.addContent( genParamElement( "service", Collections.singletonList( "WCS" ) ) ); getCovOpsElem.addContent( genParamElement( "version", Collections.singletonList( "1.1.0" ) ) ); getCovOpsElem.addContent( genParamElement( "store", Collections.singletonList( "False" ) ) ); List<String> idList = new ArrayList<String>(); for ( GridDataset.Gridset gs : this.dataset.getGridsets() ) { idList.add( gs.getGeoCoordSystem().getName() ); } getCovOpsElem.addContent( genParamElement( "Identifier", idList ) ); // No constraints or metadata for this operation. // OperationsMetadata/Operation/Constraint (owcs) [0..*] // OperationsMetadata/Operation/Metadata (ows) [0..*] return getCovOpsElem; }
Request( Operation operation, String negotiatedVersion, String datasetPath, GridDataset dataset) { this.operation = operation; this.negotiatedVersion = negotiatedVersion; this.datasetPath = datasetPath; this.dataset = dataset; this.availableCoverageNames = new ArrayList<String>(); for ( GridDataset.Gridset gs : this.dataset.getGridsets() ) { this.availableCoverageNames.add( gs.getGeoCoordSystem().getName() ); } if ( operation == null ) throw new IllegalArgumentException( "Non-null operation required." ); if ( this.negotiatedVersion == null ) throw new IllegalArgumentException( "Non-null negotiated version required." ); if ( ! this.negotiatedVersion.equals( expectedVersion) ) throw new IllegalArgumentException( "Version <" + negotiatedVersion + "> not as expected <" + expectedVersion + ">." ); if ( this.datasetPath == null ) throw new IllegalArgumentException( "Non-null dataset path required." ); if ( this.dataset == null ) throw new IllegalArgumentException( "Non-null dataset required." ); }
private void makeRanges() { for (ucar.nc2.dt.GridDataset.Gridset gset : getGridsets()) { GridCoordSystem gcs = gset.getGeoCoordSystem(); ProjectionRect bb = gcs.getBoundingBox(); if (projBB == null) projBB = bb; else projBB.add(bb); LatLonRect llbb = gcs.getLatLonBoundingBox(); if (llbbMax == null) llbbMax = llbb; else llbbMax.extend(llbb); CalendarDateRange dateRange = gcs.getCalendarDateRange(); if (dateRange != null) { if (dateRangeMax == null) dateRangeMax = dateRange; else dateRangeMax = dateRangeMax.extend(dateRange); } } }
static public ThreddsMetadata.GeospatialCoverage extractGeospatial(GridDataset gridDataset) { ThreddsMetadata.GeospatialCoverage gc = new ThreddsMetadata.GeospatialCoverage(); LatLonRect llbb = null; CoordinateAxis1D vaxis = null; for(GridDataset.Gridset gridset : gridDataset.getGridsets()) { GridCoordSystem gsys = gridset.getGeoCoordSystem(); if (llbb == null) llbb = gsys.getLatLonBoundingBox(); CoordinateAxis1D vaxis2 = gsys.getVerticalAxis(); if (vaxis == null) vaxis = vaxis2; else if ((vaxis2 != null) && (vaxis2.getSize() > vaxis.getSize())) vaxis = vaxis2; } if (llbb != null) gc.setBoundingBox(llbb); if (vaxis != null) gc.setVertical(vaxis); return gc; }
static public ThreddsMetadata.GeospatialCoverage extractGeospatial(GridDataset gridDataset) { ThreddsMetadata.GeospatialCoverage gc = new ThreddsMetadata.GeospatialCoverage(); LatLonRect llbb = null; CoordinateAxis1D vaxis = null; for(GridDataset.Gridset gridset : gridDataset.getGridsets()) { GridCoordSystem gsys = gridset.getGeoCoordSystem(); if (llbb == null) llbb = gsys.getLatLonBoundingBox(); CoordinateAxis1D vaxis2 = gsys.getVerticalAxis(); if (vaxis == null) vaxis = vaxis2; else if ((vaxis2 != null) && (vaxis2.getSize() > vaxis.getSize())) vaxis = vaxis2; } if (llbb != null) gc.setBoundingBox(llbb); if (vaxis != null) gc.setVertical(vaxis); return gc; }
static public ThreddsMetadata.GeospatialCoverage extractGeospatial(GridDataset gridDataset) { ThreddsMetadata.GeospatialCoverage gc = new ThreddsMetadata.GeospatialCoverage(); LatLonRect llbb = null; CoordinateAxis1D vaxis = null; for(GridDataset.Gridset gridset : gridDataset.getGridsets()) { GridCoordSystem gsys = gridset.getGeoCoordSystem(); if (llbb == null) llbb = gsys.getLatLonBoundingBox(); CoordinateAxis1D vaxis2 = gsys.getVerticalAxis(); if (vaxis == null) vaxis = vaxis2; else if ((vaxis2 != null) && (vaxis2.getSize() > vaxis.getSize())) vaxis = vaxis2; } if (llbb != null) gc.setBoundingBox(llbb); if (vaxis != null) gc.setVertical(vaxis); return gc; }
private void makeRanges() { for (ucar.nc2.dt.GridDataset.Gridset gset : getGridsets()) { GridCoordSystem gcs = gset.getGeoCoordSystem(); LatLonRect llbb = gcs.getLatLonBoundingBox(); if (llbbMax == null) llbbMax = llbb; else llbbMax.extend(llbb); CalendarDateRange dateRange = gcs.getCalendarDateRange(); if (dateRange != null) { if (dateRangeMax == null) dateRangeMax = dateRange; else dateRangeMax.extend(dateRange); } } }
private void makeRanges() { for (ucar.nc2.dt.GridDataset.Gridset gset : getGridsets()) { GridCoordSystem gcs = gset.getGeoCoordSystem(); LatLonRect llbb = gcs.getLatLonBoundingBox(); if (llbbMax == null) llbbMax = llbb; else llbbMax.extend(llbb); CalendarDateRange dateRange = gcs.getCalendarDateRange(); if (dateRange != null) { if (dateRangeMax == null) dateRangeMax = dateRange; else dateRangeMax.extend(dateRange); } } }
public ThreddsMetadata.GeospatialCoverage extractGeospatial(GridDataset gridDataset) { LatLonRect llbb = null; CoordinateAxis1D vaxis = null; for (GridDataset.Gridset gridset : gridDataset.getGridsets()) { GridCoordSystem gsys = gridset.getGeoCoordSystem(); if (llbb == null) llbb = gsys.getLatLonBoundingBox(); CoordinateAxis1D vaxis2 = gsys.getVerticalAxis(); if (vaxis == null) vaxis = vaxis2; else if ((vaxis2 != null) && (vaxis2.getSize() > vaxis.getSize())) vaxis = vaxis2; } return new ThreddsMetadata.GeospatialCoverage(llbb, vaxis, 0.0, 0.0); // LOOK can we extract dx, dy ? }
public WcsDataset( GridDataset dataset, String datasetPath ) { this.datasetPath = datasetPath; int pos = datasetPath.lastIndexOf('/'); this.datasetName = ( pos > 0 ) ? datasetPath.substring( pos + 1 ) : datasetPath; this.dataset = dataset; this.availableCoverages = new HashMap<String, WcsCoverage>(); for ( GridDataset.Gridset curGridset : this.dataset.getGridsets() ) { GridCoordSystem gcs = curGridset.getGeoCoordSystem(); if ( ! gcs.isRegularSpatial() ) continue; this.availableCoverages.put( gcs.getName(), new WcsCoverage( curGridset, this) ); } }
public int compare(GridDataset.Gridset gridset1, GridDataset.Gridset gridset2) { GridCoordSystem cs1 = gridset1.getGeoCoordSystem(); GridCoordSystem cs2 = gridset2.getGeoCoordSystem(); if (cs1.getDomain().size() != cs2.getDomain().size()) return cs1.getDomain().size() - cs2.getDomain().size(); return cs1.getName().compareTo(cs2.getName()); } }
private List<CoordinateAxis> getCoordAxes(ucar.nc2.dt.GridDataset gds) { Set<CoordinateAxis> axesHash = new HashSet<>(); for (ucar.nc2.dt.GridDataset.Gridset gridset : gds.getGridsets()) { GridCoordSystem gcs = gridset.getGeoCoordSystem(); for (CoordinateAxis axe : gcs.getCoordinateAxes()) axesHash.add(axe); } List<CoordinateAxis> list = Arrays.asList((CoordinateAxis[]) axesHash.toArray( new CoordinateAxis[ axesHash.size()])); Collections.sort(list); return list; }
private List<CoordinateTransform> getCoordTransforms(ucar.nc2.dt.GridDataset gds) { Set<CoordinateTransform> ctHash = new HashSet<>(); for (ucar.nc2.dt.GridDataset.Gridset gridset : gds.getGridsets()) { GridCoordSystem gcs = gridset.getGeoCoordSystem(); for (CoordinateTransform axe : gcs.getCoordinateTransforms()) ctHash.add(axe); } List<CoordinateTransform> list = Arrays.asList((CoordinateTransform[]) ctHash.toArray( new CoordinateTransform[ ctHash.size()])); Collections.sort(list); return list; }
public int compare(GridDataset.Gridset gridset1, GridDataset.Gridset gridset2) { GridCoordSystem cs1 = gridset1.getGeoCoordSystem(); GridCoordSystem cs2 = gridset2.getGeoCoordSystem(); if (cs1.getDomain().size() != cs2.getDomain().size()) return cs1.getDomain().size() - cs2.getDomain().size(); return cs1.getName().compareTo(cs2.getName()); } }
private List<CoordinateAxis> getCoordAxes(ucar.nc2.dt.GridDataset gds) { Set<CoordinateAxis> axesHash = new HashSet<CoordinateAxis>(); for (ucar.nc2.dt.GridDataset.Gridset gridset : gds.getGridsets()) { GridCoordSystem gcs = gridset.getGeoCoordSystem(); for (CoordinateAxis axe : gcs.getCoordinateAxes()) axesHash.add(axe); } List<CoordinateAxis> list = Arrays.asList((CoordinateAxis[]) axesHash.toArray( new CoordinateAxis[ axesHash.size()])); Collections.sort(list); return list; }
public int compare(GridDataset.Gridset gridset1, GridDataset.Gridset gridset2) { GridCoordSystem cs1 = gridset1.getGeoCoordSystem(); GridCoordSystem cs2 = gridset2.getGeoCoordSystem(); if (cs1.getDomain().size() != cs2.getDomain().size()) return cs1.getDomain().size() - cs2.getDomain().size(); return cs1.getName().compareTo(cs2.getName()); } }