260 likes | 414 Views
Managing WMS and WCS on multidimensional NetCDF Datasets with Geoserver. Martin Desruisseaux, Geomatys Mickael Treguer, Ifremer. Fisheries and aquaculture. Ocean floors. Ocean physics. Ifremer.
E N D
Managing WMS and WCS on multidimensional NetCDF Datasets with Geoserver • Martin Desruisseaux, Geomatys • Mickael Treguer, Ifremer
Fisheries and aquaculture Ocean floors Ocean physics Ifremer • National institute of marine research, the French public institute for marine research, Ifremer contributes, through studies and expert assessments, to knowledge about the ocean and its resources, monitoring of marine and coastal zones and the sustainable development of maritime activities.To these ends, it designs and operates observational, experimental and monitoring tools and facilities. Ifremer manages the ocean research fleet for the French scientific community.
Example of gridded datasets • Physical Oceonography • Temperature and Salinity • Sea Surface Temperature • Current • Wave • … • Biological Oceanography • Ocean color (chlorophyll) • Digital Elevation Model (DEM) • …
NetCDF (Common Data Form) • Binary format suitable for lots of different data types • portable self-describing binary data format. • NetCDF is used extensively in the atmospheric and oceanic science communities. • Climate and Forecast conventions should be applied to environmental data if possible • for correct labelling of axes (latitude, longitude, time, pressure, etc) • for standard naming of variables (sea_water_potential_temperature etc) • Can also be dissiminated via the protocol OPeNDAP • you access data using a URL • Allow GIS clients to access NetCDF/OPeNDAP datasets via standards-based interface (WMS, WCS)
4-D web mapping • A number of mapping systems are now available on the web • Most mapping software assumes two-dimensional data (x-y) • Environmental science data is dynamic and four-dimensional (x-y-z-t) • OGC WMS/WCS support 4(plus)-D data (elevation, time) • But not many servers or clients support the full specification
OGC NetCDF architecture Client Application (Mapbuilder) GeoServer / GeoTools WMS WCS NetCDF Interface (Unidata) OpenDAP netCDF files
SeaGrid • “SeaGrid” website provides very quick visualisations of gridded data • Images generated dynamically on the server
Selection of depth <Layer queryable="1"> <Name>geom:coriolis</Name> ... <Dimension name="elevation" units="EPSG:5030"/> <Extent name="elevation" default="5">5,10,20, ... ,1850,1900,1950</Extent> ... </Layer> depth levels available on the data
Selection of time time available on the data animation <Layer queryable="1"> <Name>geom:coriolis</Name> ... <Dimension name="time" units="ISO8601"/> <Extent name="time" default=" 2007-06-20T14:00:00Z ">2007-06-06T14:00:00Z,2007-06-13T14:00:00Z,2007-06-20T14:00:00Z</Extent> ... </Layer>
WCS Draw a bbox to extract raw raster data GetCoverage WCS specification
Future enhancements • It is planned to improve : • Extraction WCS • Official supported format : GeoTiff, HDF-EOS, DTED, NITF, GML • Add Netcdf output (convention CF) • It is planned to provide : • Access to opendap (distributed datasets) • WMS GetFeatureInfo to retreive geophysical data • Display wind/current fields as vectors (directions and intensities)
Past work • In GeoTools • Wrote initial referencing module • Wrote initial coverage module • Strong focus on geophysics data • Some processing capabilities • No raster input/output • On SourceForge • Created SeaGIS in 2002 • Raster input/output performed there, requiring database • Initially designed for a specific problematic (fisheries...) • Running since 2002, trying to generalize since that time
Topics • PostGrid as a coverage catalog • Geographic Image I/O
Coverage catalog • « PostGrid » is a schema in a PostGIS database • Contains coverage metadata, not pixel values • Used as an index for fast coverage lookup • Which data are available (what, where, when…) • How to get the data (filename, format…) • What the pixel values means (categories…) Images stay files in their native format (NetCDF, PNG…)
Current PostGrid scope • Envelope up to 4 dimensions (x,y,z,t) • Mandatory horizontal (x,y) • The SRID must be supported by PostGIS • The « grid to CRS » transform must be affine • Optional vertical (z) • SRID must be provided, but doesn't need to be supported • Ordinates as an array of values • Optional temporal (t) • Set of time ranges Horizontal slices in arbitrary files for different (z,t)
Current PostGrid scope • Envelope up to 4 dimensions (x,y,z,t) • Mandatory horizontal (x,y) • The SRID must be supported by PostGIS • The « grid to CRS » transform must be affine
Affine transform versus envelope • Can compute one from the other... • grid range • affine transform • envelope • coordinate reference system ... but envelopes are ambiguous! • Do we reverse y axis direction? • Do we swap axes (x,y) → (y,x)? • What about oblique grids? Always specify Transform rather than Envelope when possible ...but envelopes are still valuable for indexing!
Database schema overview Series GridCoverages GridGeometries 1 ∞ ∞ 1 • identifier • layer • path • format • series • filename • startTime • endTime • extent • identifier • width, height • scaleX, scaleY, ... • horizontalSRID • horizontalExtent • verticalSRID • verticalOrdinates ∞ • An indexed geometry column • Always in WGS84 (not image CRS) • Automatically generated by trigger 1 1 ∞ 1 ∞ Formats SampleDimensions Categories
Categories • Tell what the pixel values means • Convert to and fromgeophysics values • They are not styling • Required even if the data are already geophysics • Relationship to pixel values is typically fixed for a data set • What this NaN value is? (clouds, land...) Pixel values ↔ Geophysics values 0 = no data ↔ NaN0 1 = clouds ↔ NaN1 2 = land ↔ NaN2 3 .. 255 = temperature ↔ -3 .. 40°C
PostGrid library GeoServer PostGrid Image I/O PostGrid GeoServer
Evaluation at a direct position Data Operation Interpolations Spatial (bicubic) Temporal (linear) Finalvalue
Geographic Image I/O GeoServer PostGrid Coverage I/O Grid Coverage Geographic Image I/O Geographic Image Metadata GML in JPEG2000 NETCDF Rendered Image Image I/O
ImageReader specializations ImageReader GeographicImageReader • Convenience class only; ignore if you want • Creates IndexColorModel from (min,max) and data type FileImageReader • Support for implementations that can't read a stream NetcdfImageReader • 3th dimension (often z) as bands, but doesn't have to
Geographic Image Metadata • Subclass of IIOMetadataFormat • Almost the only committed API