SlideShare a Scribd company logo
Bradley D. Brown, brad@intelivideo.com
InteliVideo, CTO
Agenda
Who am I?
Geospatial 101
How have I Used GeoSpatial Data?
Options Available – Mapping Solutions
Things I’ve Developed with Maps
How to Get Started
Technical Details
Spatial Queries
Who am I?
Bradley D. Brown                               Today
Founder                                        • Technical CTO (write code)
• TUSC in 1988                                 • Reglara and Enscicon Boards
  • Questor 1992                               • Rolta, Board Advisor
  • GUI Shootout 1994                          • Equifax employee
  • Sold to Rolta in 2008                      • InteliVideo in April 2012
• IntelliReal in 2005
                                                 • Video Monetization Platform
  • Sold to Equifax in 2011
                                                 • Built it to sell training online
• 10+ other companies, boards
                                                 • Focused on mid and long tail
Professor – DU                                     and corporate deals and DVD
Author – 6 technical books                         duplication guys
Mentor in Founders Institute

                 brad@intelivideo.com or http://bradleydbrown.blogspot.com
Geospatial 101
• Mapping Solutions
• Your data vs. mapping data
• Lat / Long vs. Polygon
• Uses and Advantages
• Address Normalization
Geospatial 101
Mapping Solutions – SaaS Solutions
Google Maps
• http://maps.google.com/
• MapsGL
Bing Maps
• http://www.bing.com/maps/
Google Earth
• KML File
Geospatial 101
Mapping Solutions – Spatial, Premise and SaaS

Oracle Spatial vs. Locator
Navtec, ESRI, etc. data in your own DB
Oracle ApEx Has Built-in Mapping
Other Hosted Solutions
• Open Street       Integraph
• Virtual Earth     Natural Earth
• ESRI              Maps for Free
Geospatial 101
Your data vs. mapping data

Your Data
• Customers
• Properties / Homes
• Inventory
Mapping Data
• Maps – Google, etc.
• Shape Files
• In / Nearest
Geospatial 101
Lat / Long vs. Polygon
Lat / Long
• Point on the map
Polygon/Shape
• Group of points
• Shape File
  • Shapes
  • Metadata
Can measure “in” for
polygons or “nearest” for
points
Geospatial 101
Uses and Advantages

Why Use?                       Using it to your
• Glitzy / Sexy / Looks good   advantage
• Intelligence about your      • Directions, Other
  customers, your data,          “Similar”
  etc.                           items, Connecting things
                               • Nearby Gas
                                 Stations, Railroad
                                 tracks, Boundaries
Geospatial 101
Address Normalization and Geocoding an Address

Address Normalization
• Zip+4
 • http://www.semaphorecorp.com/cgi/zp4.html
• CorrectAddress
 • http://www1.intelligentsearch.com/address-verification/correct-
   address.htm
• Google API
Geocoding an Address
• Google Geocoding API
 • https://developers.google.com/maps/documentation/geocoding/
• Web Service APIs
Hopefully something will spark ideas for you!
How Have I Used Geospatial Data

IntelliReal
• Considerable geo data, knowledge, etc.
TUSC
• Embedded into several apps at TUSC (ACT)
Independent Nation
• Political mapping solution
InteliVideo
• Where are people connecting from?
Heat Maps
A look at different neighborhood trends in home values
GeoSearch
Visual Slice and Dice – home type, bedrooms, bathrooms, price
Highlight and Visual Search
Find all homes that sold in this area for 20% less than their “value”
Test Scores within a radius
ACT scores
By Zip Code
Google API supports
– Heat Maps
  • Outlines
  • Polygons
– Circles
– Overlays
– Events
With Google Maps or Yahoo or…
Mapping Your Data

Do you have data in your Oracle database that
you would like to visually map?
All you really need is a lat and long (or an
address)
Easy integration Starts At:
• https://developers.google.com/maps/
Simple Pushpins:
Hello World Page
Static HTML page
Copied HTML from
Google page and
pasted here
Dynamic Generation
Data driven mapping
Properties in
Arapahoe County, CO
PL/SQL region with
onload function
True AJAX Mapping
Mapping that pulls
data dynamically
from an XML page
Lat / Long are
passed to XML page
Change the Icons
Any image
Add a Popup Windows on Click
Any information
can popup
Yahoo Pipes
http://pipes.yahoo.com
Yahoo API -YQL
Free Data and APIs from Yahoo
• http://developer.yahoo.com/yql/console/

Local Events
• select * from upcoming.events where woeid in (select woeid from geo.places where
  text="North Beach")

Local Places
• select * from local.search where zip='94085' and query='pizza'
CTOs Perspective on Adding Geospatial and Location-based Information
Neighborhood Comp Boundaries

Create boundaries for a property
• Using roads, water features (lakes, rivers), landmarks (parks), military
  bases and rail roads
Created a function to return this info
• Input is lat/long, but we can change to prop id once we have parcels
  loaded up
• Other inputs – big roads (Y/N), distance (miles from property – 1), min
  distance (0), min length (.1 miles), band (1=1st, 2=2nd, etc.)
Get_Kml is in the notes…
• Will produce a KML file for Google Earth viewing
Boundary Example 1

Major streets
Lakes
Parks
Major features


Square vs. Polygon
Boundary Example 2
Powerful Boundaries
Tons of Free Data!
Tiger
• http://www.census.gov/geo/www/tiger/shp.html
• US Government Project – US Census
UK Census Data
• www.census.ac.uk/casweb
Open Street Maps
• http://www.openstreetmap.org/
• Open Source Collection Group
• It’s free! Maps are more detailed than Google too!
Getting OpenStreetMap Data
“Shape Files”
OpenStreetMap by State
• http://osmdata.thinkgeo.com/openstreetmap-data/north-america/us/
Map Features
Tiger
• http://www.census.gov/geo/www/tiger/tgrshp2012/documentation.html
• www.census.ac.uk/casweb - UK census data

OpenStreetMaps
• http://wiki.openstreetmap.org/wiki/Map_Features

Features
• Addresses, Landmarks (Point and Area), Water (Area and Linear),
  MSAs, Railways, Military Installations, Tab Blocks (Block Groups,
  Blocks), Census Tracts, County, State
Shape Files
• Points and Polygons
• Data (e.g. Road Name, Type)
Point to Point Comparison
Nearest                 “In” or “At”
Area Water (lake)       State

Linear Water (river)    County
                        MSA
Area Landmark (park)
                        City
Area Point (hospital)
                        Census Tract
Schools
                        Block Group
Military Installation
                        Block
Railroad                Latitude, Longitude
                        Address Range
Loading Data Visually using Oracle
MapBuilder
Download at
http://www.oracle.com/technetwork/middleware/mapviewer/downloads/index.htm

l   java –jar MapBuilder.jar
Import Shapefile
Loading Shape Files in Batch
Load Shape to Spatial Data Option (SDO)
http://download.oracle.com/otn/other/spatial/shp2sdo.zip
Creates file structure
If you have multiple files – run the creation only once and create the
spatial index, load the data…
• shp2sdo.exe Tiger DataADDRFEAT tl_2011_01001_addrfeat
  tl_2011_addrfeat -g geometry –f -x (-180,180) -y (-90,90) -s 8307 -t 0.000005 –
  v
• sqlplus username/password @ tl_2011_addrfeat.sql
• CREATE INDEX index_name ON table (geometry) INDEXTYPE IS
  MDSYS.SPATIAL_INDEX
• sqlldr username/password tl_2011_addrfeat
CTOs Perspective on Adding Geospatial and Location-based Information
Water’s Distance from a Property
SELECT SDO_GEOM.SDO_DISTANCE(Geometry,
        sdo_cs.transform(SDO_GEOMETRY(2001, 4269,
        SDO_POINT_TYPE (-
104.958587,39.71464,NULL), NULL, NULL),8307),.01,'unit=mile') distance,
        SDO_GEOM.SDO_AREA(geometry, 0.005, 'unit=acre') area,
        SDO_GEOM.SDO_CENTROID(geometry, 0.005) centroid,
        t.*
FROM TL_2011_08031_AREAWATER t
order by 1;
Nearest x Objects (Address Ranges) to
Property
SELECT SDO_GEOM.SDO_DISTANCE(Geometry,
       sdo_cs.transform(SDO_GEOMETRY(2001, 4269,
       SDO_POINT_TYPE (-104.958587,39.71464,NULL), NULL,
NULL),8307),.01,'unit=mile') distance,
       t.*
FROM TL_2011_08031_ADDRFEAT t
WHERE SDO_NN(geometry, SDO_GEOMETRY(2001, 4269,
       SDO_POINT_TYPE (-104.958587,39.71464,NULL), NULL, NULL),
          'sdo_num_res=1 distance=1 unit=mile') = 'TRUE';
Nearest 5 Landmarks within 10 Miles
SELECT *
FROM TL_2011_08031_AREALM
WHERE SDO_NN(geometry, SDO_GEOMETRY(2001, 4269,
      SDO_POINT_TYPE (-104.958587,39.71464,NULL), NULL, NULL),
          'sdo_num_res=5 distance=10 unit=mile') = 'TRUE';
What Block is this Property In?
SELECT *
FROM TL_2011_08_TABBLOCK
WHERE SDO_WITHIN_DISTANCE(Geometry,
      SDO_GEOMETRY(2001, 4269,
      SDO_POINT_TYPE (-104.958587,39.71464,NULL), NULL, NULL),
      'distance=0 unit=mile') = 'TRUE';
Nearest 5 Schools, Churches and
Shopping Centers
SELECT SDO_GEOM.SDO_DISTANCE(Geometry,
       sdo_cs.transform(SDO_GEOMETRY(2001, 4269,
       SDO_POINT_TYPE (-104.958587,39.71464,NULL), NULL,
NULL),8307),.01,'unit=mile') distance,
          t.*
FROM TL_2011_08031_POINTLM t
WHERE SDO_NN(geometry, SDO_GEOMETRY(2001, 4269,
       SDO_POINT_TYPE (-104.958587,39.71464,NULL), NULL, NULL),
          'sdo_num_res=5 distance=5 unit=mile') = 'TRUE';
Nearest Hospitals in the County
select SDO_GEOM.SDO_DISTANCE(Geometry,
        sdo_cs.transform(SDO_GEOMETRY(2001, 4269,
        SDO_POINT_TYPE (-
104.958587,39.71464,NULL), NULL, NULL),8307),.01,'unit=mile') distance,
        t.*
FROM TL_2011_08031_POINTLM t
where mtfcc = 'K1231';
Nearest River, Creek, etc (Linear Water)
SELECT SDO_GEOM.SDO_DISTANCE(Geometry,
       sdo_cs.transform(SDO_GEOMETRY(2001, 4269,
       SDO_POINT_TYPE (-
104.958587,39.71464,NULL), NULL, NULL),8307),.01,'unit=mile') distance,
       t.*
FROM TL_2011_08031_LINEARWATER t
WHERE SDO_NN(geometry, SDO_GEOMETRY(2001, 4269,
       SDO_POINT_TYPE (-104.958587,39.71464,NULL), NULL, NULL),
       'sdo_num_res=5 distance=5 unit=mile') = 'TRUE'
5 Nearest Railways
SELECT SDO_GEOM.SDO_DISTANCE(Geometry,
       sdo_cs.transform(SDO_GEOMETRY(2001, 4269,
       SDO_POINT_TYPE (-104.958587,39.71464,NULL), NULL,
NULL),8307),.01,'unit=mile') distance,
       t.*
FROM TL_2011_US_RAILS t
WHERE SDO_NN(geometry, SDO_GEOMETRY(2001, 4269,
       SDO_POINT_TYPE (-104.958587,39.71464,NULL), NULL, NULL),
       'sdo_num_res=5 distance=5 unit=mile') = 'TRUE';
Extracting KML for Google Earth
create or replace                                          </PolyStyle>
FUNCTION GET_KML (in_geometry sdo_geometry)               </Style>
RETURN CLOB AS                                            <Placemark>
                                                           <name>Entire</name>
v_output      clob := '';                                  <styleUrl>#transGreenPoly</styleUrl>
                                                           <Polygon>
cursor get_ordinates_cur(in_geometry sdo_geometry) is       <extrude>1</extrude>
SELECT t.x lat, t.y lng                                     <altitudeMode>relativeToGround</altitudeMode>
FROM TABLE(SDO_UTIL.GETVERTICES(in_geometry)) t;            <outerBoundaryIs>
                                                             <LinearRing>
BEGIN                                                         <coordinates>';
 v_output := '                                           for get_ordinates_rec in get_ordinates_cur(in_geometry)
<?xml version="1.0" encoding="UTF-8"?>                  loop
<kml xmlns="http://www.opengis.net/kml/2.2">               dbms_lob.append(v_output,get_ordinates_rec.lat || ',' ||
 <Document>                                             get_ordinates_rec.lng || ',17' || chr(13) || chr(10));
  <Style id="transBluePoly">                             end loop;
   <LineStyle>
    <width>1.5</width>                                   v_output := v_output || '</coordinates>
   </LineStyle>                                              </LinearRing>
   <PolyStyle>                                              </outerBoundaryIs>
    <color>7dff0000</color>                                </Polygon>
   </PolyStyle>                                           </Placemark>
  </Style>                                               </Document>
  <Style id="transGreenPoly">                           </kml>';
   <LineStyle>
    <width>1.5</width>                                   RETURN v_output;
   </LineStyle>
   <PolyStyle>                                          END GET_KML;
    <color>7f00ff00</color>
What Did We Cover?
•   Geospatial 101
•   Ideas on How you Might Use GeoSpatial Data
•   Mapping Solutions
•   How to Get Started
•   Technical Details
•   Spatial Queries


•   Now it’s your turn!
Questions?
Copyright Information

Neither InteliVideo nor the author guarantee this
document to be error-free. Please provide
comments/questions to brad@intelivideo.com.
InteliVideo © 2013. This document cannot be
reproduced without expressed written consent
from an officer of InteliVideo.

More Related Content

PDF
Fifth Annual Event Sustainability Report ORACLE OPENWORLD SAN FRANCISCO
PPS
System oczyszczania wody eSpring
PPTX
Making the most of LinkedIn for New Lawyers
PPTX
Złoty Filar Plus - Auvesta Edelmetalle AG
PDF
Intro To Geospatial
PPTX
SQLBits X SQL Server 2012 Spatial
PDF
MySQL 5.7 GIS
Fifth Annual Event Sustainability Report ORACLE OPENWORLD SAN FRANCISCO
System oczyszczania wody eSpring
Making the most of LinkedIn for New Lawyers
Złoty Filar Plus - Auvesta Edelmetalle AG
Intro To Geospatial
SQLBits X SQL Server 2012 Spatial
MySQL 5.7 GIS

Similar to CTOs Perspective on Adding Geospatial and Location-based Information (20)

PPSX
Web Based GIS LeadGen Introduction
PPT
My GIS Timeline
PPT
Google maps
PPT
Google maps
PPTX
M|18 Building Location-Based Services with Geospatial Data
PPT
Geoservices Activities at EDINA
KEY
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
PPT
Geospatial Web
PDF
This is not your grandmother's online map: Advancing your mission with GIS tools
PPSX
Where the %$#^ Is Everybody? Geospatial Solutions For Oracle APEX
PPT
Solving Mysteries Geographically
PPT
Where2.0Now - Finding the heat in Thematic Maps
PDF
NCGIC The Geospatial Revolution
KEY
Web gis implementation notes
PDF
Database@Home - Maps and Spatial Analyses: How to use them
PPT
The 21st Century Harvard Map
KEY
Geodata creation:past, present and future
PDF
Au09 Presentation Ut118 1
PDF
Open geo data - technical issue
Web Based GIS LeadGen Introduction
My GIS Timeline
Google maps
Google maps
M|18 Building Location-Based Services with Geospatial Data
Geoservices Activities at EDINA
Ioannis Doxaras on GIS and Gmaps at 1st GTUG meetup Greece
Geospatial Web
This is not your grandmother's online map: Advancing your mission with GIS tools
Where the %$#^ Is Everybody? Geospatial Solutions For Oracle APEX
Solving Mysteries Geographically
Where2.0Now - Finding the heat in Thematic Maps
NCGIC The Geospatial Revolution
Web gis implementation notes
Database@Home - Maps and Spatial Analyses: How to use them
The 21st Century Harvard Map
Geodata creation:past, present and future
Au09 Presentation Ut118 1
Open geo data - technical issue
Ad

More from Bradley Brown (8)

PDF
Video Anytime AnyWhere AnyDevice
PPTX
Anytime anywhere any device
PDF
InteliVideo Analytics Revised
PPTX
InteliVideo analytics
PPTX
Do you need a video platform?
PPTX
A CTOs Perspective on Agile
PPTX
Building a Flexible UI with Oracle ApEx
PPTX
Zero to Sixty with Oracle ApEx
Video Anytime AnyWhere AnyDevice
Anytime anywhere any device
InteliVideo Analytics Revised
InteliVideo analytics
Do you need a video platform?
A CTOs Perspective on Agile
Building a Flexible UI with Oracle ApEx
Zero to Sixty with Oracle ApEx
Ad

Recently uploaded (20)

PDF
Classroom Observation Tools for Teachers
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
RMMM.pdf make it easy to upload and study
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
Institutional Correction lecture only . . .
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
01-Introduction-to-Information-Management.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Basic Mud Logging Guide for educational purpose
PPTX
Cell Types and Its function , kingdom of life
Classroom Observation Tools for Teachers
VCE English Exam - Section C Student Revision Booklet
Renaissance Architecture: A Journey from Faith to Humanism
RMMM.pdf make it easy to upload and study
Microbial diseases, their pathogenesis and prophylaxis
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Week 4 Term 3 Study Techniques revisited.pptx
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Microbial disease of the cardiovascular and lymphatic systems
Institutional Correction lecture only . . .
STATICS OF THE RIGID BODIES Hibbelers.pdf
The Healthy Child – Unit II | Child Health Nursing I | B.Sc Nursing 5th Semester
Anesthesia in Laparoscopic Surgery in India
TR - Agricultural Crops Production NC III.pdf
01-Introduction-to-Information-Management.pdf
human mycosis Human fungal infections are called human mycosis..pptx
FourierSeries-QuestionsWithAnswers(Part-A).pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Basic Mud Logging Guide for educational purpose
Cell Types and Its function , kingdom of life

CTOs Perspective on Adding Geospatial and Location-based Information

  • 1. Bradley D. Brown, brad@intelivideo.com InteliVideo, CTO
  • 2. Agenda Who am I? Geospatial 101 How have I Used GeoSpatial Data? Options Available – Mapping Solutions Things I’ve Developed with Maps How to Get Started Technical Details Spatial Queries
  • 3. Who am I? Bradley D. Brown Today Founder • Technical CTO (write code) • TUSC in 1988 • Reglara and Enscicon Boards • Questor 1992 • Rolta, Board Advisor • GUI Shootout 1994 • Equifax employee • Sold to Rolta in 2008 • InteliVideo in April 2012 • IntelliReal in 2005 • Video Monetization Platform • Sold to Equifax in 2011 • Built it to sell training online • 10+ other companies, boards • Focused on mid and long tail Professor – DU and corporate deals and DVD Author – 6 technical books duplication guys Mentor in Founders Institute brad@intelivideo.com or http://bradleydbrown.blogspot.com
  • 4. Geospatial 101 • Mapping Solutions • Your data vs. mapping data • Lat / Long vs. Polygon • Uses and Advantages • Address Normalization
  • 5. Geospatial 101 Mapping Solutions – SaaS Solutions Google Maps • http://maps.google.com/ • MapsGL Bing Maps • http://www.bing.com/maps/ Google Earth • KML File
  • 6. Geospatial 101 Mapping Solutions – Spatial, Premise and SaaS Oracle Spatial vs. Locator Navtec, ESRI, etc. data in your own DB Oracle ApEx Has Built-in Mapping Other Hosted Solutions • Open Street Integraph • Virtual Earth Natural Earth • ESRI Maps for Free
  • 7. Geospatial 101 Your data vs. mapping data Your Data • Customers • Properties / Homes • Inventory Mapping Data • Maps – Google, etc. • Shape Files • In / Nearest
  • 8. Geospatial 101 Lat / Long vs. Polygon Lat / Long • Point on the map Polygon/Shape • Group of points • Shape File • Shapes • Metadata Can measure “in” for polygons or “nearest” for points
  • 9. Geospatial 101 Uses and Advantages Why Use? Using it to your • Glitzy / Sexy / Looks good advantage • Intelligence about your • Directions, Other customers, your data, “Similar” etc. items, Connecting things • Nearby Gas Stations, Railroad tracks, Boundaries
  • 10. Geospatial 101 Address Normalization and Geocoding an Address Address Normalization • Zip+4 • http://www.semaphorecorp.com/cgi/zp4.html • CorrectAddress • http://www1.intelligentsearch.com/address-verification/correct- address.htm • Google API Geocoding an Address • Google Geocoding API • https://developers.google.com/maps/documentation/geocoding/ • Web Service APIs
  • 11. Hopefully something will spark ideas for you!
  • 12. How Have I Used Geospatial Data IntelliReal • Considerable geo data, knowledge, etc. TUSC • Embedded into several apps at TUSC (ACT) Independent Nation • Political mapping solution InteliVideo • Where are people connecting from?
  • 13. Heat Maps A look at different neighborhood trends in home values
  • 14. GeoSearch Visual Slice and Dice – home type, bedrooms, bathrooms, price
  • 15. Highlight and Visual Search Find all homes that sold in this area for 20% less than their “value”
  • 16. Test Scores within a radius ACT scores By Zip Code Google API supports – Heat Maps • Outlines • Polygons – Circles – Overlays – Events
  • 17. With Google Maps or Yahoo or…
  • 18. Mapping Your Data Do you have data in your Oracle database that you would like to visually map? All you really need is a lat and long (or an address) Easy integration Starts At: • https://developers.google.com/maps/ Simple Pushpins:
  • 19. Hello World Page Static HTML page Copied HTML from Google page and pasted here
  • 20. Dynamic Generation Data driven mapping Properties in Arapahoe County, CO PL/SQL region with onload function
  • 21. True AJAX Mapping Mapping that pulls data dynamically from an XML page Lat / Long are passed to XML page
  • 23. Add a Popup Windows on Click Any information can popup
  • 25. Yahoo API -YQL Free Data and APIs from Yahoo • http://developer.yahoo.com/yql/console/ Local Events • select * from upcoming.events where woeid in (select woeid from geo.places where text="North Beach") Local Places • select * from local.search where zip='94085' and query='pizza'
  • 27. Neighborhood Comp Boundaries Create boundaries for a property • Using roads, water features (lakes, rivers), landmarks (parks), military bases and rail roads Created a function to return this info • Input is lat/long, but we can change to prop id once we have parcels loaded up • Other inputs – big roads (Y/N), distance (miles from property – 1), min distance (0), min length (.1 miles), band (1=1st, 2=2nd, etc.) Get_Kml is in the notes… • Will produce a KML file for Google Earth viewing
  • 28. Boundary Example 1 Major streets Lakes Parks Major features Square vs. Polygon
  • 30. Tons of Free Data! Tiger • http://www.census.gov/geo/www/tiger/shp.html • US Government Project – US Census UK Census Data • www.census.ac.uk/casweb Open Street Maps • http://www.openstreetmap.org/ • Open Source Collection Group • It’s free! Maps are more detailed than Google too!
  • 31. Getting OpenStreetMap Data “Shape Files” OpenStreetMap by State • http://osmdata.thinkgeo.com/openstreetmap-data/north-america/us/
  • 32. Map Features Tiger • http://www.census.gov/geo/www/tiger/tgrshp2012/documentation.html • www.census.ac.uk/casweb - UK census data OpenStreetMaps • http://wiki.openstreetmap.org/wiki/Map_Features Features • Addresses, Landmarks (Point and Area), Water (Area and Linear), MSAs, Railways, Military Installations, Tab Blocks (Block Groups, Blocks), Census Tracts, County, State Shape Files • Points and Polygons • Data (e.g. Road Name, Type)
  • 33. Point to Point Comparison Nearest “In” or “At” Area Water (lake) State Linear Water (river) County MSA Area Landmark (park) City Area Point (hospital) Census Tract Schools Block Group Military Installation Block Railroad Latitude, Longitude Address Range
  • 34. Loading Data Visually using Oracle MapBuilder Download at http://www.oracle.com/technetwork/middleware/mapviewer/downloads/index.htm l java –jar MapBuilder.jar Import Shapefile
  • 35. Loading Shape Files in Batch Load Shape to Spatial Data Option (SDO) http://download.oracle.com/otn/other/spatial/shp2sdo.zip Creates file structure If you have multiple files – run the creation only once and create the spatial index, load the data… • shp2sdo.exe Tiger DataADDRFEAT tl_2011_01001_addrfeat tl_2011_addrfeat -g geometry –f -x (-180,180) -y (-90,90) -s 8307 -t 0.000005 – v • sqlplus username/password @ tl_2011_addrfeat.sql • CREATE INDEX index_name ON table (geometry) INDEXTYPE IS MDSYS.SPATIAL_INDEX • sqlldr username/password tl_2011_addrfeat
  • 37. Water’s Distance from a Property SELECT SDO_GEOM.SDO_DISTANCE(Geometry, sdo_cs.transform(SDO_GEOMETRY(2001, 4269, SDO_POINT_TYPE (- 104.958587,39.71464,NULL), NULL, NULL),8307),.01,'unit=mile') distance, SDO_GEOM.SDO_AREA(geometry, 0.005, 'unit=acre') area, SDO_GEOM.SDO_CENTROID(geometry, 0.005) centroid, t.* FROM TL_2011_08031_AREAWATER t order by 1;
  • 38. Nearest x Objects (Address Ranges) to Property SELECT SDO_GEOM.SDO_DISTANCE(Geometry, sdo_cs.transform(SDO_GEOMETRY(2001, 4269, SDO_POINT_TYPE (-104.958587,39.71464,NULL), NULL, NULL),8307),.01,'unit=mile') distance, t.* FROM TL_2011_08031_ADDRFEAT t WHERE SDO_NN(geometry, SDO_GEOMETRY(2001, 4269, SDO_POINT_TYPE (-104.958587,39.71464,NULL), NULL, NULL), 'sdo_num_res=1 distance=1 unit=mile') = 'TRUE';
  • 39. Nearest 5 Landmarks within 10 Miles SELECT * FROM TL_2011_08031_AREALM WHERE SDO_NN(geometry, SDO_GEOMETRY(2001, 4269, SDO_POINT_TYPE (-104.958587,39.71464,NULL), NULL, NULL), 'sdo_num_res=5 distance=10 unit=mile') = 'TRUE';
  • 40. What Block is this Property In? SELECT * FROM TL_2011_08_TABBLOCK WHERE SDO_WITHIN_DISTANCE(Geometry, SDO_GEOMETRY(2001, 4269, SDO_POINT_TYPE (-104.958587,39.71464,NULL), NULL, NULL), 'distance=0 unit=mile') = 'TRUE';
  • 41. Nearest 5 Schools, Churches and Shopping Centers SELECT SDO_GEOM.SDO_DISTANCE(Geometry, sdo_cs.transform(SDO_GEOMETRY(2001, 4269, SDO_POINT_TYPE (-104.958587,39.71464,NULL), NULL, NULL),8307),.01,'unit=mile') distance, t.* FROM TL_2011_08031_POINTLM t WHERE SDO_NN(geometry, SDO_GEOMETRY(2001, 4269, SDO_POINT_TYPE (-104.958587,39.71464,NULL), NULL, NULL), 'sdo_num_res=5 distance=5 unit=mile') = 'TRUE';
  • 42. Nearest Hospitals in the County select SDO_GEOM.SDO_DISTANCE(Geometry, sdo_cs.transform(SDO_GEOMETRY(2001, 4269, SDO_POINT_TYPE (- 104.958587,39.71464,NULL), NULL, NULL),8307),.01,'unit=mile') distance, t.* FROM TL_2011_08031_POINTLM t where mtfcc = 'K1231';
  • 43. Nearest River, Creek, etc (Linear Water) SELECT SDO_GEOM.SDO_DISTANCE(Geometry, sdo_cs.transform(SDO_GEOMETRY(2001, 4269, SDO_POINT_TYPE (- 104.958587,39.71464,NULL), NULL, NULL),8307),.01,'unit=mile') distance, t.* FROM TL_2011_08031_LINEARWATER t WHERE SDO_NN(geometry, SDO_GEOMETRY(2001, 4269, SDO_POINT_TYPE (-104.958587,39.71464,NULL), NULL, NULL), 'sdo_num_res=5 distance=5 unit=mile') = 'TRUE'
  • 44. 5 Nearest Railways SELECT SDO_GEOM.SDO_DISTANCE(Geometry, sdo_cs.transform(SDO_GEOMETRY(2001, 4269, SDO_POINT_TYPE (-104.958587,39.71464,NULL), NULL, NULL),8307),.01,'unit=mile') distance, t.* FROM TL_2011_US_RAILS t WHERE SDO_NN(geometry, SDO_GEOMETRY(2001, 4269, SDO_POINT_TYPE (-104.958587,39.71464,NULL), NULL, NULL), 'sdo_num_res=5 distance=5 unit=mile') = 'TRUE';
  • 45. Extracting KML for Google Earth create or replace </PolyStyle> FUNCTION GET_KML (in_geometry sdo_geometry) </Style> RETURN CLOB AS <Placemark> <name>Entire</name> v_output clob := ''; <styleUrl>#transGreenPoly</styleUrl> <Polygon> cursor get_ordinates_cur(in_geometry sdo_geometry) is <extrude>1</extrude> SELECT t.x lat, t.y lng <altitudeMode>relativeToGround</altitudeMode> FROM TABLE(SDO_UTIL.GETVERTICES(in_geometry)) t; <outerBoundaryIs> <LinearRing> BEGIN <coordinates>'; v_output := ' for get_ordinates_rec in get_ordinates_cur(in_geometry) <?xml version="1.0" encoding="UTF-8"?> loop <kml xmlns="http://www.opengis.net/kml/2.2"> dbms_lob.append(v_output,get_ordinates_rec.lat || ',' || <Document> get_ordinates_rec.lng || ',17' || chr(13) || chr(10)); <Style id="transBluePoly"> end loop; <LineStyle> <width>1.5</width> v_output := v_output || '</coordinates> </LineStyle> </LinearRing> <PolyStyle> </outerBoundaryIs> <color>7dff0000</color> </Polygon> </PolyStyle> </Placemark> </Style> </Document> <Style id="transGreenPoly"> </kml>'; <LineStyle> <width>1.5</width> RETURN v_output; </LineStyle> <PolyStyle> END GET_KML; <color>7f00ff00</color>
  • 46. What Did We Cover? • Geospatial 101 • Ideas on How you Might Use GeoSpatial Data • Mapping Solutions • How to Get Started • Technical Details • Spatial Queries • Now it’s your turn!
  • 48. Copyright Information Neither InteliVideo nor the author guarantee this document to be error-free. Please provide comments/questions to brad@intelivideo.com. InteliVideo © 2013. This document cannot be reproduced without expressed written consent from an officer of InteliVideo.

Editor's Notes

  • #26: I’d also encourage you to check out Yahoo Pipes. Pipes allows you to prompt for information, use YQL, draw it in a map, overlay data and more. The maps you see here are 2 maps I created that show current traffic on a map. The map on the bottom of the page shows the culinary events that are in town. Again, I plan on merging this information with my “current” location and sending daily emails of maps and other items of interest. So let’s take a look at how you can do this with ApEx…
  • #29: create or replaceFUNCTION GET_KML (in_geometrysdo_geometry)RETURN CLOB AS  v_output          clob := &apos;&apos;;   cursor get_ordinates_cur(in_geometrysdo_geometry) is  SELECT t.xlat, t.ylng  FROM   TABLE(SDO_UTIL.GETVERTICES(in_geometry)) t;BEGIN  v_output := &apos;&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;kmlxmlns=&quot;http://www.opengis.net/kml/2.2&quot;&gt;  &lt;Document&gt;    &lt;Style id=&quot;transBluePoly&quot;&gt;      &lt;LineStyle&gt;        &lt;width&gt;1.5&lt;/width&gt;      &lt;/LineStyle&gt;      &lt;PolyStyle&gt;        &lt;color&gt;7dff0000&lt;/color&gt;      &lt;/PolyStyle&gt;    &lt;/Style&gt;    &lt;Style id=&quot;transGreenPoly&quot;&gt;      &lt;LineStyle&gt;        &lt;width&gt;1.5&lt;/width&gt;      &lt;/LineStyle&gt;      &lt;PolyStyle&gt;        &lt;color&gt;7f00ff00&lt;/color&gt;      &lt;/PolyStyle&gt;    &lt;/Style&gt;    &lt;Placemark&gt;      &lt;name&gt;Entire&lt;/name&gt;      &lt;styleUrl&gt;#transGreenPoly&lt;/styleUrl&gt;      &lt;Polygon&gt;        &lt;extrude&gt;1&lt;/extrude&gt;        &lt;altitudeMode&gt;relativeToGround&lt;/altitudeMode&gt;        &lt;outerBoundaryIs&gt;          &lt;LinearRing&gt;            &lt;coordinates&gt;&apos;;  for get_ordinates_rec in get_ordinates_cur(in_geometry) loop      dbms_lob.append(v_output,get_ordinates_rec.lat || &apos;,&apos; || get_ordinates_rec.lng || &apos;,17&apos; || chr(13) || chr(10));  end loop;  v_output := v_output || &apos;&lt;/coordinates&gt;          &lt;/LinearRing&gt;        &lt;/outerBoundaryIs&gt;      &lt;/Polygon&gt;    &lt;/Placemark&gt;  &lt;/Document&gt;&lt;/kml&gt;&apos;;  RETURN v_output;END GET_KML;