SlideShare a Scribd company logo
1 of 52
Download to read offline
State of JAI
Java Image Processing for GeoSpatial Community
Java Advanced Imaging
What is Java Advanced Imaging?
● Image Processing Library for Java Applications
○ a “pure java” solution for image processing
● Tiling computational model
○ Images accessed tile-by-tile
○ Centrally-maintained cache for performance
○ Facilitates multi-threaded processing
● Deferred execution
○ Construct a chain of operations
○ Only compute as needed
● Threaded computation
● Object-oriented extensibility
○ Register your own operations
○ Or override the built-in operations
● Remote imaging
○ Evaluate operator chains on remote hosts
○ Transfer images tile by tile
● Border extension
● Image warping
● Pixel interpolation
● Graphics2D Drawing
● Regions of Interest (ROI)
● Image file handling
○ Using JAI ImageIO project
Demo!
What else was cool in 1999
How JAI has been used for GeoSpatial
JAI-EXT
JAI-Ext has been developed by GeoSolutions as an internal effort to replace Oracle JAI
operation implementations (remember deferred binding?).
The result is a strong open source project with an Apache 2.0 License.
Improves on JAI in three different ways:
● Adding more features to existing operations, like support for “no data” and ROI
● Improving performance of some operations
● Developing new operations
JAI-EXT Functionality
● Operations implemented supporting nodata
○ Affine*
○ BandMerge
○ Border
○ Crop
○ Lookup
○ Mosaic
○ Null
○ Rescale
○ Scale*
○ Statistic
○ Translate
○ Warp*
○ ZonalStatistics
* Support nearest-neighbor, bilinear, bicubic interpolation
● ConcurrentCache
○ Replacement JAI TileCache
○ Offering better concurrency
○ Uses Guava cache internally
● And more
○ Public roadmap
JAI-Tools
Project by Michael Bedward with a number of great ideas:
● Contour
● Image generation
● Kernel stats
● Rangelookup
● Regionalize
● Vectorize
● Zonal Stats
Project is no longer active, functionality migrating as needed to JAI-EXT.
Jiffle
Map algebra language by Michael Bedward:
● provides a “raster calculator” language
for dynamic processing of bands
● Integrated as a JAI Operation
Project has migrated to JAI-EXT and it is
included starting version 1.1.0
Jiffle Example
nir = src[7];
vir = src[3];
dest = (nir-vir)/(nir+vir);
Sentinel 2 dataset, 13
bands
Jiffle script On the fly NDVI index display
GeoTools ImageWorker Helper Class
Utility builder helping to run operations on images
Hides some of the complexity, optimizes repeated operations, handles differences
between JAI and JAI-EXT (e.g., can you talk about no-data, or not?)
ImageWorker worker = new ImageWorker(image);
ImageWorker = worker.scale( percent, percent, 0,0,
bilinear).
RenderedImage result = worker.getRenderedImage();
GeoTools GridCoverage
AbstractGridFormat format = GridFormatFinder.findFormat( file );
Hints hints = null;
if (format instanceof GeoTiffFormat) {
hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE);
}
GridCoverage2DReader gridReader = format.getReader(file, hints);
GridCoverage2D gridCoverage = gridReader.read(null);
AWT RenderedImage
Grid2World (AffineTransform)
CoordinateReferenceSystem
GridCoverage
The pixels
From pixel coords to real world coords
The “meaning” of the real world coords
GeoTools CoverageProcessor
CoverageProcessor processor = CoverageProcessor.getInstance();
final ParameterValueGroup param =
processor.getOperation("CoverageCrop").getParameters();
param.parameter("Source").setValue(gridCoverage);
param.parameter("Envelope").setValue(envelope);
GridCoverage2D result = processor.doOperation(param);
AWT RenderedImage
Grid2World (AffineTransform)
CoordinateReferenceSystem
AWT RenderedImage
Grid2World (AffineTransform)
CoordinateReferenceSystem
CROP
GeoTools Operations
Equivalent of ImageWorker, but helps applying operations at the coverage (georeferenced) level
Operations ops = new Operations(null);
double scale = 0.5; // 50%
GridCoverage scaledCoverage = ops.scale(coverage, scale, scale, 0, 0);
JAI Licensing and Distribution
Sun Distribution License
● Free to Distribute
● Not open source!
Java Research License
● Access to source code
for research purposes only!
Distributed as “standard extension” to Java
● Additional install into JRE
● An early attempt at Java “modules”
Optional “native” acceleration mediaLib binaries
Java Runtime Environment
Core system classes
- java.lang.*
- java.io.*
- java.awt.*
- ...
Extension
javax.media.j3d.*
Extension
javax.media.jai.*
Making Peace with Open Source
Two problems with JAI
● The Binary License / Research License is not open source
○ Upset projects like OSGeo Live that would like to be purely open source
○ Blocker for uDig graduating from LocationTech
● The project has been abandoned by Oracle
OpenCV
● Open Source Computer Vision Library
○ Roughly comparable to JAI
○ BSD license
○ Memory bound? Does it have ability to work with images larger than memory?
○ C/C++ codebase with bindings for Java
■ Some overhead taking data across JNI divide
■ Intended use is to set up a processing chain and visualize the result
● Features
○ Can use OpenCL to share workload between CPU/GPU
ImageJ
● “Image Processing and Analysis in Java”
○ Much better comparison with JAI
○ Open source? Not really it is public-domain which causes problem…
○ Pure-java solution, runs anywhere
○ Memory bound, wants to load images into memory for processing
● Community
○ imagej.net
○ Popular in the scientific and health community
■ Started in the 70s in Pascal
■ Large base of community developed plugins
■ FIJI (Fiji is just ImageJ) offers a distribution of plugins that work
○ Author has now retired from National Institute of Mental health, but continues to develop
■ imagej.nih.gov/ij
Apache Commons Imaging
● “a Pure-Java Image Library”
○ Looks to focus on great image format support
○ Open source! Apache License
○ Pure-java solution, runs anywhere
○ Memory bound!
● Community
○ No stable release available because there are lots of outstanding issues
○ Version 0.97 released in 2009 :(
Emerging Requirements
● Pure-java image processing
● Extendable
○ Enjoy the ability to create custom operations
○ Opens the door to native operation (example use of OpenCV)
● no artificial limit on number of bands
● Long term goal is to replace JAI? Is it in
position to do so?
● Pros:
○ Large portion of operations are rewritten
○ Key components like tile cache are rewritten
○ Integrates with JDK image support, does not
reinvent the wheel
● Cons:
○ Makes use of JAI Interfaces,
(which are still not open source)
○ Usability issues around JAI Interfaces
(programming style has changed since 1999)
JAI-EXT as an Alternative ?
It is too bad we are really stuck, if only Oracle would
make the interfaces open source we are this close to
being able to do the rest!
Oracle has made the vast majority of Java open
source, but for whatever reasons JAI missed out!
● Updated approach
○ wrapper implementation at OSGeo
■ Delegate to existing JAI / JAI-Ext
○ Migrate GeoTools to RPE Interfaces
○ Provide start-up switch to change between
■ Wrapper
■ Clean room
● Cons:
○ This is an idea that requires development.
■ “I tried to look at the source code, but
apparently there is not much”
○ Will not integrate with Java native raster types
Raster Processing Engine
● Raster processing engine:
○ Modern Java API using Java 8 constructs,
literate programing style, as appropriate
○ Pure Java implementation
○ Ability to stage larger rasters as tiles in
memory and process tiles in parallel
○ Clear image processing operations, allowing
installations to use native libs to accelerate
processing if available
● Initial strategy
○ Provide new “clean room” interfaces
○ Initial implementation
■ Migrate JAI-EXT operations
○ Incubation at LocationTech
■ Benefit from strong IP practices
■ fundraising opportunities
Bonn Code Sprint
Raster Processing Engine Scoping Exercise
Bonn Code Sprint
Bonn Sprint Objectives
● Scope the functionality required for Raster Processing Engine
○ If JAI can not be fully brought into Open Source, what do we have to replace?
● Prototype user facing interfaces
● Quickly morphed into:
○ Wait how does JAI actually work?
○ Wait what are the important interfaces
We don’t write docs this way anymore
Bonn Sprint: Code Archeology
“Primitive civilizations must have used this to … enumerate possible categorical values?”
Relationship with AWT
Image: RenderedImage
● Interface
● Good for final result
● Tiled
● Relative to a larger canvas
○ Offset to (0, 0)
○ .getMinX()
○ .getMinY()
● Tile grid to larger canvas
○ Offset to (0,0)
○ .getTileGridXOffset()
○ .getTileGridYOffset()
● Tiles allow working with larger
than memory rasters.
Relationship with AWT
Image: PlanarImage
● Abstracts over
○ Image in memory
○ Image source
○ Operation DAG
● Does not expose TileCache
● Does not expose TileScheduler
● Execution does not happen until
○ .getData(bbox)
○ .getTile(x, y)
● Exposes Direct Acyclic Graph for
deferred Operations
○ .getSources
○ .getSinks
JAI
Deferred Execution
Read CropWarpSource
Encode
PNG/JPEG
Tile cache
One tile at a time: handle images larger than memory
Allows also to compute multiple tiles in parallel, one per thread
Adds the basis for distributed computation (given the right tile cache)
Deferred Binding
Read OpImageOpImage
Source
Deferred Binding
CropOpImageWrapOpImage
Read OpImageOpImage
Source
Encode
PNG/JPEG
JAI/JAI-EXT Entanglements
How deep are the roots of this thing?
What are we going to snag when we pull on it?
● jai-ext source:
○ public abstract class WarpOpImage extends javax.media.jai.WarpOpImage
● jai-ext implements concurrent TileCache
● TileScheduler is not concurrent
● Use of TileCache and TileScheduler is of course hidden from jai-ext ops
○ Most operations are driven by RenderedImage.getData
● TileScheduler is also hidden from jai-ext
○ Although … it is not not use Java Executors.
● So it is … possible
JAIRPE
RPE
JAI ParameterBlock Example
FileSeekableStream stream = new FileSeekableStream(args[0]);
RenderedOp image1 = JAI.create(“stream”, stream);
ParameterBlock params = new ParameterBlock();
params.addSource(image1);
params.add(2.0F); // x scale factor
params.add(2.0F); // y scale factor
params.add(0.0F); // x translate
params.add(0.0F); // y translate
params.add(Interpolation.INTERP_BILINEAR);
/* Create an operator to scale image1. */
RenderedOp image2 = JAI.create(“scale”, params, hints);
FileSeekableStream stream = new FileSeekableStream(args[0]);
RenderedOp image1 = JAI.create(“stream”, stream);
RenderedOp image2 =
ScaleDescriptor.create(image1,2.0F, 2.0F, 0.0F, 0.0F,Interpolate.INTERP_BILINEAR, hints);
JAI Descriptor Example
Raster Processing Engine Example
FileSeekableStream stream = new FileSeekableStream(args[0]);
Operation image1 = ImageRead.stream(fileSeekableStream)
Operation image2 = Affine.source(image1)
.scale(2.0F,2.0F)
.interpolation(Interpolation.BILINEAR).create();
Interaction with Java SWT Image
Audit of GeoTools and GeoServer Use
But wait ...
Oracle is using JAI inside their database product!Oracle has just donated Java Enterprise Edition to
the Eclipse Foundation, forming the Jakarta project.
I wonder if Oracle would donate the JAI interfaces to
us? It would save a lot of time.
Answer is perhaps, just one more release?
Huh?
“1.10 Oracle Multimedia Architecture”
Oracle Database Online Documentation 11g Release 1 (11.1)
Questions and Discussion
Q: Will JAI Work with Java 11?
● Pure java implementation on the CLASSPATH should work
○ We have not tried it with the module system
● The JRE “standard extensions” system was removed in Java 9
○ Replaced by “jigsaw” module system
JAI Descriptor Example
FileSeekableStream stream =
new FileSeekableStream(args[0]);
RenderedOp image1 =
JAI.create(“stream”, stream);
RenderedOp image2 = ScaleDescriptor.create(
image,
2.0F, 2.0F, 0.0F, 0.0F,
Interpolate.INTERP_BILINEAR,
null);
JAI and RPE Compared
RPE Operation Example
FileSeekableStream stream =
new FileSeekableStream(args[0]);
Operation image1 =
ImageRead.stream(fileSeekableStream);
Operation image2 =
Affine.source(image1)
.scale(2.0F,2.0F)
.interpolation(Interpolation.BILINEAR)
.create();
JAI and RPE Compared
JAI ParameterBlock Example
FileSeekableStream stream =
new FileSeekableStream(args[0]);
RenderedOp image1 =
JAI.create(“stream”, stream);
ParameterBlock params = new ParameterBlock();
params.addSource(image1);
params.add(2.0F); // x scale factor
params.add(2.0F); // y scale factor
params.add(0.0F); // x translate
params.add(0.0F); // y translate
params.add(Interpolation.INTERP_BILINEAR);
RenderedOp image2 = JAI.create(“scale”, params);
RPE Operation Example
FileSeekableStream stream =
new FileSeekableStream(args[0]);
Operation image1 =
ImageRead.stream(fileSeekableStream)
Operation image2 =
Affine.source(image1)
.scale(2.0F,2.0F)
.interpolation(Interpolation.BILINEAR)
.create();
References
- Java Advanced Imaging API Home Page (Oracle)
- Introduction to the Java(TM) Advanced Imaging API (SlideShare)

More Related Content

What's hot

COSCUP 2023 - Make Your Own Ray Tracing GPU with FPGA
COSCUP 2023 - Make Your Own Ray Tracing GPU with FPGACOSCUP 2023 - Make Your Own Ray Tracing GPU with FPGA
COSCUP 2023 - Make Your Own Ray Tracing GPU with FPGAOwen Wu
 
Backup and Restore of database on 2-Node RAC
Backup and Restore of database on 2-Node RACBackup and Restore of database on 2-Node RAC
Backup and Restore of database on 2-Node RACPaulo Fagundes
 
Shader model 5 0 and compute shader
Shader model 5 0 and compute shaderShader model 5 0 and compute shader
Shader model 5 0 and compute shaderzaywalker
 
Mapinfo
MapinfoMapinfo
Mapinfodoai
 
vkFX: Effect(ive) approach for Vulkan API
vkFX: Effect(ive) approach for Vulkan APIvkFX: Effect(ive) approach for Vulkan API
vkFX: Effect(ive) approach for Vulkan APITristan Lorach
 
Optimizing the Graphics Pipeline with Compute, GDC 2016
Optimizing the Graphics Pipeline with Compute, GDC 2016Optimizing the Graphics Pipeline with Compute, GDC 2016
Optimizing the Graphics Pipeline with Compute, GDC 2016Graham Wihlidal
 
Siggraph2016 - The Devil is in the Details: idTech 666
Siggraph2016 - The Devil is in the Details: idTech 666Siggraph2016 - The Devil is in the Details: idTech 666
Siggraph2016 - The Devil is in the Details: idTech 666Tiago Sousa
 
Oracle RDBMS architecture
Oracle RDBMS architectureOracle RDBMS architecture
Oracle RDBMS architectureMartin Berger
 
Developing Efficient Web-based GIS Applications
Developing Efficient Web-based GIS ApplicationsDeveloping Efficient Web-based GIS Applications
Developing Efficient Web-based GIS ApplicationsSwetha A
 
Introduction of super map gis 10i(2020) (1)
Introduction of super map gis 10i(2020) (1)Introduction of super map gis 10i(2020) (1)
Introduction of super map gis 10i(2020) (1)GeoMedeelel
 
Oracle 19c initialization parameters
Oracle 19c initialization parametersOracle 19c initialization parameters
Oracle 19c initialization parametersPablo Echeverria
 
Super map iDesktop 교육교재 기초
Super map iDesktop 교육교재 기초Super map iDesktop 교육교재 기초
Super map iDesktop 교육교재 기초선경 김선경
 
Implements Cascaded Shadow Maps with using Texture Array
Implements Cascaded Shadow Maps with using Texture ArrayImplements Cascaded Shadow Maps with using Texture Array
Implements Cascaded Shadow Maps with using Texture ArrayYEONG-CHEON YOU
 
GIS User to Web-GIS Developer Journey
GIS User to Web-GIS Developer JourneyGIS User to Web-GIS Developer Journey
GIS User to Web-GIS Developer JourneyTek Kshetri
 
GeoServer in Production: we do it, here is how!
GeoServer in Production: we do it, here is how!GeoServer in Production: we do it, here is how!
GeoServer in Production: we do it, here is how!GeoSolutions
 
GeoServer on steroids
GeoServer on steroidsGeoServer on steroids
GeoServer on steroidsGeoSolutions
 
Screen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space MarineScreen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space MarinePope Kim
 
A Scalable Real-Time Many-Shadowed-Light Rendering System
A Scalable Real-Time Many-Shadowed-Light Rendering SystemA Scalable Real-Time Many-Shadowed-Light Rendering System
A Scalable Real-Time Many-Shadowed-Light Rendering SystemBo Li
 

What's hot (20)

COSCUP 2023 - Make Your Own Ray Tracing GPU with FPGA
COSCUP 2023 - Make Your Own Ray Tracing GPU with FPGACOSCUP 2023 - Make Your Own Ray Tracing GPU with FPGA
COSCUP 2023 - Make Your Own Ray Tracing GPU with FPGA
 
Backup and Restore of database on 2-Node RAC
Backup and Restore of database on 2-Node RACBackup and Restore of database on 2-Node RAC
Backup and Restore of database on 2-Node RAC
 
Shader model 5 0 and compute shader
Shader model 5 0 and compute shaderShader model 5 0 and compute shader
Shader model 5 0 and compute shader
 
Mapinfo
MapinfoMapinfo
Mapinfo
 
vkFX: Effect(ive) approach for Vulkan API
vkFX: Effect(ive) approach for Vulkan APIvkFX: Effect(ive) approach for Vulkan API
vkFX: Effect(ive) approach for Vulkan API
 
3D 딥러닝 동향
3D 딥러닝 동향3D 딥러닝 동향
3D 딥러닝 동향
 
High dynamic range
High dynamic rangeHigh dynamic range
High dynamic range
 
Optimizing the Graphics Pipeline with Compute, GDC 2016
Optimizing the Graphics Pipeline with Compute, GDC 2016Optimizing the Graphics Pipeline with Compute, GDC 2016
Optimizing the Graphics Pipeline with Compute, GDC 2016
 
Siggraph2016 - The Devil is in the Details: idTech 666
Siggraph2016 - The Devil is in the Details: idTech 666Siggraph2016 - The Devil is in the Details: idTech 666
Siggraph2016 - The Devil is in the Details: idTech 666
 
Oracle RDBMS architecture
Oracle RDBMS architectureOracle RDBMS architecture
Oracle RDBMS architecture
 
Developing Efficient Web-based GIS Applications
Developing Efficient Web-based GIS ApplicationsDeveloping Efficient Web-based GIS Applications
Developing Efficient Web-based GIS Applications
 
Introduction of super map gis 10i(2020) (1)
Introduction of super map gis 10i(2020) (1)Introduction of super map gis 10i(2020) (1)
Introduction of super map gis 10i(2020) (1)
 
Oracle 19c initialization parameters
Oracle 19c initialization parametersOracle 19c initialization parameters
Oracle 19c initialization parameters
 
Super map iDesktop 교육교재 기초
Super map iDesktop 교육교재 기초Super map iDesktop 교육교재 기초
Super map iDesktop 교육교재 기초
 
Implements Cascaded Shadow Maps with using Texture Array
Implements Cascaded Shadow Maps with using Texture ArrayImplements Cascaded Shadow Maps with using Texture Array
Implements Cascaded Shadow Maps with using Texture Array
 
GIS User to Web-GIS Developer Journey
GIS User to Web-GIS Developer JourneyGIS User to Web-GIS Developer Journey
GIS User to Web-GIS Developer Journey
 
GeoServer in Production: we do it, here is how!
GeoServer in Production: we do it, here is how!GeoServer in Production: we do it, here is how!
GeoServer in Production: we do it, here is how!
 
GeoServer on steroids
GeoServer on steroidsGeoServer on steroids
GeoServer on steroids
 
Screen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space MarineScreen Space Decals in Warhammer 40,000: Space Marine
Screen Space Decals in Warhammer 40,000: Space Marine
 
A Scalable Real-Time Many-Shadowed-Light Rendering System
A Scalable Real-Time Many-Shadowed-Light Rendering SystemA Scalable Real-Time Many-Shadowed-Light Rendering System
A Scalable Real-Time Many-Shadowed-Light Rendering System
 

Similar to Java Image Processing for Geospatial Community

blueMarine Sailing with NetBeans Platform
blueMarine Sailing with NetBeans PlatformblueMarine Sailing with NetBeans Platform
blueMarine Sailing with NetBeans PlatformFabrizio Giudici
 
Devoxx : being productive with JHipster
Devoxx : being productive with JHipsterDevoxx : being productive with JHipster
Devoxx : being productive with JHipsterJulien Dubois
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkAlive Kuo
 
CON6423: Scalable JavaScript applications with Project Nashorn
CON6423: Scalable JavaScript applications with Project NashornCON6423: Scalable JavaScript applications with Project Nashorn
CON6423: Scalable JavaScript applications with Project NashornMichel Graciano
 
Are app servers still fascinating
Are app servers still fascinatingAre app servers still fascinating
Are app servers still fascinatingAntonio Goncalves
 
Dataflow Visualization using ASCII DAG
Dataflow Visualization using ASCII DAGDataflow Visualization using ASCII DAG
Dataflow Visualization using ASCII DAGgree_tech
 
React native: building native iOS apps with javascript
React native: building native iOS apps with javascriptReact native: building native iOS apps with javascript
React native: building native iOS apps with javascriptPolidea
 
State of GeoServer 2.13
State of GeoServer 2.13State of GeoServer 2.13
State of GeoServer 2.13Jody Garnett
 
Introduction To Apache Pig at WHUG
Introduction To Apache Pig at WHUGIntroduction To Apache Pig at WHUG
Introduction To Apache Pig at WHUGAdam Kawa
 
Iteria lowcode 2022-01-10
Iteria lowcode 2022-01-10Iteria lowcode 2022-01-10
Iteria lowcode 2022-01-10Jozef Slezak
 
State of GeoServer 2.12
State of GeoServer 2.12State of GeoServer 2.12
State of GeoServer 2.12GeoSolutions
 
Reactive datastore demo (2020 03-21)
Reactive datastore demo (2020 03-21)Reactive datastore demo (2020 03-21)
Reactive datastore demo (2020 03-21)YangJerng Hwa
 
Java uk road tour - sep 06
Java uk road tour - sep 06Java uk road tour - sep 06
Java uk road tour - sep 06scoobeesnac
 
AirBNB's ML platform - BigHead
AirBNB's ML platform - BigHeadAirBNB's ML platform - BigHead
AirBNB's ML platform - BigHeadKarthik Murugesan
 
Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...
 Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa... Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...
Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...Databricks
 
Run your code serverlessly on Google's open cloud
Run your code serverlessly on Google's open cloudRun your code serverlessly on Google's open cloud
Run your code serverlessly on Google's open cloudwesley chun
 
Using JavaScript to write Native Mobile Applications
Using JavaScript to write Native Mobile ApplicationsUsing JavaScript to write Native Mobile Applications
Using JavaScript to write Native Mobile ApplicationsDerek Anderson
 
High Performance Rust UI.pdf
High Performance Rust UI.pdfHigh Performance Rust UI.pdf
High Performance Rust UI.pdfmraaaaa
 
EFL: Scaling From the Embedded World to the Desktop
EFL: Scaling From the Embedded World to the DesktopEFL: Scaling From the Embedded World to the Desktop
EFL: Scaling From the Embedded World to the DesktopSamsung Open Source Group
 

Similar to Java Image Processing for Geospatial Community (20)

blueMarine Sailing with NetBeans Platform
blueMarine Sailing with NetBeans PlatformblueMarine Sailing with NetBeans Platform
blueMarine Sailing with NetBeans Platform
 
Devoxx : being productive with JHipster
Devoxx : being productive with JHipsterDevoxx : being productive with JHipster
Devoxx : being productive with JHipster
 
JavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web frameworkJavascriptMVC: Another choice of web framework
JavascriptMVC: Another choice of web framework
 
CON6423: Scalable JavaScript applications with Project Nashorn
CON6423: Scalable JavaScript applications with Project NashornCON6423: Scalable JavaScript applications with Project Nashorn
CON6423: Scalable JavaScript applications with Project Nashorn
 
Are app servers still fascinating
Are app servers still fascinatingAre app servers still fascinating
Are app servers still fascinating
 
Dataflow Visualization using ASCII DAG
Dataflow Visualization using ASCII DAGDataflow Visualization using ASCII DAG
Dataflow Visualization using ASCII DAG
 
React native: building native iOS apps with javascript
React native: building native iOS apps with javascriptReact native: building native iOS apps with javascript
React native: building native iOS apps with javascript
 
State of GeoServer 2.13
State of GeoServer 2.13State of GeoServer 2.13
State of GeoServer 2.13
 
Introduction To Apache Pig at WHUG
Introduction To Apache Pig at WHUGIntroduction To Apache Pig at WHUG
Introduction To Apache Pig at WHUG
 
Iteria lowcode 2022-01-10
Iteria lowcode 2022-01-10Iteria lowcode 2022-01-10
Iteria lowcode 2022-01-10
 
State of GeoServer 2.12
State of GeoServer 2.12State of GeoServer 2.12
State of GeoServer 2.12
 
Reactive datastore demo (2020 03-21)
Reactive datastore demo (2020 03-21)Reactive datastore demo (2020 03-21)
Reactive datastore demo (2020 03-21)
 
Java uk road tour - sep 06
Java uk road tour - sep 06Java uk road tour - sep 06
Java uk road tour - sep 06
 
AirBNB's ML platform - BigHead
AirBNB's ML platform - BigHeadAirBNB's ML platform - BigHead
AirBNB's ML platform - BigHead
 
Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...
 Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa... Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...
Bighead: Airbnb’s End-to-End Machine Learning Platform with Krishna Puttaswa...
 
Run your code serverlessly on Google's open cloud
Run your code serverlessly on Google's open cloudRun your code serverlessly on Google's open cloud
Run your code serverlessly on Google's open cloud
 
Using JavaScript to write Native Mobile Applications
Using JavaScript to write Native Mobile ApplicationsUsing JavaScript to write Native Mobile Applications
Using JavaScript to write Native Mobile Applications
 
Hadoop @ eBuddy
Hadoop @ eBuddyHadoop @ eBuddy
Hadoop @ eBuddy
 
High Performance Rust UI.pdf
High Performance Rust UI.pdfHigh Performance Rust UI.pdf
High Performance Rust UI.pdf
 
EFL: Scaling From the Embedded World to the Desktop
EFL: Scaling From the Embedded World to the DesktopEFL: Scaling From the Embedded World to the Desktop
EFL: Scaling From the Embedded World to the Desktop
 

More from Jody Garnett

GeoServer Orientation
GeoServer OrientationGeoServer Orientation
GeoServer OrientationJody Garnett
 
Open Source Practice and Passion at OSGeo
Open Source Practice and Passion at OSGeoOpen Source Practice and Passion at OSGeo
Open Source Practice and Passion at OSGeoJody Garnett
 
Introduction to OSGeo
Introduction to OSGeoIntroduction to OSGeo
Introduction to OSGeoJody Garnett
 
Open Source Procurement
Open Source ProcurementOpen Source Procurement
Open Source ProcurementJody Garnett
 
Open Source Practice and Passion at OSGeo
Open Source Practice and Passion at OSGeoOpen Source Practice and Passion at OSGeo
Open Source Practice and Passion at OSGeoJody Garnett
 
Open Source is hard, we are here to help!
Open Source is hard, we are here to help!Open Source is hard, we are here to help!
Open Source is hard, we are here to help!Jody Garnett
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers WorkshopJody Garnett
 
GeoServer Ecosystem 2018
GeoServer Ecosystem 2018GeoServer Ecosystem 2018
GeoServer Ecosystem 2018Jody Garnett
 
State of GeoServer 2.14
State of GeoServer 2.14State of GeoServer 2.14
State of GeoServer 2.14Jody Garnett
 
Working with the OSGeo Community
Working with the OSGeo CommunityWorking with the OSGeo Community
Working with the OSGeo CommunityJody Garnett
 
Open Data and Open Software Geospatial Applications
Open Data and Open Software Geospatial ApplicationsOpen Data and Open Software Geospatial Applications
Open Data and Open Software Geospatial ApplicationsJody Garnett
 
Map box styles in GeoServer and OpenLayers
Map box styles in GeoServer and OpenLayersMap box styles in GeoServer and OpenLayers
Map box styles in GeoServer and OpenLayersJody Garnett
 
Quick and easy web maps
Quick and easy web mapsQuick and easy web maps
Quick and easy web mapsJody Garnett
 
Incubation Orientation
Incubation OrientationIncubation Orientation
Incubation OrientationJody Garnett
 
Understanding the Flexibility of Open Source
Understanding the Flexibility of Open SourceUnderstanding the Flexibility of Open Source
Understanding the Flexibility of Open SourceJody Garnett
 

More from Jody Garnett (20)

GeoServer Orientation
GeoServer OrientationGeoServer Orientation
GeoServer Orientation
 
Open Source Practice and Passion at OSGeo
Open Source Practice and Passion at OSGeoOpen Source Practice and Passion at OSGeo
Open Source Practice and Passion at OSGeo
 
Introduction to OSGeo
Introduction to OSGeoIntroduction to OSGeo
Introduction to OSGeo
 
Open Source Procurement
Open Source ProcurementOpen Source Procurement
Open Source Procurement
 
State of JTS 2018
State of JTS 2018State of JTS 2018
State of JTS 2018
 
Open Source Practice and Passion at OSGeo
Open Source Practice and Passion at OSGeoOpen Source Practice and Passion at OSGeo
Open Source Practice and Passion at OSGeo
 
Open Source is hard, we are here to help!
Open Source is hard, we are here to help!Open Source is hard, we are here to help!
Open Source is hard, we are here to help!
 
GeoServer Developers Workshop
GeoServer Developers WorkshopGeoServer Developers Workshop
GeoServer Developers Workshop
 
GeoServer Ecosystem 2018
GeoServer Ecosystem 2018GeoServer Ecosystem 2018
GeoServer Ecosystem 2018
 
State of GeoServer 2.14
State of GeoServer 2.14State of GeoServer 2.14
State of GeoServer 2.14
 
OSGeo AGM 2018
OSGeo AGM 2018OSGeo AGM 2018
OSGeo AGM 2018
 
Working with the OSGeo Community
Working with the OSGeo CommunityWorking with the OSGeo Community
Working with the OSGeo Community
 
Open Data and Open Software Geospatial Applications
Open Data and Open Software Geospatial ApplicationsOpen Data and Open Software Geospatial Applications
Open Data and Open Software Geospatial Applications
 
Map box styles in GeoServer and OpenLayers
Map box styles in GeoServer and OpenLayersMap box styles in GeoServer and OpenLayers
Map box styles in GeoServer and OpenLayers
 
Quick and easy web maps
Quick and easy web mapsQuick and easy web maps
Quick and easy web maps
 
State of GeoGig
State of GeoGigState of GeoGig
State of GeoGig
 
State of JTS 2017
State of JTS 2017State of JTS 2017
State of JTS 2017
 
OSGeo AGM 2017
OSGeo AGM 2017OSGeo AGM 2017
OSGeo AGM 2017
 
Incubation Orientation
Incubation OrientationIncubation Orientation
Incubation Orientation
 
Understanding the Flexibility of Open Source
Understanding the Flexibility of Open SourceUnderstanding the Flexibility of Open Source
Understanding the Flexibility of Open Source
 

Recently uploaded

What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 

Recently uploaded (20)

What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 

Java Image Processing for Geospatial Community

  • 1. State of JAI Java Image Processing for GeoSpatial Community
  • 3. What is Java Advanced Imaging? ● Image Processing Library for Java Applications ○ a “pure java” solution for image processing ● Tiling computational model ○ Images accessed tile-by-tile ○ Centrally-maintained cache for performance ○ Facilitates multi-threaded processing ● Deferred execution ○ Construct a chain of operations ○ Only compute as needed ● Threaded computation ● Object-oriented extensibility ○ Register your own operations ○ Or override the built-in operations ● Remote imaging ○ Evaluate operator chains on remote hosts ○ Transfer images tile by tile ● Border extension ● Image warping ● Pixel interpolation ● Graphics2D Drawing ● Regions of Interest (ROI) ● Image file handling ○ Using JAI ImageIO project
  • 5. What else was cool in 1999
  • 6. How JAI has been used for GeoSpatial
  • 7. JAI-EXT JAI-Ext has been developed by GeoSolutions as an internal effort to replace Oracle JAI operation implementations (remember deferred binding?). The result is a strong open source project with an Apache 2.0 License. Improves on JAI in three different ways: ● Adding more features to existing operations, like support for “no data” and ROI ● Improving performance of some operations ● Developing new operations
  • 8. JAI-EXT Functionality ● Operations implemented supporting nodata ○ Affine* ○ BandMerge ○ Border ○ Crop ○ Lookup ○ Mosaic ○ Null ○ Rescale ○ Scale* ○ Statistic ○ Translate ○ Warp* ○ ZonalStatistics * Support nearest-neighbor, bilinear, bicubic interpolation ● ConcurrentCache ○ Replacement JAI TileCache ○ Offering better concurrency ○ Uses Guava cache internally ● And more ○ Public roadmap
  • 9. JAI-Tools Project by Michael Bedward with a number of great ideas: ● Contour ● Image generation ● Kernel stats ● Rangelookup ● Regionalize ● Vectorize ● Zonal Stats Project is no longer active, functionality migrating as needed to JAI-EXT.
  • 10. Jiffle Map algebra language by Michael Bedward: ● provides a “raster calculator” language for dynamic processing of bands ● Integrated as a JAI Operation Project has migrated to JAI-EXT and it is included starting version 1.1.0
  • 11. Jiffle Example nir = src[7]; vir = src[3]; dest = (nir-vir)/(nir+vir); Sentinel 2 dataset, 13 bands Jiffle script On the fly NDVI index display
  • 12. GeoTools ImageWorker Helper Class Utility builder helping to run operations on images Hides some of the complexity, optimizes repeated operations, handles differences between JAI and JAI-EXT (e.g., can you talk about no-data, or not?) ImageWorker worker = new ImageWorker(image); ImageWorker = worker.scale( percent, percent, 0,0, bilinear). RenderedImage result = worker.getRenderedImage();
  • 13. GeoTools GridCoverage AbstractGridFormat format = GridFormatFinder.findFormat( file ); Hints hints = null; if (format instanceof GeoTiffFormat) { hints = new Hints(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER, Boolean.TRUE); } GridCoverage2DReader gridReader = format.getReader(file, hints); GridCoverage2D gridCoverage = gridReader.read(null); AWT RenderedImage Grid2World (AffineTransform) CoordinateReferenceSystem GridCoverage The pixels From pixel coords to real world coords The “meaning” of the real world coords
  • 14. GeoTools CoverageProcessor CoverageProcessor processor = CoverageProcessor.getInstance(); final ParameterValueGroup param = processor.getOperation("CoverageCrop").getParameters(); param.parameter("Source").setValue(gridCoverage); param.parameter("Envelope").setValue(envelope); GridCoverage2D result = processor.doOperation(param); AWT RenderedImage Grid2World (AffineTransform) CoordinateReferenceSystem AWT RenderedImage Grid2World (AffineTransform) CoordinateReferenceSystem CROP
  • 15. GeoTools Operations Equivalent of ImageWorker, but helps applying operations at the coverage (georeferenced) level Operations ops = new Operations(null); double scale = 0.5; // 50% GridCoverage scaledCoverage = ops.scale(coverage, scale, scale, 0, 0);
  • 16.
  • 17.
  • 18. JAI Licensing and Distribution Sun Distribution License ● Free to Distribute ● Not open source! Java Research License ● Access to source code for research purposes only! Distributed as “standard extension” to Java ● Additional install into JRE ● An early attempt at Java “modules” Optional “native” acceleration mediaLib binaries Java Runtime Environment Core system classes - java.lang.* - java.io.* - java.awt.* - ... Extension javax.media.j3d.* Extension javax.media.jai.*
  • 19. Making Peace with Open Source
  • 20. Two problems with JAI ● The Binary License / Research License is not open source ○ Upset projects like OSGeo Live that would like to be purely open source ○ Blocker for uDig graduating from LocationTech ● The project has been abandoned by Oracle
  • 21. OpenCV ● Open Source Computer Vision Library ○ Roughly comparable to JAI ○ BSD license ○ Memory bound? Does it have ability to work with images larger than memory? ○ C/C++ codebase with bindings for Java ■ Some overhead taking data across JNI divide ■ Intended use is to set up a processing chain and visualize the result ● Features ○ Can use OpenCL to share workload between CPU/GPU
  • 22. ImageJ ● “Image Processing and Analysis in Java” ○ Much better comparison with JAI ○ Open source? Not really it is public-domain which causes problem… ○ Pure-java solution, runs anywhere ○ Memory bound, wants to load images into memory for processing ● Community ○ imagej.net ○ Popular in the scientific and health community ■ Started in the 70s in Pascal ■ Large base of community developed plugins ■ FIJI (Fiji is just ImageJ) offers a distribution of plugins that work ○ Author has now retired from National Institute of Mental health, but continues to develop ■ imagej.nih.gov/ij
  • 23. Apache Commons Imaging ● “a Pure-Java Image Library” ○ Looks to focus on great image format support ○ Open source! Apache License ○ Pure-java solution, runs anywhere ○ Memory bound! ● Community ○ No stable release available because there are lots of outstanding issues ○ Version 0.97 released in 2009 :(
  • 24. Emerging Requirements ● Pure-java image processing ● Extendable ○ Enjoy the ability to create custom operations ○ Opens the door to native operation (example use of OpenCV) ● no artificial limit on number of bands
  • 25. ● Long term goal is to replace JAI? Is it in position to do so? ● Pros: ○ Large portion of operations are rewritten ○ Key components like tile cache are rewritten ○ Integrates with JDK image support, does not reinvent the wheel ● Cons: ○ Makes use of JAI Interfaces, (which are still not open source) ○ Usability issues around JAI Interfaces (programming style has changed since 1999) JAI-EXT as an Alternative ? It is too bad we are really stuck, if only Oracle would make the interfaces open source we are this close to being able to do the rest! Oracle has made the vast majority of Java open source, but for whatever reasons JAI missed out!
  • 26. ● Updated approach ○ wrapper implementation at OSGeo ■ Delegate to existing JAI / JAI-Ext ○ Migrate GeoTools to RPE Interfaces ○ Provide start-up switch to change between ■ Wrapper ■ Clean room ● Cons: ○ This is an idea that requires development. ■ “I tried to look at the source code, but apparently there is not much” ○ Will not integrate with Java native raster types Raster Processing Engine ● Raster processing engine: ○ Modern Java API using Java 8 constructs, literate programing style, as appropriate ○ Pure Java implementation ○ Ability to stage larger rasters as tiles in memory and process tiles in parallel ○ Clear image processing operations, allowing installations to use native libs to accelerate processing if available ● Initial strategy ○ Provide new “clean room” interfaces ○ Initial implementation ■ Migrate JAI-EXT operations ○ Incubation at LocationTech ■ Benefit from strong IP practices ■ fundraising opportunities
  • 27. Bonn Code Sprint Raster Processing Engine Scoping Exercise
  • 29. Bonn Sprint Objectives ● Scope the functionality required for Raster Processing Engine ○ If JAI can not be fully brought into Open Source, what do we have to replace? ● Prototype user facing interfaces ● Quickly morphed into: ○ Wait how does JAI actually work? ○ Wait what are the important interfaces
  • 30. We don’t write docs this way anymore
  • 31.
  • 32. Bonn Sprint: Code Archeology “Primitive civilizations must have used this to … enumerate possible categorical values?”
  • 33. Relationship with AWT Image: RenderedImage ● Interface ● Good for final result ● Tiled ● Relative to a larger canvas ○ Offset to (0, 0) ○ .getMinX() ○ .getMinY() ● Tile grid to larger canvas ○ Offset to (0,0) ○ .getTileGridXOffset() ○ .getTileGridYOffset() ● Tiles allow working with larger than memory rasters.
  • 34. Relationship with AWT Image: PlanarImage ● Abstracts over ○ Image in memory ○ Image source ○ Operation DAG ● Does not expose TileCache ● Does not expose TileScheduler ● Execution does not happen until ○ .getData(bbox) ○ .getTile(x, y) ● Exposes Direct Acyclic Graph for deferred Operations ○ .getSources ○ .getSinks JAI
  • 35.
  • 36. Deferred Execution Read CropWarpSource Encode PNG/JPEG Tile cache One tile at a time: handle images larger than memory Allows also to compute multiple tiles in parallel, one per thread Adds the basis for distributed computation (given the right tile cache)
  • 39. JAI/JAI-EXT Entanglements How deep are the roots of this thing? What are we going to snag when we pull on it? ● jai-ext source: ○ public abstract class WarpOpImage extends javax.media.jai.WarpOpImage ● jai-ext implements concurrent TileCache ● TileScheduler is not concurrent ● Use of TileCache and TileScheduler is of course hidden from jai-ext ops ○ Most operations are driven by RenderedImage.getData ● TileScheduler is also hidden from jai-ext ○ Although … it is not not use Java Executors. ● So it is … possible
  • 41. RPE
  • 42. JAI ParameterBlock Example FileSeekableStream stream = new FileSeekableStream(args[0]); RenderedOp image1 = JAI.create(“stream”, stream); ParameterBlock params = new ParameterBlock(); params.addSource(image1); params.add(2.0F); // x scale factor params.add(2.0F); // y scale factor params.add(0.0F); // x translate params.add(0.0F); // y translate params.add(Interpolation.INTERP_BILINEAR); /* Create an operator to scale image1. */ RenderedOp image2 = JAI.create(“scale”, params, hints);
  • 43. FileSeekableStream stream = new FileSeekableStream(args[0]); RenderedOp image1 = JAI.create(“stream”, stream); RenderedOp image2 = ScaleDescriptor.create(image1,2.0F, 2.0F, 0.0F, 0.0F,Interpolate.INTERP_BILINEAR, hints); JAI Descriptor Example
  • 44. Raster Processing Engine Example FileSeekableStream stream = new FileSeekableStream(args[0]); Operation image1 = ImageRead.stream(fileSeekableStream) Operation image2 = Affine.source(image1) .scale(2.0F,2.0F) .interpolation(Interpolation.BILINEAR).create();
  • 46. Audit of GeoTools and GeoServer Use
  • 47. But wait ... Oracle is using JAI inside their database product!Oracle has just donated Java Enterprise Edition to the Eclipse Foundation, forming the Jakarta project. I wonder if Oracle would donate the JAI interfaces to us? It would save a lot of time. Answer is perhaps, just one more release? Huh? “1.10 Oracle Multimedia Architecture” Oracle Database Online Documentation 11g Release 1 (11.1)
  • 49. Q: Will JAI Work with Java 11? ● Pure java implementation on the CLASSPATH should work ○ We have not tried it with the module system ● The JRE “standard extensions” system was removed in Java 9 ○ Replaced by “jigsaw” module system
  • 50. JAI Descriptor Example FileSeekableStream stream = new FileSeekableStream(args[0]); RenderedOp image1 = JAI.create(“stream”, stream); RenderedOp image2 = ScaleDescriptor.create( image, 2.0F, 2.0F, 0.0F, 0.0F, Interpolate.INTERP_BILINEAR, null); JAI and RPE Compared RPE Operation Example FileSeekableStream stream = new FileSeekableStream(args[0]); Operation image1 = ImageRead.stream(fileSeekableStream); Operation image2 = Affine.source(image1) .scale(2.0F,2.0F) .interpolation(Interpolation.BILINEAR) .create();
  • 51. JAI and RPE Compared JAI ParameterBlock Example FileSeekableStream stream = new FileSeekableStream(args[0]); RenderedOp image1 = JAI.create(“stream”, stream); ParameterBlock params = new ParameterBlock(); params.addSource(image1); params.add(2.0F); // x scale factor params.add(2.0F); // y scale factor params.add(0.0F); // x translate params.add(0.0F); // y translate params.add(Interpolation.INTERP_BILINEAR); RenderedOp image2 = JAI.create(“scale”, params); RPE Operation Example FileSeekableStream stream = new FileSeekableStream(args[0]); Operation image1 = ImageRead.stream(fileSeekableStream) Operation image2 = Affine.source(image1) .scale(2.0F,2.0F) .interpolation(Interpolation.BILINEAR) .create();
  • 52. References - Java Advanced Imaging API Home Page (Oracle) - Introduction to the Java(TM) Advanced Imaging API (SlideShare)