Raster data in GeoServer and GeoTools: achievements, issues and future developments Ing. Andrea Aime GeoSolutions
Founded in Italy in late 2006 Expertise Image Processing, GeoSpatial Data Fusion Java, Java Enterprise, C++, Python JPEG2000, JPIP, Advanced 2D visualization Supporting/Developing FOSS4G projects GeoServer, MapStore GeoNetwork, GeoNode, Ckan Clients Public Agencies Private Companies FOSS4G 2015, Seoul 14 th -19 th September 2015
The technology stack FOSS4G 2015, Seoul 14 th -19 th September 2015
GeoServer raster processing FOSS4G 2015, Seoul 14 th -19 th September 2015 GeoTools ImageIO-Ext GDAL Kakadu WCS JAI-Ext WMS WPS WMTS JAITools JAI-ImageIOJAI
Java Advanced Imaging Huge number of basic building operations Tile-based, deferred execution model Integrate Tile Caching Easily Extensible Natively Accelerated Code available for many operations Supports multithreading Development more or less stopped! FOSS4G 2015, Seoul 14 th -19 th September 2015 Scale Crop Mosaic Clamp Read Cache
JAI-EXT Built on top of JAI interfaces Replaces most common JAI operations Open Source (Apache 2.0) Pure Java and High Performance Support for No-Data Support for Processing ROI Several fixes compared to JAI Support for Band Masks FOSS4G 2015, Seoul 14 th -19 th September 2015 JAI JAI-Ext
JAITools High performance raster processing Extends JAI with more operations Open Source, BSD license Low Level Operations, e.g. RangeLookup Higher Level Operations Vectorize, Contour Raster algebra (Jiffle) FOSS4G 2015, Seoul 14 th -19 th September
Raster algebra language based on JAITools Can be exposed as WPS Jiffle FOSS4G 2015, Seoul 14 th -19 th September
SUN then Oracle Image I/O library Partly ships with JDK partly as extension JAI bridge for tile-based, deferred data reading Easily Extensible Natively Accelerated Code available for many formats No source code for native (de)coders Development more or less stopped! JAI - ImageIO FOSS4G 2015, Seoul 14 th -19 th September 2015
Extends, complements, replaces Oracle JAI ImageIO Library Open Source, LGPL and BSD licenses Plugins: BigTiff*, MatFile 5, TurboJPEG JP2000 (Kakadu) Fast PNG encoder GDAL integration: JPEG2000, MrSID, ECW, BigTIFF, ERDAS Image, HDF4, … ImageIO-EXT FOSS4G 2015, Seoul 14 th -19 th September 2015 ImageIO ImageIO-Ext
Adds the geography on top of the imagery Representation of georeferenced grids Reading and writing georeferenced formats Rendering (colormap, contrast stretch, hillshade, transform, …) Reprojection Operations in geographic space Process API and implementations ready to be used by WPS GeoTools FOSS4G 2015, Seoul 14 th -19 th September
Adds the network protocols on top of the georeferenced rasters: WMS and WMTS to view WCS to download WPS to process GeoServer FOSS4G 2015, Seoul 14 th -19 th September
Recent Achievements: JAI-EXT FOSS4G 2015, Seoul 14 th -19 th September 2015
JAI-EXT improvements FOSS4G 2015, Seoul 14 th -19 th September 2015 QA and performance tuning underway Mosaic images in different color models Positive reports are flowing in. From the user mailing list: … JAI-Ext is giving me a >12x speed increase w/ warp transforms and bicubic interpolation against GridCoverages with floating point data types. …. Actually in preparing my report to the team I crunched the numbers and we're actually seeing tiling throughput improvements of: NEAREST by 3x BICUBIC by 21x BILINEAR by 68x Given our raster ingest rates of 30 Gpbs, this is significant
JAI-EXT integration FOSS4G 2015, Seoul 14 th -19 th September 2015 GeoTools 14.0 and GeoServer JAI-EXT available on demand for the moment, add this system variable: -Dorg.geotools.coverage.jaiext.enabled=true Still have to work out a few integration issues, should become active by default in the next few months
Benefits of JAI-EXT integration FOSS4G 2015, Seoul 14 th -19 th September 2015 End to end NODATA support (scientific data anyone?) Region Of Interest (ROI, raster mask) full support in all operations Heterogeneous mosaic support: mix images in gray 8 and 16 bit, RGB in the same mosaic Bug fixes over JAI Speedups in certain operations
Recent Achievements: Raster data masking FOSS4G 2015, Seoul 14 th -19 th September 2015
GeoTools Vector mask support FOSS4G 2015, Seoul 14 th -19 th September 2015 Sidecar shp/wkt/wkb file with the valid area Or single shapefile for the whole mosaic Trouble: the vector rescales linearly, the raster does by the unit (cannot have 1/2 of a pixel, you know?)
GeoTools Raster mask support FOSS4G 2015, Seoul 14 th -19 th September 2015 Support for GDAL external and internal masks Binary images telling where the data is actually valid One mask per overview Very important for data compressed with lossy compressions The mask can be compressed too (DEFLATE, non lossy)
Recent Achievements: Metoc specific FOSS4G 2015, Seoul 14 th -19 th September 2015
MetOC: support for 0/360 rasters FOSS4G 2015, Seoul 14 th -19 th September 2015 In Meteorology and Oceanography, rasters with longitude between 0 and 360 are common This is the data crossing the dateline (not request) Improved support for displaying and re- projecting them Dateline
Support for custom NetCDF projections FOSS4G 2015, Seoul 14 th -19 th September 2015 Added support for reading custom projections out of NetCDF and GRIB files Register them in: $GEOSERVER_DATA_DIR/user-projections/netcdf.projections.properties Usual WKT syntax =PROJCS[“lambert_conformal_conic_1SP”, GEOGCS[“unknown”, DATUM[“unknown”, SPHEROID[“unknown”, , 0.0]], PRIMEM[“Greenwich”, 0.0], UNIT[“degree”, ], AXIS[“Geodetic longitude”, EAST], AXIS[“Geodetic latitude”, NORTH]], PROJECTION[“Lambert_Conformal_Conic_1SP”], PARAMETER[“central_meridian”, -95.0], PARAMETER[“latitude_of_origin”, 25.0], PARAMETER[“scale_factor”, 1.0], PARAMETER[“false_easting”, 0.0], PARAMETER[“false_northing”, 0.0], UNIT[“m”, 1.0], AXIS[“Easting”, EAST], AXIS[“Northing”, NORTH], AUTHORITY[“EPSG”,”971801”]]
Support for custom NetCDF projections FOSS4G 2015, Seoul 14 th -19 th September 2015
WCS NetCDF output improvements FOSS4G 2015, Seoul 14 th -19 th September 2015 Support for CF standard variable names Custom data packing UOM conversion Attributes
Recent Achievements: Odds and ends FOSS4G 2015, Seoul 14 th -19 th September 2015
Raster advanced projection handling FOSS4G 2015, Seoul 14 th -19 th September 2015 Improved support for requests crossing the dateline Improved support for difficult projections
Contrast stretch enhancement FOSS4G 2015, Seoul 14 th -19 th September 2015 Extensions to SLD and CSS Extra params to control the stretch algorithm Setup to be extended in the future StretchToMinimumMaximum/ClipToMinMaximum /ClipToZero reference/rastersymbolizer.html#contrastenhancement
Contrast stretch enhancement FOSS4G 2015, Seoul 14 th -19 th September 2015 StretchToMinMax Clip
What’s cooking FOSS4G 2015, Seoul 14 th -19 th September 2015
Hillshading FOSS4G 2015, Seoul 14 th -19 th September 2015 <ColorMapEntry color="#000000" quantity="-32636" opacity="0" /> 20 false The one SLD 1.0 feature we were still missing Did not make the GT 14.x/GS 2.8.x feature freeze, may be backported later
Hillshading FOSS4G 2015, Seoul 14 th -19 th September 2015
Full JAI replacement FOSS4G 2015, Seoul 14 th -19 th September 2015 JAI interfaces and base infrastructure are not yet replaceable Yet, they are very old code, we would like to have a fresh start based on what we have in JAI-EXT Trying to get funds to get there, anyone here interested in helping?
That’s all folks! FOSS4G 2015, Seoul 14 th -19 th September 2015