Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Storing and Analyzing GRID Data Using Oracle Spatial and Java

1,437 views

Published on

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.

Published in: Lifestyle
  • Be the first to comment

  • Be the first to like this

Storing and Analyzing GRID Data Using Oracle Spatial and Java

  1. 1. Storing and Analyzing GRID Data Using Oracle Spatial and Java February 2007
  2. 2. Requirements
  3. 3. Requirements <ul><li>Load United States Geological Survey National Land Coverage Database into Oracle </li></ul><ul><ul><li>Entire continental United States of America </li></ul></ul><ul><li>Make it available for viewing via the Internet </li></ul><ul><ul><li>Rapid data viewing of any part of or the entire dataset at any scale </li></ul></ul><ul><li>Provide for analysis of the data </li></ul><ul><ul><li>Image filtering… </li></ul></ul><ul><ul><li>Image transparency… </li></ul></ul><ul><ul><li>Image clipping… </li></ul></ul><ul><ul><li>Land-use charts for clipped areas… </li></ul></ul><ul><ul><li>Clipped image export… </li></ul></ul><ul><ul><li>And so on! </li></ul></ul>
  4. 4. Data Load – The Data <ul><li>NLCD 1992 data covering the entire continental USA – 13.8GB </li></ul><ul><li>NLCD 2001 data covering the entire continental USA – (only a small sample is currently available) – 2GB </li></ul><ul><li>NLCD 1992 – 2001 Change data covering the entire continental USA (the same small sample is currently available) – 2GB </li></ul><ul><li>NLCD Impervious Surface data covering the entire continental USA (ditto) – 200MB </li></ul><ul><li>Various vector data e.g. States, Counties, Roads, Rivers and Places – 520MB </li></ul>
  5. 5. Data Load – A Problem <ul><li>NLCD 1992 was held as different sized tiles which overlapped </li></ul>
  6. 6. Data Load – Another Problem <ul><li>Adjacent states were represented by black space </li></ul>
  7. 7. Data Load – The Solution <ul><li>Create uniform data tiles with no overlapping areas and no black space so a mosaic could be created </li></ul>
  8. 8. Data Load – The Solution <ul><li>No proprietary tools were found to be suitable so… </li></ul><ul><li>Custom code was developed using the Java Imaging API that worked in two phases…. </li></ul><ul><li>Create a grid of empty tiles using… </li></ul><ul><ul><li>java -Xmx768M -cp %CLASSPATH% com.espatial.ps.GridTiler -sourceDir &quot;C:NLCDDownloaded&quot; -tileDir &quot;C:NLCDTiled&quot; -op CREATETILES -tileSize 5000 -tilePrefix tile </li></ul></ul><ul><li>Populate the empty tiles using…. </li></ul><ul><ul><li>java –Xmx768M -cp %CLASSPATH% com.espatial.ps.GridTiler -sourceDir &quot;C:NLCDDownloaded&quot; -tileDir &quot;C:NLCDTiled&quot; -op MERGEDIRECTORY -tileSize 5000 -tilePrefix tile </li></ul></ul>
  9. 9. Data Load – The Solution
  10. 10. Data Load – The Load <ul><li>31x2 tiles of data were loaded into 10 separate tables using the Oracle Geo-raster loader e.g. </li></ul><ul><ul><li>java -Xmx512M -cp %CLASSPATH% oracle.spatial.georaster.tools.GeoRasterLoader DARKSIDE ORCL 1521 NLCD PWD thin 32 T NLCD_TILED_ROW_001 GEORASTER &quot;blocking=true blocksize=(1024,1024,1)&quot; &quot;tiled ile_001_001.tif,1, NLCD_TILED_ROW_001_RDT,Tiled ile_001_001.tfw,1000000“ </li></ul></ul><ul><li>10 mosaics were created from 10x62 tiles and inserted into a temporary table using… </li></ul><ul><ul><li>SDO_GEOR.MOSAIC('NLCD_TILED_ROW_001','GEORASTER', GEOR_V, NULL); </li></ul></ul><ul><li>The 10 mosaics were merged into a single mosaic using the same command </li></ul><ul><li>9 pyramid levels were created to provide rapid viewing of the data at all scales using </li></ul><ul><ul><li>SDO_GEOR.GENERATEPYRAMID(GEOR_V, ‘RESAMPLING=NN’); </li></ul></ul><ul><li>The intermediate tables were dropped leaving a single table (for the NLCD 1992 data) of approximately 15GB </li></ul>
  11. 11. Data Load – The Result
  12. 12. Viewing <ul><li>Deployed on Oracle 10g Application Server </li></ul><ul><li>Uses Oracle 10g Database as the data store </li></ul><ul><li>The mapping engine is eSpatial’s iSMART </li></ul><ul><li>Written using HTML, JSP, Java and Java Script </li></ul><ul><li>No plug-ins or downloads </li></ul><ul><li>Uses third-party JSP tags for the graphing </li></ul>
  13. 13. Analysis – Image Filtering <ul><li>Grid cell values representing a specific land-use can be made non-visible providing a visual method of estimating land-use change </li></ul>
  14. 14. Data Load – Animation
  15. 15. Analysis – Image Filtering <ul><li>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 </li></ul><ul><li>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 </li></ul><ul><li>The Java Imaging API is employed to perform the image manipulation i.e. </li></ul><ul><ul><li>java.awt.image.WritableRaster wr = bi.getRaster(); </li></ul></ul><ul><ul><ul><li>for () { //loop through every cell </li></ul></ul></ul><ul><ul><ul><ul><li>wr.setSample(c, r, 0, 0); </li></ul></ul></ul></ul><ul><ul><ul><li>} </li></ul></ul></ul><ul><ul><li>bi.setData(wr); </li></ul></ul><ul><li>Although every cell is accessed we are processing an image pyramid layer which is consistently small so the code is fast (15 milliseconds) </li></ul>
  16. 16. Analysis – Transparency <ul><li>Grid layers can be made transparent so that other layers can be viewed to aid analysis </li></ul>
  17. 17. Analysis – Clipping and Charting <ul><li>Grid layers can be clipped and the resulting area exported for other uses. The land-use within the clipped area can also be charted </li></ul>
  18. 18. For more information… www.espatial.com [email_address] e nterprise e mbedded e asy e conomic e ffective

×