Introduction to Oracle Spatial Using Public Data Richard L. Flores Isinglass, Inc. [email_address]
 
About Me <ul><li>Schooling in Geology and Business. </li></ul><ul><li>16 years working with Geographical Information Syste...
Reading Material <ul><li>Clearly written with wonderful, downloadable examples for you to work through. </li></ul><ul><li>...
Reading Material <ul><li>Wide ranging topics on the FREE acquisition of data and tools for the processing of geographic da...
Agenda <ul><li>Geographic Data Processing </li></ul><ul><li>Cartography 101 </li></ul><ul><li>Oracle Spatial Products </li...
Geographic Data Processing The Processing Steps <ul><li>Data Acquisition </li></ul><ul><li>Preliminary Data Processing </l...
Geogaphic Data Processing Data Acquisition <ul><li>Sources </li></ul><ul><ul><li>Global Positioning Systems (GPS) </li></u...
Geogaphic Data Processing Preliminary Data Processing <ul><li>May Involve </li></ul><ul><ul><li>Digitization of paper maps...
Geogaphic Data Processing Data Storage and Retrieval <ul><li>For Oracle </li></ul><ul><ul><li>Storage </li></ul></ul><ul><...
Geogaphic Data Processing Display, Analysis, and Interaction. <ul><ul><ul><li>Not many free programs that work with Oracle...
Cartography 101 The Shape of the Earth: Some Facts <ul><li>To accurately place a point on the earth, the general shape of ...
Cartography 101  The Shape of the Earth: North American Datum <ul><li>Older maps used  NAD27   </li></ul><ul><li>Newer map...
Cartography 101  Spatial Reference Systems <ul><li>SRS  are coordinate-based systems used to locate geographical entities....
Cartography 101 Why are SRS important? <ul><li>During analysis, if all spatial data is not in the same Spatial Reference S...
Cartography 101 Why are SRS important?
Cartography 101 Why are SRS important? <ul><li>During analysis, if an inappropriate Spatial Reference System is chosen, yo...
Cartography 101 Why are SRS important? <ul><li>If you were interested in using a map to measure land areas, you would prob...
Cartography 101 Geodetic Coordinate System <ul><li>Latitude/Longitude expressed in Degrees/Minutes/Seconds or Decimal Degr...
Cartography 101 Geodetic Coordinate System
Cartography 101  Projected Coordinate Systems
Cartography 101  State Plane Coordinate Systems <ul><li>Each state has defined SPCS zones which are popular for local- and...
Cartography 101   Projected Coordinate Systems <ul><li>Select map projection for display based on: </li></ul><ul><ul><li>H...
Oracle Products Oracle Locator <ul><li>Includes </li></ul><ul><ul><li>Geographic Data Model </li></ul></ul><ul><ul><li>Que...
Oracle Products Oracle Spatial Option <ul><li>Includes </li></ul><ul><ul><li>All Oracle Locator features </li></ul></ul><u...
Oracle Spatial General <ul><li>“ An integrated set of functions and procedures that enables spatial data to be stored, acc...
Oracle Spatial Some Definitions <ul><li>The are other, more complex elements, including collections of one or more element...
Oracle Spatial More on Geometries and Layers Table, STATES = LAYER A GEOMETRY (outline) of a state is in a single column o...
Oracle Spatial by Example Scenario <ul><li>You wish to open an upscale beauty salon in central Contra Costa county, Califo...
Oracle Spatial by Example Identify Types and Sources of Data Needed to Support Decision <ul><li>Competitors: Internet Sear...
Oracle Spatial by Example Competitor Data: Table CREATE TABLE beauty (id  NUMBER(38), name  VARCHAR2(100), full_address  V...
Oracle Spatial by Example Competitor Data: Spatial Metadata INSERT INTO user_sdo_geom_metadata VALUES  ('BEAUTY',  -- Geom...
Oracle Spatial by Example Competitor Data: Spatial Index CREATE INDEX beauty_spatial_idx ON beauty (location) INDEXTYPE IS...
Oracle Spatial by Example Competitor Data: Source Name  ---------------- ID NAME FULL_ADDRESS CITY_STATE STREET_NUMBER STR...
Oracle Spatial by Example Competitor Data: Geocoding <ul><li>The Geocoder will  </li></ul><ul><ul><li>Standardize Address ...
Oracle Spatial by Example Competitor Data: Geocoding Solution: Use Perl Program against internet geocoding website. #!/usr...
Oracle Spatial by Example Competitor Data: Geocoding simplest_xmlrpc.pl “1355 N. Main, Walnut Creek, CA&quot; $VAR1 = [ { ...
Oracle Spatial by Example Competitor Data: SDO_GEOMETRY Object-Relational Type UPDATE beauty SET location  = SDO_GEOMETRY ...
Oracle Spatial by Example Competitor Data: Data Display <ul><li>eSpatial iSmart Explorer free on OTN </li></ul><ul><li>OEM...
Oracle Spatial by Example Non-Spatial Demographic Data: Table CREATE TABLE census_data ( CENSUS_TRACT  VARCHAR2(10)NOT NUL...
Oracle Spatial by Example Non-Spatial Demographic Data: Source CENSUS_TRACT  MED_HOUSE_INCOME FEMALE_GE_40 GENDER_TOTAL --...
Oracle Spatial by Example Spatial Census Tract Data: Source <ul><li>www.census.gov/geo/www/cob/tr_metadata.html </li></ul>...
Oracle Spatial by Example Spatial Census Tract Data: Pre-processing <ul><li>shp2sdo  utility downloadable from Oracle will...
Oracle Spatial by Example Spatial Census Tract Data: Loading   census_tract.sql DROP TABLE CENSUS_TRACTS; CREATE TABLE CEN...
Oracle Spatial by Example Spatial Census Tract Data: Loading <ul><li>In SQL*Plus: </li></ul><ul><li>connect spatial/spatia...
Oracle Spatial by Example Spatial Census Tract Data: Display <ul><li>Census tract outlines. </li></ul><ul><li>You can “CRE...
Oracle Spatial by Example Road Data: Source <ul><li>seamless.usgs.gov </li></ul><ul><li>Bureau of Transportation Statistic...
Oracle Spatial by Example Road Data: Display
Oracle Spatial by Example Analysis: Criteria Definition <ul><li>Within 2 miles of census tracts in which </li></ul><ul><ul...
Oracle Spatial by Example Analysis: Oracle Spatial Buffers Polygon Line String Point Buffered Geometry Original Geometry
Oracle Spatial by Example Analysis: Target Census Tract Buffer CREATE TABLE target_tract_buffer AS SELECT  SDO_AGGR_UNION ...
Oracle Spatial by Example Analysis: Target Census Tract Buffer SDO_GEOM.SDO_BUFFER SDO_AGGR_UNION Original Points
Oracle Spatial by Example Analysis: Target Census Tract Buffer
Oracle Spatial by Example Analysis: Major Road Buffer CREATE TABLE road_buffer AS SELECT prefix, name, type, suffix,  SDO_...
Oracle Spatial by Example Analysis: Major Road Buffer
Oracle Spatial by Example Analysis: Competitor Buffer
Oracle Spatial by Example Analysis: Spatial Operations Intersection Minus
Oracle Spatial by Example Analysis: Spatial Operations CREATE TABLE target_site_wocomp AS SELECT  SDO_AGGR_UNION (SDOAGGRT...
Oracle Spatial by Example Analysis: Spatial Operations CREATE TABLE target_site AS SELECT  SDO_AGGR_UNIION (SDOAGGRTYPE(a....
Oracle Spatial by Example Analysis: Final Display
Introduction to Oracle Spatial Using Public Data Any Questions?
Upcoming SlideShare
Loading in...5
×

Introoraspatial

1,351

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,351
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
62
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Introoraspatial

    1. 1. Introduction to Oracle Spatial Using Public Data Richard L. Flores Isinglass, Inc. [email_address]
    2. 3. About Me <ul><li>Schooling in Geology and Business. </li></ul><ul><li>16 years working with Geographical Information Systems and Computer Mapping in the Oil & Gas Industry. </li></ul><ul><li>15 years working with Oracle, mostly as DBA. </li></ul><ul><li>Sporadic experience with Oracle Spatial since late Oracle 7. </li></ul>
    3. 4. Reading Material <ul><li>Clearly written with wonderful, downloadable examples for you to work through. </li></ul><ul><li>Covers most features of Oracle Spatial. </li></ul>
    4. 5. Reading Material <ul><li>Wide ranging topics on the FREE acquisition of data and tools for the processing of geographic data. </li></ul><ul><li>Great tips and insight on the field of Electronic Cartography. </li></ul>
    5. 6. Agenda <ul><li>Geographic Data Processing </li></ul><ul><li>Cartography 101 </li></ul><ul><li>Oracle Spatial Products </li></ul><ul><li>Oracle Spatial Basics by Example </li></ul>
    6. 7. Geographic Data Processing The Processing Steps <ul><li>Data Acquisition </li></ul><ul><li>Preliminary Data Processing </li></ul><ul><li>Data Storage and Retrieval </li></ul><ul><li>Graphical Display (Visualization), Analysis, and Interaction. </li></ul>
    7. 8. Geogaphic Data Processing Data Acquisition <ul><li>Sources </li></ul><ul><ul><li>Global Positioning Systems (GPS) </li></ul></ul><ul><ul><li>Published and Unpublished </li></ul></ul><ul><ul><li>Free and Commercial </li></ul></ul><ul><li>Formats </li></ul><ul><ul><li>Vector: shapefiles, DLG, DXF, NTF, etc. </li></ul></ul><ul><ul><li>Raster: TIFF, GIF, etc. </li></ul></ul>
    8. 9. Geogaphic Data Processing Preliminary Data Processing <ul><li>May Involve </li></ul><ul><ul><li>Digitization of paper maps </li></ul></ul><ul><ul><li>Vectorization of raster images </li></ul></ul><ul><ul><li>Transformation of Mapping Coordinates </li></ul></ul><ul><ul><li>Geocoding: calculation of geographic coordinates from street addresses. </li></ul></ul>
    9. 10. Geogaphic Data Processing Data Storage and Retrieval <ul><li>For Oracle </li></ul><ul><ul><li>Storage </li></ul></ul><ul><ul><ul><li>Use of Oracle’s Geographic Data Model </li></ul></ul></ul><ul><ul><ul><li>Database design for the integration of spatial and non-spatial data </li></ul></ul></ul><ul><ul><ul><li>SQL and SQL*Loader for loading data in Oracle. </li></ul></ul></ul><ul><ul><ul><li>Oracle’s “shapefile” to “SDO” utility. </li></ul></ul></ul><ul><ul><li>Retrieval </li></ul></ul><ul><ul><ul><li>It all comes down to SQL using Oracle Spatial stored procedures. </li></ul></ul></ul>
    10. 11. Geogaphic Data Processing Display, Analysis, and Interaction. <ul><ul><ul><li>Not many free programs that work with Oracle Spatial directly, unfortunately. </li></ul></ul></ul><ul><ul><ul><li>Many commercial programs for displaying and interactively querying and editing Oracle Spatial data such as those from ESRI, Intergraph, MapInfo, Autodesk, eSpatial, and Acquis. </li></ul></ul></ul>
    11. 12. Cartography 101 The Shape of the Earth: Some Facts <ul><li>To accurately place a point on the earth, the general shape of the earth must be known. These shape models are called, datums . </li></ul><ul><li>The earth is not flat. 1 </li></ul><ul><li>The earth is not a perfect sphere. </li></ul><ul><li>The earth’s general shape is best described by a theoretical surface called a geoid . </li></ul><ul><li>For mapping, geoids are approximated by reference ellipsoids . </li></ul>1 Assertions of the Flat Earth Society notwithstanding.
    12. 13. Cartography 101 The Shape of the Earth: North American Datum <ul><li>Older maps used NAD27 </li></ul><ul><li>Newer maps use the more accurate NAD83 made using satellites and sophisticated electronic equipment. </li></ul><ul><li>Worldwide GPS use a datum compatible to NAD83 called WGS84 </li></ul><ul><li>The coordinates for a point on the earth can vary significantly depending on the datum used. </li></ul>
    13. 14. Cartography 101 Spatial Reference Systems <ul><li>SRS are coordinate-based systems used to locate geographical entities. </li></ul><ul><li>Oracle Geographic SRS Types </li></ul><ul><ul><li>Geodetic : Latitude & Longitude </li></ul></ul><ul><ul><li>Projected Coordinate Systems : X & Y where globe is mathematically “projected” onto a flat map. </li></ul></ul>
    14. 15. Cartography 101 Why are SRS important? <ul><li>During analysis, if all spatial data is not in the same Spatial Reference System, the geographic layers will not overlay and the analysis will be in error. </li></ul>
    15. 16. Cartography 101 Why are SRS important?
    16. 17. Cartography 101 Why are SRS important? <ul><li>During analysis, if an inappropriate Spatial Reference System is chosen, you may introduce unacceptable distortion into your maps. </li></ul>
    17. 18. Cartography 101 Why are SRS important? <ul><li>If you were interested in using a map to measure land areas, you would probably not use this Spatial Reference System. </li></ul>
    18. 19. Cartography 101 Geodetic Coordinate System <ul><li>Latitude/Longitude expressed in Degrees/Minutes/Seconds or Decimal Degrees </li></ul><ul><li>Parallels: Lines of latitude North (+) & South (-) of Equator (-90 to +90) </li></ul><ul><li>Meridians: Lines of longitude East (+) & West (-) of the Prime Meridian (-180 to +180) </li></ul><ul><li>Oracle Uses Decimal Degrees in the odd order, Longitude/Latitude </li></ul>
    19. 20. Cartography 101 Geodetic Coordinate System
    20. 21. Cartography 101 Projected Coordinate Systems
    21. 22. Cartography 101 State Plane Coordinate Systems <ul><li>Each state has defined SPCS zones which are popular for local- and state-sized areas because of their accuracy. </li></ul><ul><li>“ Tall” States, such as TX and CA use the Lambert Conformal Conic Projection. </li></ul><ul><li>“ Wide” States, such as NY use Transverse Mercator Projection. </li></ul>California Zone III, 0403 Texas South Central Zone, 4204
    22. 23. Cartography 101 Projected Coordinate Systems <ul><li>Select map projection for display based on: </li></ul><ul><ul><li>How you intend to use the data </li></ul></ul><ul><ul><li>The size and location of the area of interest </li></ul></ul><ul><ul><li>The metric property of the map you wish to preserve: </li></ul></ul><ul><ul><ul><li>Shape </li></ul></ul></ul><ul><ul><ul><li>Area </li></ul></ul></ul><ul><ul><ul><li>Distance </li></ul></ul></ul><ul><ul><ul><li>Direction </li></ul></ul></ul><ul><ul><ul><li>Scale </li></ul></ul></ul><ul><li>See erg.usgs.gov/isb/pubs/MapProjections/projections.html </li></ul>
    23. 24. Oracle Products Oracle Locator <ul><li>Includes </li></ul><ul><ul><li>Geographic Data Model </li></ul></ul><ul><ul><li>Query and Analysis using the Index Engine </li></ul></ul><ul><ul><li>Some advanced geometric functions </li></ul></ul><ul><li>Free with the Standard or Enterprise Edition </li></ul>
    24. 25. Oracle Products Oracle Spatial Option <ul><li>Includes </li></ul><ul><ul><li>All Oracle Locator features </li></ul></ul><ul><ul><li>More advanced spatial functions </li></ul></ul><ul><ul><li>Location enabling geocoder </li></ul></ul><ul><ul><li>Advanced features such as routing, network analysis, and georaster. </li></ul></ul><ul><li>Added-cost option with the Enterprise Edition </li></ul>
    25. 26. Oracle Spatial General <ul><li>“ An integrated set of functions and procedures that enables spatial data to be stored, accessed, and analyzed quickly and efficiently in an Oracle database.” </li></ul><ul><ul><li>A schema (MDSYS) that prescribes the storage, syntax, and semantics of supported geometric data types. </li></ul></ul><ul><ul><li>A spatial indexing mechanism </li></ul></ul><ul><ul><li>A set of operators and functions for performing area-of-interest queries, spatial join queries, and other spatial analyis operations. </li></ul></ul><ul><ul><li>Administrative utilities. </li></ul></ul>
    26. 27. Oracle Spatial Some Definitions <ul><li>The are other, more complex elements, including collections of one or more elements called Geometries . </li></ul><ul><li>A Layer is collection of Geometries having similar attributes such a state boundaries, roads, or rivers. </li></ul>Basic Spatial Elements Point Line String N-Point Polygon
    27. 28. Oracle Spatial More on Geometries and Layers Table, STATES = LAYER A GEOMETRY (outline) of a state is in a single column of each row. A GEOMETRY may contain more than one element. Arkansas Arizona Alaska Alabama
    28. 29. Oracle Spatial by Example Scenario <ul><li>You wish to open an upscale beauty salon in central Contra Costa county, California, catering to wealthier, older women. </li></ul><ul><li>You would like to be close to a major thoroughfare for ease of access. </li></ul><ul><li>You don’t want to be too close to any competitors. </li></ul>
    29. 30. Oracle Spatial by Example Identify Types and Sources of Data Needed to Support Decision <ul><li>Competitors: Internet Search Engine </li></ul><ul><li>Demographic (Age, Gender, Income): U.S. Census Bureau </li></ul><ul><li>Roads: U.S. Geological Survey </li></ul>
    30. 31. Oracle Spatial by Example Competitor Data: Table CREATE TABLE beauty (id NUMBER(38), name VARCHAR2(100), full_address VARCHAR2(100), city_state VARCHAR2(50), street_number VARCHAR2(10), street_name VARCHAR2(20), street_type VARCHAR2(15), street_prefix VARCHAR2(10), street_suffix VARCHAR2(10), city VARCHAR2(40), state VARCHAR2(2), postal_code VARCHAR2(16), location MDSYS.SDO_GEOMETRY);
    31. 32. Oracle Spatial by Example Competitor Data: Spatial Metadata INSERT INTO user_sdo_geom_metadata VALUES ('BEAUTY', -- Geometry Table 'LOCATION', -- Geometry Column SDO_DIM_ARRY ( SDO_DIM_ELEMENT ('LONGITUDE', -- Longitude Text -180, -- Lower Boundary 180, -- Upper Boundary 0.5), -- Tolerance SDO_DIM_ELEMENT ('LATITUDE', -- Latitude Text -90, -- Lower Boundary 90, -- Upper Boundary 0.5) -- Tolerance ), 8307 -- (SRID) Datum:WGS84 );
    32. 33. Oracle Spatial by Example Competitor Data: Spatial Index CREATE INDEX beauty_spatial_idx ON beauty (location) INDEXTYPE IS MDSYS.SPATIAL_INDEX ; <ul><li>R-Tree Index </li></ul><ul><li>These are unlike regular Oracle indexes and special steps must be taken with their administration. </li></ul>
    33. 34. Oracle Spatial by Example Competitor Data: Source Name ---------------- ID NAME FULL_ADDRESS CITY_STATE STREET_NUMBER STREET_NAME STREET_TYPE STREET_PREFIX STREET_SUFFIX CITY STATE POSTAL_CODE LOCATION Extract list of competitors and their addresses from Search Engine. While very useful, it doesn’t provide any directly mappable data.
    34. 35. Oracle Spatial by Example Competitor Data: Geocoding <ul><li>The Geocoder will </li></ul><ul><ul><li>Standardize Address Name and, </li></ul></ul><ul><ul><li>Using a database with the coordinates and street addresses of each intersection, </li></ul></ul><ul><ul><li>Interpolate the location of the given address. </li></ul></ul><ul><li>Oracle Spatial Option geocoder: added-cost </li></ul><ul><li>Third party sells spatial database used to calculate the coordinates </li></ul>
    35. 36. Oracle Spatial by Example Competitor Data: Geocoding Solution: Use Perl Program against internet geocoding website. #!/usr/local/bin/perl # simplest_xmlrpc.pl use XMLRPC::Lite; use Data::Dumper; use strict; use warnings; my $where = shift @ARGV or die &quot;Usage: $0 &quot;1 Main St, Anytown, KS&quot; &quot;; my $result = XMLRPC::Lite -> proxy( 'http://rpc.geocoder.us/service/xmlrpc' ) -> geocode ($where) -> result; print Dumper $result; From Mapping Hacks, Tips & Tools for Electronic Mapping
    36. 37. Oracle Spatial by Example Competitor Data: Geocoding simplest_xmlrpc.pl “1355 N. Main, Walnut Creek, CA&quot; $VAR1 = [ { 'number' => '1355', 'street' => 'Main', 'lat' => '37.898365', 'state' => 'CA', 'city' => 'Walnut Creek', 'zip' => '94596', 'suffix' => '', 'long' => '-122.060445', 'type' => 'St', 'prefix' => 'N' } ]; Name ---------------- ID NAME FULL_ADDRESS CITY_STATE STREET_NUMBER STREET_NAME STREET_TYPE STREET_PREFIX STREET_SUFFIX CITY STATE POSTAL_CODE LOCATION
    37. 38. Oracle Spatial by Example Competitor Data: SDO_GEOMETRY Object-Relational Type UPDATE beauty SET location = SDO_GEOMETRY (2001, -- Geometry Type: 2-D Point 8307, -- SRID, Datum: WGS84 SDO_POINT_TYPE (-122.060445, -- Longitude 37.898365, -- Latitude NULL), NULL, NULL ) WHERE id = 430;
    38. 39. Oracle Spatial by Example Competitor Data: Data Display <ul><li>eSpatial iSmart Explorer free on OTN </li></ul><ul><li>OEM Spatial Index Advisor </li></ul><ul><li>Oracle Mapviewer </li></ul><ul><li>For serious users, many commercial products. </li></ul>Martinez Orinda Dublin Clayton
    39. 40. Oracle Spatial by Example Non-Spatial Demographic Data: Table CREATE TABLE census_data ( CENSUS_TRACT VARCHAR2(10)NOT NULL, MED_HOUSE_INCOME NUMBER(38), GENDER_TOTAL NUMBER(38), FEMALE_GE_40 NUMBER(38));
    40. 41. Oracle Spatial by Example Non-Spatial Demographic Data: Source CENSUS_TRACT MED_HOUSE_INCOME FEMALE_GE_40 GENDER_TOTAL --------------- ---------------- ------------ ------------ 3010 44871 975 3355 3020.02 58769 1467 8475 * * * * * * * <ul><li>U.S. Census Bureau </li></ul><ul><li>factfinder.census.gov </li></ul><ul><li>“ Download Center” </li></ul><ul><li>Select detailed or summarized data by state, county, and census tract. </li></ul>
    41. 42. Oracle Spatial by Example Spatial Census Tract Data: Source <ul><li>www.census.gov/geo/www/cob/tr_metadata.html </li></ul><ul><li>Has geographic boundaries of Census Tracts which can be loaded into Oracle Spatial. </li></ul><ul><li>Choose state and “ARCVIEW Shapefile” format to download file for California. These files are sometimes called “ESRI Shapefiles”. </li></ul>
    42. 43. Oracle Spatial by Example Spatial Census Tract Data: Pre-processing <ul><li>shp2sdo utility downloadable from Oracle will create SQL and SQL*Loader data and control files for creating Spatial objects and loading shapefile data into Oracle Spatial. </li></ul>Creates: census_tracts.sql, census_tracts.ctl, census_tracts.dat ./shp2sdo.exe tr06_d00 census_tracts -g geom -x (-180,180) -y (-90,90) -s 8307 -t 0.5 -v Shapefile Name Prefix Table Name Column Name Longitude Limits Latitude Limits SRID Tolerance
    43. 44. Oracle Spatial by Example Spatial Census Tract Data: Loading census_tract.sql DROP TABLE CENSUS_TRACTS; CREATE TABLE CENSUS_TRACTS ( AREA NUMBER, PERIMETER NUMBER, TR06_D00_ NUMBER, TR06_D00_I NUMBER, STATE VARCHAR2(2), COUNTY VARCHAR2(3), TRACT VARCHAR2(6), NAME VARCHAR2(90), LSAD VARCHAR2(2), LSAD_TRANS VARCHAR2(50), GEOM MDSYS.SDO_GEOMETRY);
    44. 45. Oracle Spatial by Example Spatial Census Tract Data: Loading <ul><li>In SQL*Plus: </li></ul><ul><li>connect spatial/spatial </li></ul><ul><li>@census_tracts.sql </li></ul><ul><li>Run SQL*Loader: </li></ul><ul><li>sqlldr spatial/spatial census_tracts </li></ul><ul><li>In SQL*Plus: </li></ul><ul><li>connect spatial/spatial </li></ul><ul><li>EXECUTE SDO_MIGRATE.TO_CURRENT(‘CENSUS_TRACTS’,’GEOM)’ </li></ul>
    45. 46. Oracle Spatial by Example Spatial Census Tract Data: Display <ul><li>Census tract outlines. </li></ul><ul><li>You can “CREATE TABLE SELECT AS” on state=’06’ and county=‘013’ to get just Contra Costa county. </li></ul>
    46. 47. Oracle Spatial by Example Road Data: Source <ul><li>seamless.usgs.gov </li></ul><ul><li>Bureau of Transportation Statistics from U.S. Geological Survey. </li></ul><ul><li>shapefiles </li></ul>
    47. 48. Oracle Spatial by Example Road Data: Display
    48. 49. Oracle Spatial by Example Analysis: Criteria Definition <ul><li>Within 2 miles of census tracts in which </li></ul><ul><ul><li>The Median Household Annual Income is greater then $100K and </li></ul></ul><ul><ul><li>Over 30% of the people are women 40 years or older </li></ul></ul><ul><li>Within ½ mile of a major thoroughfare </li></ul><ul><li>Not within ½ mile of a competitor </li></ul>
    49. 50. Oracle Spatial by Example Analysis: Oracle Spatial Buffers Polygon Line String Point Buffered Geometry Original Geometry
    50. 51. Oracle Spatial by Example Analysis: Target Census Tract Buffer CREATE TABLE target_tract_buffer AS SELECT SDO_AGGR_UNION (SDOAGGRTYPE( SDOAGGRTYPE( SDO_GEOM.SDO_BUFFER ( a.geom, -- geometry column 2.00, -- Distance 0.5, 'arc_tolerance=0.005 unit=mile'), -- Units 0.5)) geom FROM census_tracts a, census_data b WHERE b.census_tract = a.name AND b.med_house_income >=100000 AND b.female_ge_40/b.gender_total >= 0.30 AND a.state = '06' AND a.county = '013';
    51. 52. Oracle Spatial by Example Analysis: Target Census Tract Buffer SDO_GEOM.SDO_BUFFER SDO_AGGR_UNION Original Points
    52. 53. Oracle Spatial by Example Analysis: Target Census Tract Buffer
    53. 54. Oracle Spatial by Example Analysis: Major Road Buffer CREATE TABLE road_buffer AS SELECT prefix, name, type, suffix, SDO_AGGR_UNION( SDOAGGRTYPE( SDO_GEOM.SDO_BUFFER( a.geom, -- geometry column 0.50, -- Distance 0.5, 'arc_tolerance=0.005 unit=mile'), -- Units 0.5)) geom FROM roads a WHERE (name = 'ACALANES' AND type = 'AVE') OR (name = 'ACALANES' AND type = 'RD') * * * * * * * * OR (name = 'YGNACIO VALLEY' AND type = 'RD');
    54. 55. Oracle Spatial by Example Analysis: Major Road Buffer
    55. 56. Oracle Spatial by Example Analysis: Competitor Buffer
    56. 57. Oracle Spatial by Example Analysis: Spatial Operations Intersection Minus
    57. 58. Oracle Spatial by Example Analysis: Spatial Operations CREATE TABLE target_site_wocomp AS SELECT SDO_AGGR_UNION (SDOAGGRTYPE(c.geom,0.5)) geom FROM (SELECT SDO_GEOM.SDO_INTERSECTION ( a.geom, b.geom, 0.5) geom FROM target_tract_buffer a,road_buffer b) c);
    58. 59. Oracle Spatial by Example Analysis: Spatial Operations CREATE TABLE target_site AS SELECT SDO_AGGR_UNIION (SDOAGGRTYPE(a.geom,0.5)) geom FROM (SELECT SDO_GEOM.SDO_DIFFERENCE ( b.geom, c.geom, 0.5) geom FROM target_site_wocomp b,competitor_buffer c) a; -- Create spatial metadata and index for target_site -- and target_site_wocomp after creation.
    59. 60. Oracle Spatial by Example Analysis: Final Display
    60. 61. Introduction to Oracle Spatial Using Public Data Any Questions?
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×