storing and analyzing grid data using oracle spatial and java

18
1 Storing and Analyzing GRID Data Storing and Analyzing GRID Data Using Oracle Spatial and Java Using Oracle Spatial and Java February 2007 February 2007

Upload: bshughes

Post on 10-Jul-2015

1.078 views

Category:

Lifestyle


0 download

DESCRIPTION

This presentation was created and given by myself to an Oracle Special Interest Group (SIG) in Reading. The presentation is about storing National Land Coverage (GRID) Data in Oracle Spatial, and using iSMART Technology to view and analyze the data. All development work was performed by Professional Services, eSpatial Solutions Ltd.

TRANSCRIPT

Page 1: Storing and Analyzing GRID Data Using Oracle Spatial and Java

1

Storing and Analyzing GRID Data Storing and Analyzing GRID Data Using Oracle Spatial and JavaUsing Oracle Spatial and Java

February 2007February 2007

Page 2: Storing and Analyzing GRID Data Using Oracle Spatial and Java

Copyright ©eSpatial 2007

2

RequirementsRequirements

Page 3: Storing and Analyzing GRID Data Using Oracle Spatial and Java

Copyright ©eSpatial 2007

3

RequirementsRequirements

Load United States Geological Survey National Land Coverage Database into Oracle

• Entire continental United States of America

Make it available for viewing via the Internet• Rapid data viewing of any part of or the entire dataset at any scale

Provide for analysis of the data• Image filtering…• Image transparency…• Image clipping… • Land-use charts for clipped areas…• Clipped image export…• And so on!

Page 4: Storing and Analyzing GRID Data Using Oracle Spatial and Java

Copyright ©eSpatial 2007

4

Data Load – The DataData Load – The Data

NLCD 1992 data covering the entire continental USA – 13.8GB

NLCD 2001 data covering the entire continental USA – (only a small sample is currently available) – 2GB

NLCD 1992 – 2001 Change data covering the entire continental USA (the same small sample is currently available) – 2GB

NLCD Impervious Surface data covering the entire continental USA (ditto) – 200MB

Various vector data e.g. States, Counties, Roads, Rivers and Places – 520MB

Page 5: Storing and Analyzing GRID Data Using Oracle Spatial and Java

Copyright ©eSpatial 2007

5

Data Load – A ProblemData Load – A Problem

NLCD 1992 was held as different sized tiles which overlapped

Page 6: Storing and Analyzing GRID Data Using Oracle Spatial and Java

Copyright ©eSpatial 2007

6

Data Load – Another ProblemData Load – Another Problem

Adjacent states were represented by black space

Page 7: Storing and Analyzing GRID Data Using Oracle Spatial and Java

Copyright ©eSpatial 2007

7

Data Load – The SolutionData Load – The Solution

Create uniform data tiles with no overlapping areas and no black space so a mosaic could be created

Page 8: Storing and Analyzing GRID Data Using Oracle Spatial and Java

Copyright ©eSpatial 2007

8

Data Load – The SolutionData Load – The Solution

No proprietary tools were found to be suitable so…

Custom code was developed using the Java Imaging API that worked in two phases….

Create a grid of empty tiles using… • java -Xmx768M -cp %CLASSPATH% com.espatial.ps.GridTiler

-sourceDir "C:\NLCD\Downloaded" -tileDir "C:NLCD\Tiled" -op CREATETILES -tileSize 5000 -tilePrefix tile

Populate the empty tiles using….• java –Xmx768M -cp %CLASSPATH% com.espatial.ps.GridTiler

-sourceDir "C:\NLCD\Downloaded" -tileDir "C:\NLCD\Tiled" -op MERGEDIRECTORY -tileSize 5000 -tilePrefix tile

Page 9: Storing and Analyzing GRID Data Using Oracle Spatial and Java

Copyright ©eSpatial 2007

9

Data Load – The SolutionData Load – The Solution

Page 10: Storing and Analyzing GRID Data Using Oracle Spatial and Java

Copyright ©eSpatial 2007

10

Data Load – The LoadData Load – The Load

31x2 tiles of data were loaded into 10 separate tables using the Oracle Geo-raster loader e.g.

• java -Xmx512M -cp %CLASSPATH% oracle.spatial.georaster.tools.GeoRasterLoader DARKSIDE ORCL 1521 NLCD PWD thin 32 T NLCD_TILED_ROW_001 GEORASTER "blocking=true blocksize=(1024,1024,1)" "tiled\tile_001_001.tif,1, NLCD_TILED_ROW_001_RDT,Tiled\tile_001_001.tfw,1000000“

10 mosaics were created from 10x62 tiles and inserted into a temporary table using…• SDO_GEOR.MOSAIC('NLCD_TILED_ROW_001','GEORASTER', GEOR_V, NULL);

The 10 mosaics were merged into a single mosaic using the same command

9 pyramid levels were created to provide rapid viewing of the data at all scales using• SDO_GEOR.GENERATEPYRAMID(GEOR_V, ‘RESAMPLING=NN’);

The intermediate tables were dropped leaving a single table (for the NLCD 1992 data) of approximately 15GB

Page 11: Storing and Analyzing GRID Data Using Oracle Spatial and Java

Copyright ©eSpatial 2007

11

Data Load – The Result Data Load – The Result

Page 12: Storing and Analyzing GRID Data Using Oracle Spatial and Java

Copyright ©eSpatial 2007

12

ViewingViewing

Deployed on Oracle 10g Application Server

Uses Oracle 10g Database as the data store

The mapping engine is eSpatial’s iSMART

Written using HTML, JSP, Java and Java Script

No plug-ins or downloads

Uses third-party JSP tags for the graphing

Page 13: Storing and Analyzing GRID Data Using Oracle Spatial and Java

Copyright ©eSpatial 2007

13

Analysis – Image FilteringAnalysis – Image Filtering

Grid cell values representing a specific land-use can be made non-visible providing a visual method of estimating land-use change

Page 14: Storing and Analyzing GRID Data Using Oracle Spatial and Java

Copyright ©eSpatial 2007

14

Data Load – Animation Data Load – Animation

Page 15: Storing and Analyzing GRID Data Using Oracle Spatial and Java

Copyright ©eSpatial 2007

15

Analysis – Image FilteringAnalysis – Image Filtering

A layer class is used to represent a map layer. Sub-classes exist that represent specific geographic data layers e.g. vectorLayer, ordImageLayer, geoRasterLayer etc. The geoRasterLayer class was modified to provide image filtering

The geoRasterLayer object is intercepted before the map image is built and returned to the client. The image data member is accessed and the grid cell values representing a specific land-use are made wholly transparent

The Java Imaging API is employed to perform the image manipulation i.e.• java.awt.image.WritableRaster wr = bi.getRaster();

• for () { //loop through every cell• wr.setSample(c, r, 0, 0);

• }• bi.setData(wr);

Although every cell is accessed we are processing an image pyramid layer which is consistently small so the code is fast (15 milliseconds)

Page 16: Storing and Analyzing GRID Data Using Oracle Spatial and Java

Copyright ©eSpatial 2007

16

Analysis – TransparencyAnalysis – Transparency

Grid layers can be made transparent so that other layers can be viewed to aid analysis

Page 17: Storing and Analyzing GRID Data Using Oracle Spatial and Java

Copyright ©eSpatial 2007

17

Analysis – Clipping and ChartingAnalysis – Clipping and Charting

Grid layers can be clipped and the resulting area exported for other uses. The land-use within the clipped area can also be charted

Page 18: Storing and Analyzing GRID Data Using Oracle Spatial and Java

Copyright ©eSpatial 2007

18

For more information…For more information…[email protected]@espatial.com

enterprise embedded easy economic effective