raster algebra mit oracle spatial und udig
TRANSCRIPT
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Oracle Spatial Technologies Integration with Open Source Tools
Karin Patenge | [email protected] Principal Sales ConsultantOracle Deutschland B.V. & Co. KG23-OCT-2014
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
LocationTech Meeting October 23, 2014Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 3
Safe Harbor StatementThe preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 4
Agenda
Why Open Source?
Libraries, Desktop GIS, Web Mapping, Data
Oracle Spatial and Graph at a Glance
Geospatial Applications with uDIG and Oracle Spatial
Useful Material and Links
1
2
3
4
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
5
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 5
Agenda
Why Open Source?
Libraries, Desktop GIS, Web Mapping, Data
Oracle Spatial and Graph at a Glance
Geospatial Applications with uDig and Oracle Spatial
Useful Material and Links
1
2
3
4
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
5
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 11
Open Source and Oracle
• Oracle is involved in a large number of Open Source activities– developing, testing, optimizing software and contributing code– investing in MySQL, Glassfish, Linux, Apache, BerkeleyDB, InnoDB, Xen and many
more
• It is common to see projects that combine Open Source and Oracle tools– Oracle infrastructure (database, middleware)– Commercial GIS tools for data editing and analysis– Open Source GIS tools for web mapping and web services
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 12
Geo Open Source Organizations
• OSGeo– Open Source Geospatial Foundation– Supports the major projects
• Free and Open Source Software for Geospatial (FOSS4G) conferences– Attracts significant crowds
• Oracle contribution to Geo Open Source projects– E.g. Ivan Lucena (Developer Oracle Spatial Team): Contributor to
• GDAL GeoRaster driver and • uDig Integration with GeoRaster
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 13
Agenda
Why Open Source?
Libraries, Desktop GIS, Web Mapping, Data
Oracle Spatial and Graph at a Glance
Geospatial Applications with uDig and Oracle Spatial
Useful Material and Links
1
2
3
4
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
5
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 14
APIs and Libraries
Name URL Technology Oracle Vector ?SDO_GEOMETRY
Oracle Raster ?SDO_GEORASTER
Point CloudsSDO_PC
GDAL/OGR http://www.gdal.org/ C/C++ Yes Yes
GeoTools http://www.geotools.org/ Java Yes Yes
FDO http://fdo.osgeo.org/ C/C++ Yes No
libLAS http://www.liblas.org/ * C/C++ Yes
LAStools http://www.cs.unc.edu/~isenburg/lastools/
C/C++
PDAL http://www.pointcloud.org/ C/C++
JTS http://www.vividsolutions.com/jts/ Java N/Ap N/Ap
OpenLayers http://openlayers.org/ Javascript
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
* Superseded by LAStools (Martin Isenburg) as of 2014
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 23
Desktop Tools
Name URL Technology Oracle Vector ?SDO_GEOMETRY
Oracle Raster ?SDO_GEORASTER
Grass http://grass.osgeo.org/ C/C++ Yes ?
Quantum GIS (QGIS) http://www.qgis.org/ C/C++ Yes Yes
gvSIG http://www.gvsig.org/ Java Yes No
Kosmo http://www.opengis.es/ Java Yes No
uDig http://udig.refractions.net/ Java Yes Yes
OpenJump http://www.openjump.org/ Java No No
MapWindows http://www.mapwindow.org/ C#/.NET Yes No
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 31
Web Mapping Services
URL Technology Oracle Vector ?SDO_GEOMETRY
Oracle Raster ?SDO_GEORASTER
Mapserver http://mapserver.org/ C/C++ Yes Yes
MapGuide http://mapguide.osgeo.org/ Yes No
GeoServer http://geoserver.org/ Java Yes Yes
Deegree http://www.deegree.org/ Java Yes Yes
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 36
Data
• Open Data Initiatives• „Crowd“ Sourced
– OpenStreetMap http://www.openstreetmap.org/ – OpenSeaMap http://openseamap.org/
• State-Collected Spatial Data• Recommended Standards
– GML, WMS, WFS-T– Dublin Core, RDF, ISO19115 through ISO19139 (for metadata)
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 37
Agenda
Why Open Source?
Libraries, Desktop GIS, Web Mapping, Data
Oracle Spatial and Graph at a Glance
Geospatial Applications with uDig and Oracle Spatial
Useful Material and Links
1
2
3
4
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
5
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 38
Brief Intro: Oracle Spatial and Graph (DB EE Option)In-Database Datatypes, Models, Processing, Analysis and Mining
Vector Data (2D)
Spatial Indexing (R-Tree)
Coordinate System Transformations
Spatial Queries
Routing
Vector Performance Accelerator
Geocoding
Geo Web Services
Vector Data (3D, 4D)
Spatial and Graph
Locator
Georaster, Raster Algebra
Topologies & Network Data Model
Semantic Networks, Ontologies, SPARQL, GeoSPARQL
Advanced Spatial Analysis and Mining
Point Clouds, TINs
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 39
Rasterdata Management and Analysis with Oracle Spatial
• A data type to store raster data– Satellite images, remote sensing data, digital elevation models– Multi-band, multi-spectral– An XML schema to store Metadata
• Data source, layer information
– Geo Referencing information
• Functionality– Storage and indexing of raster data
• No size limit for each raster object
– Generate resolution pyramid– Query and analysis
• Used e.g. http://geoproxy.de
SDO_GEORASTER
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 40
New in Oracle Database 12c for Georaster
• Server-side raster algebra operations• Work on individual raster cells, or pixels to…
– Generate new raster layer (map) from two or more raster layers
• Application example– Combine two or more hazard maps to produce a risk map
In-Database Raster Algebra
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 41
Agenda
Why Open Source?
Libraries, Desktop GIS, Web Mapping, Data
Oracle Spatial and Graph at a Glance
Geospatial Applications with uDig and Oracle Spatial
Useful Material and Links
1
2
3
4
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
5
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 42
Source:Technical Workshop given by Ivan Lucena (Oracle) and Jody Garnett (Boundless)at Location Intelligence Summit 2014– http://www.locationintelligence.net/dc/workshops/– http://www.oracle.com/technetwork/database/options/spatialandgraph/comm
unity/sagsummit-2014-2196705.html
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 43
Use Prebuilt Hands-On Workshop
• Virtual Maschine available for Virtual Box 4.3 available via: – http://www.oracle.com/technetwork/d
atabase/options/spatialandgraph/community/sagsummit-2014-2196705.html#GeospatialApplications
– Additional Material to be downloaded and unzipped• See Instructions• http://www.locationintelligence.net/temp/2
014/Workshop6Material.zip
First Steps
– Start VirtualBox– Select the virtual machine– Click the green arrow icon– The machine starts– Wait for the login prompt– Select Workshop 6– The password is workshop– Change Keyboard Preferences
to use German Layout
Hands-On Oracle Spatial and uDig for Rasterdata
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 44
Learning objective: Raster Data Workflow using Oracle Spatial and uDig
• Expected Final Product:– NDVI (Normalized Differenced Vegetation Index) Map
• Data– Exploring Napa Valley Wine Country Data
• Steps1. Load spatial data into database2. Validate and visualize data3. Perform server-side (in-database) raster operations4. Perform server-side (in-database) map algebra5. Generate vegetation index map6. Map composition
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 45
Step 1: Load Spatial Data into Oracle Database
• Use GDAL – 1 Landsat image– 1 Elevation grid– 7 Vector layers
• GDAL is shipped with Oracle Database 12c
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 46
Load Landsat Image
1. On VM desktop, double-click workshop’s Home
2. On window Workshop, double-click Data
3. On window Data, double-click Landsat
4. On window Landsat, double-click loadit.sh
5. Select Run in Terminal
Step 1 continued
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 49
Load Elevation Grid
1. On VM desktop, double-click workshop’s Home
2. On window Workshop, double-click Data
3. On window Data, double-click Napa GIS Elevation
4. On window Napa GIS Elevation, double-click loadit.sh
5. Select Run in Terminal
Step 1 continued
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 50
Load Vector Layers
1. On VM desktop, double-click workshop’s Home
2. On window Workshop, double-click Data
3. On window Data, double-click Napa GIS Shapefiles
4. On window Napa GIS Shapefiles, double-click loadall.sh
5. Select Run in Terminal
Step 1 continued
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 51
Step 2: Validate and Visualize Spatial Data
• Use GeoRasterViewer and uDig• GeoRasterViewer is normally shipped with Oracle Database Examples
– $ORACLE_HOME/md/demo/georaster/java/startGeoRasterViewer.sh
• Visualize vector data with Oracle SQL Developer– Shipped with Oracle Database
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 52
Connect to Oracle Database
1. On the VM desktop, double-click GeoRasterView
2. From the menu, select Rasters and then Retrieve from DB
3. Enter database connection information:Host name localhostPort number 1521Database name ora12cUser name studentPassword student
4. Click on OK
Step 2 continued using GeoRasterViewer
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 53
Launch Landsat Image
1. Double-click USER: student
2. Double-click SCHEMA: student
3. Double-click TABLE: napa_landsat
4. Double-click COLUMN: image
5. Click on RDT: NAPA_LANDSAT_RDT$
6. With cursor over image:− Right-click to zoom out
− Left-click to zoom in
7. Click tab Metadata tab to inspect thethe GeoRaster metadata
Step 2 continued using GeoRasterViewer
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 54
Launch Elevation Grid
1. Double-click USER: student
2. Double-click SCHEMA: student
3. Double-click TABLE: napa_elevation
4. Double-click COLUMN: image
5. Click on RDT: NAPA_ELEVATION_RDT$
6. With cursor over image:− Right-click to zoom out
− Left-click to zoom in
7. Click tab Metadata tab to inspect thethe GeoRaster metadata
Step 2 continued using GeoRasterViewer
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 55
Change Layer Mapping
1. From the menu View select:− Show user ID
− Show cell value
− Show layer mapping
2. On the panel at the bottom rightselect a layer for Red, Green and Blue
3. Click on Refresh
Step 2 continued using GeoRasterViewer
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 56
Connect to Oracle Database1. On the VM desktop, double-click on uDig - User-
friendly Desktop GIS
2. On uDig menu, select Layer, select Add
3. On Add Data wizard, page Data Sources, select Oracle Spatial
4. Click on Next > and enter:Host name localhostPort number 1521User name studentPassword studentDatabase name ora12cInstance student
5. Click on Connect
6. Click on Next >
Step 2 continued using uDig
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 57
Select Oracle Spatial Layer
1. Select NAPA_FIELDS
2. Click on Finish
Step 2 continued using uDig
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 58
Select Features based on Query
1. Click on tab Table
2. Enter a Query, ex.: COPPOLA and press Enter
3. Right-click on the selected row and select Show Selection to automatically zoom to the selected feature
Step 2 continued using uDig
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 59
Step 3: Perform in-database raster operations
• Performed operations– Creating tables
• Data Type SDO_GEORASTER pointing to raster data table (RDT) with SDO_RASTER
– Subsetting raster• Using SDO_GEOR.SUBSET with parameter polygonClip = FALSE ( MBR)• Performs one or both of the following operations: (1) spatial crop, cut or clip or (2) layer or band subset
or duplicate
– RGB composition• Using SDO_GEOR.SUBSET using parameter layerNumbers
– Clipping by geometry• Using SDO_GEOR.SUBSET with parameter polygonClip = TRUE
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 60
Create Georaster Tables
1. Open workshop’s Home
2. Open Scripts
3. Open lab-02.sh
4. Select Run in Terminal
Step 3 continued
Documentation:http://docs.oracle.com/database/121/GEORS/geor_operations.htm#GEORS986
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 61
Subset Georaster
1. Open workshop’s Home
2. Open Scripts
3. Open lab-01.sh
4. Select Run in Terminal
Step 3 continued
Documentation:http://docs.oracle.com/database/121/GEORS/geor_ref.htm#GEORS1139
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 62
Create RGB Composition
1. Open workshop’s Home
2. Open Scripts
3. Open lab-03.sh
4. Select Run in Terminal
Step 3 continued
Documentation:http://docs.oracle.com/database/121/GEORS/geor_ref.htm#GEORS1139
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 63
Clip Polygon
1. Open workshop’s Home
2. Open Scripts
3. Open lab-04.sh
4. Select Run in Terminal
Step 3 continued
Documentation:http://docs.oracle.com/database/121/GEORS/geor_ref.htm#GEORS1139
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 64
Step 4: Perform Raster Analysis
• New PL/SQL Package in 12c: SDO_GEOR_RA• Performed operations
– Elevation grid• Calculate statistics
– Using SDO_GEOR.GENERATESTATISTICS• Classify raster
– Using SDO_GEOR_RA.CLASSIFY• Apply a color-map
– Using SDO_GEOR.SETCOLORMAP
– Landsat• Raster Algebra e.g. NDVI (Normalized
Differential Vegetation Index)− Using SDO_GEOR_RA.RASTERMATHOP
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 65
Calculate Statistics
1. Open workshop’s Home
2. Open Scripts
3. Open lab-05.sh
4. Select Run in Terminal
Step 4 continued
Documentation:http://docs.oracle.com/database/121/GEORS/geor_ref.htm#GEORS1035
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 66
Classify Georaster
1. Open workshop’s Home
2. Open Scripts
3. Open lab-06.sh
4. Select Run in Terminal
Step 4 continued
Documentation:http://docs.oracle.com/database/121/GEORS/geor_ra_ref.htm#GEORS1227
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 67
Apply Color-Map
1. Open workshop’s Home
2. Open Scripts
3. Open lab-07.sh
4. Select Run in Terminal
Step 4 continued
Documentation:http://docs.oracle.com/database/121/GEORS/geor_ref.htm#GEORS1051
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 68
Calculate NDVI
1. Open workshop’s Home
2. Open Scripts
3. Open lab-08.sh
4. Select Run in Terminal
Step 4 continued
Documentation:http://docs.oracle.com/database/121/GEORS/geor_ra_ref.htm#GEORS1296
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 69
Apply Color-Map to NVDI
1. Open workshop’s Home
2. Open Scripts
3. Open lab-09.sh
4. Select Run in Terminal
Step 4 continued
Documentation:http://docs.oracle.com/database/121/GEORS/geor_ref.htm#GEORS1051
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 71
Agenda
Why Open Source?
Libraries, Desktop GIS, Web Mapping, Data
Oracle Spatial and Graph at a Glance
Geospatial Applications with uDig and Oracle Spatial
Useful Material and Links
1
2
3
4
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
5
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 72
Useful Links
• Materials for Workshop „Developling Geospatial Applications with uDig and Oracle Spatial“ including prebuilt VM for Virtual Box– http://www.oracle.com/technetwork/database/options/spatialandgraph/community/
sagsummit-2014-2196705.html
• Oracle Spatial and Graph Online Documentation on OTN (12c)– http://docs.oracle.com/database/121/nav/portal_7.htm
• Oracle Spatial Technologies on OTN– http://www.oracle.com/technetwork/database/options/spatialandgraph– http://www.oracle.com/technetwork/middleware/mapviewer
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 73
Social Media, Communities
• Blogs– http://oracle-spatial.blogspot.com/, http://oracle-maps.blogspot.com (DE)– https://blogs.oracle.com/oraclespatial/, https://blogs.oracle.com/oracle_maps_blog/
• Twitter– @kpatenge @cczarski
• LinkedIn– https://www.linkedin.com/groups/Oracle-Spatial-Graph-1848520?gid=1848520
• Forums– https://community.oracle.com/community/database/oracle-database-options/spatial– https://community.oracle.com/community/fusion_middleware/application_server/mapviewer
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 74
Events
• Save the Date!– Oracle Spatial Summit 2015 (Januar y 25-27, 2015, Oracle HQ, Redwood Shores, CA)
• http://www.oracle.com/technetwork/database/options/spatialandgraph/learnmore/spatial-events-495802.html
• Past Conference Sessions and Presentations– http://www.oracle.com/technetwork/database/options/spatialandgraph/learnmore/s
patial-presentation-idx-086691.html
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
http://oracle-spatial.blogspot.com/Twitter: @kpatenge
LocationTech Meeting Oct 23, 2014 in Hamburg, Germany
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 76LocationTech Meeting Oct 23, 2014 in Hamburg, Germany