Toolkits for GeoScience Visualization - PowerPoint PPT Presentation

1 / 41
About This Presentation
Title:

Toolkits for GeoScience Visualization

Description:

Variable var = (Variable)variables.get(i); Array array = var.read(); NetCDF example ... List vlist = var.getAttributes(); Attribute attrib = vlist.get(i) ... – PowerPoint PPT presentation

Number of Views:304
Avg rating:3.0/5.0
Slides: 42
Provided by: daven
Category:

less

Transcript and Presenter's Notes

Title: Toolkits for GeoScience Visualization


1
Toolkits forGeoScience Visualization
  • Dave Nadeau, John Moreland
  • SDSC

2
Tools for custom visualization
  • Lots of great GeoVis tools out there
  • What if you need something custom?
  • Convert to/from a custom file format
  • Analyze and filter data
  • Custom visualization and interaction
  • Lets look at some toolkits for building tools

3
Tools for custom visualization
  • Java Image I/O
  • GeoTIFF
  • Java OpenGL
  • GeoTools
  • WorldWind
  • NetCDF

4
Java Image I/O
  • Sun Java toolkit for image file read/write
  • Many formats
  • BMP, GIF, PNG, JPEG, JPEG2000, TIFF
  • Also use advanced imaging toolkit for filtering
  • Standard part of Java
  • http//java.sun.com/

5
Java Image I/O example
  • Get an image reader

ImageInputStream stream ImageIO.createImageI
nputStream(file) IteratorltImageReadergt it
ImageIO.getImageReaders(stream) ImageReader
reader it.next() reader.setInput(stream)
6
Java Image I/O example
  • Read the image
  • Display the image

BufferedImage image reader.read(0)
ImageIcon icon new ImageIcon(image) Jlabel
label new Jlabel(icon) frame.add(label,Border
Layout.CENTER)
7
Java Image I/O example
8
GeoTIFF
  • TIFF image format with Geo tags
  • Coordinate space, position, extent
  • Readable by TIFF tools (Java Image I/O)
  • GeoTIFF metadata adapter understands tags
  • Open Source
  • http//remotesensing.org/geotiff/
  • http//gelbin.org/code/

9
GeoTIFF example
  • Get a TIFF image reader (same!)

ImageInputStream stream ImageIO.createImageI
nputStream(file) IteratorltImageReadergt it
ImageIO.getImageReaders(stream) ImageReader
reader it.next() reader.setInput(stream)
10
GeoTIFF example
  • Read the image (same!)
  • Display the image (same!)

BufferedImage image reader.read(0)
ImageIcon icon new ImageIcon(image) Jlabel
label new Jlabel(icon) frame.add(label,Border
Layout.CENTER)
11
GeoTIFF example
  • Get the GeoTIFF metadata

IIOMetadata meta reader.getImageMetadata(0) Geo
TiffIIOMetadataAdapter ameta new
GeoTiffIIOMetadataAdapter(meta) String value
ameta.getGeoKey(key)
12
GeoTIFF example
  • Available keys
  • GTModelTypeGeoKey
  • GTRasterTypeGeoKey
  • GTCitationGeoKey
  • GeographicTypeGeoKey
  • GeogCitationGeoKey
  • GeogGeodeticDatumGeoKey
  • GeogPrimeMeridianGeoKey
  • GeogPrimeMeridianLongGeoKey
  • GeogLinearUnitsGeoKey
  • GeogLinearUnitSizeGeoKey
  • GeogAngularUnitsGeoKey
  • GeogAngularUnitsSizeGeoKey
  • GeogEllipsoidGeoKey
  • GeogSemiMajorAxisGeoKey
  • GeogSemiMinorAxisGeoKey
  • GeogInvFlatteningGeoKey
  • GeogAzimuthUnitsGeoKey
  • ProjCenterLongGeoKey
  • ProjCenterLatGeoKey
  • ProjCenterEastingGeoKey
  • ProjCenterNorthingGeoKey
  • ProjScaleAtNatOriginGeoKey
  • ProjScaleAtCenterGeoKey
  • ProjAzimuthAngleGeoKey
  • ProjStraightVertPoleLongGeoKey
  • VerticalCSTypeGeoKey
  • VerticalCitationGeoKey
  • VerticalDatumGeoKey
  • VerticalUnitsGeoKey
  • ProjectedCSTypeGeoKey
  • PCSCitationGeoKey
  • ProjectionGeoKey
  • ProjCoordTransGeoKey
  • ProjLinearUnitsGeoKey
  • ProjLinearUnitSizeGeoKey
  • ProjStdParallel1GeoKey
  • ProjStdParallel2GeoKey
  • ProjNatOriginLongGeoKey
  • ProjNatOriginLatGeoKey
  • ProjFalseEastingGeoKey
  • ProjFalseNorthingGeoKey
  • ProjFalseOriginLongGeoKey
  • ProjFalseOriginLatGeoKey
  • ProjFalseOriginEastingGeoKey
  • ProjFalseOriginNorthingGeoKey

13
GeoTIFF example
14
Java OpenGL (JOGL)
  • Sun Java toolkit for OpenGL 3D drawing
  • Uses native OpenGL to 3D graphics hardware
  • Integrates with rest of Java toolkit
  • Not part of Java distribution, but easily added
  • https//jogl.dev.java.net/

15
Java OpenGL (JOGL)
  • Draw points, lines, polygons
  • Control point line size, line patterns, polygon
    fill, color, texture
  • Control 3D lighting
  • All done at hardware speeds

16
JOGL example polygons
  • Set a drawing color
  • Draw a polygon

gl.glColor3f(r,g,b)
gl.glBegin(GL.GL_POLYGON) gl.glVertex3f(x,y,z
) ... gl.glEnd()
17
JOGL example polygons
18
JOGL example images
  • Create texture from graphics context
  • Draw shape using texture

Texture tex TextureIO.newTexture(file,false) gl.
glEnable(GL.GL_TEXTURE_2D) tex.bind() tex.enable
()
gl.glTexCoord2f(s,t) gl.glVertex3f(x,y,z)
19
JOGL example images
20
GeoTools
  • Toolkit implementing OGC GeoAPI
  • Read/write many file formats
  • Features, images, geometry, coord spaces
  • WMS, WFS
  • Open source
  • http//geotools.codehaus.org/

21
GeoTools example Shapefile
  • Create a data store to read a file
  • Get the first feature source

DataStore dataStore FileDataStoreFinder.getD
ataStore(url)
String names dataStore.getTypeNames() Feature
Source source dataStore.getFeatureSource(nam
es0)
22
GeoTools example Shapefile
  • Create a map context
  • Add feature source to context

CoordinateReferenceSystem crs
CRS.decode(EPSG4326) DefaultMapContext
context new DefaultMapContext(crs)
context.addLayer(source,new BasicLineStyle())
23
GeoTools example Shapefile
  • Draw the map context

MapContextPanel panel new MapContextPanel() pan
el.setContext(context) frame.add(panel,BorderLayo
ut.CENTER)
24
GeoTools example Shapefile
25
NetCDF
  • Network Common Data Form
  • File format toolkit to read/write
    multidimensional data (eg Volumes)
  • Support for many programming languages (such as
    Java)
  • University Corporation for Atmospheric Research
    (UCAR) / UNAVCO
  • http//www.unidata.ucar.edu/software/netcdf/

26
NetCDF
  • Variables hold multidimensional data values
  • char, byte, short, int, float, double
  • Attributes hold meta-data
  • Units, names, scale factors, etc.
  • Attributes can be global or associated with each
    variable

27
NetCDF example
  • Open a NetCDF file
  • Get data variables

NetcdfFile ncfile NetcdfFile.open(file)
List variables ncfile.getVariables() Variable
var (Variable)variables.get(i) Array array
var.read()
28
NetCDF example
  • Get variable dimensions
  • Get voxels

int rank var.getRank() int shape
array.getShape()
double voxel ((ArrayDouble.D3)array).get(i,j
,k)
29
NetCDF example
  • Get global or variable attributes
  • Get attribute type and value

List glist ncfile.getGlobalAttributes() List
vlist var.getAttributes() Attribute attrib
vlist.get(i)
DataType type attrib.getDataType() Number num
attrib.getNumericValue(i) String str
attrib.getStringValue(i)
30
NetCDF example
  • Build an image

BufferedImage image new BufferedImage(w,h) int
gray (int)(voxel 255) int rgba (grayltlt24)
(grayltlt16) ... image.setRGB(row,col,rgba)
31
NetCDF example
32
NASA World Wind (NWW)
  • Open-Source Google Earth
  • Toolkit (modular library for building
    applications)
  • Versions for .NET (Windows) and Java (Mac,
    Windows, UNIX)
  • Tiled Terrain and Images, WMS, Plug-in Layers, 3D
    Rendering (JOGL)
  • NASA / ARC (Ames Research Center)
  • http//worldwind.arc.nasa.gov/

33
NWW HelloWorldWind example
  • Create a canvas
  • Set a data model
  • Add canvas to your application interface

WorldWindGLCanvas c new WorldWindGLCanvas()
c.setModel( new BasicModel() )
frame.add( c )
34
NWW HelloWorldWind output
35
NWW LayerDemo example
  • Create a surface image
  • Make it semi-transparent
  • Add the image to a renderable layer

SurfaceImage si new SurfaceImage( Map.png,
Sector.fromDegrees(35, 45, -115, -95) )
si.setOpacity( 0.7 )
RenderableLayer rl new RenderableLayer() rl.add
Renderable( si )
36
NWW LayerDemo example
  • Get the LayerList from the model
  • Add our image layer

LayerList layers model.getLayers( )
layers.add( layers.size(), rl )
37
NWW LayerDemo output
38
NWW WmsDemo example
  • Create a WMS Layer
  • Get the LayerList from the model
  • Add the WMS layer

OpenStreetMapLayer osnewOpenStreetMapLayer()
LayerList layers model.getLayers( )
layers.add( layers.size(), os )
39
NWW WmsDemo output
40
Conclusions
  • Lots of good Java toolkits available
  • Image I/O Sun Java Image I/O
  • Image filtering Sun Java Advanced Imaging
  • GeoTIFF GeoTools, WorldWind, GeoTIFF adapter
  • Movie I/O Sun Java Media Framework
  • Shapefile I/O GeoTools
  • Volume I/O NetCDF, HDF
  • Metadata Sun Java Metadata Interface
  • GUIs Sun JDK, SwingX
  • 3D Sun JOGL, Sun Java3D
  • Projections GeoTools, SRI GeoTransform
  • GML, WFS GeoTools
  • WMS GeoTools, WorldWind
  • Net protocols Sun JDK, Apache Commons net, Apache
    HTTP components
  • Web protocols Sun Metro, Apache Web Services
  • lots more

41
Open Earth Framework
  • Services architecture
  • Server-side data management, filtering,
    pre-processing
  • Client-side presentation, interaction
  • Java toolkit
  • Integrates other toolkits
  • Adds missing GeoVis functionality
  • In development
Write a Comment
User Comments (0)
About PowerShow.com