Understanding & Using Spatial Data Features in SQL Server

Slides:



Advertisements
Similar presentations
UK Spatial Data into SQL Server 2008/r2 + Reporting Services Daniel Gaze & Neal Atkinson The Co-operative Group
Advertisements

NSF DUE ; Module 4.3. NSF DUE ; GeoTEd Partners Module name and number.
Geoprocessing; Useful Tools You Should Know in ArcToolbox Unlock the hidden secrets of ArcToolbox to discover tools that make your work easier and analysis.
Europe’s Premier Community SQL Server Conference # SQLBITS.
GIS for Environmental Science
GIS Level 2 MIT GIS Services
Hope Foley Perpetual Technologies SQL Saturday #51 - Nashville.
Oracle8i Spatial Concepts. Concepts Geometric data types Oracle8i Spatial data model Spatial Layers Spatial query model Spatial indexing «Window» queries.
NR 322: Single Layer Analysis Jim Graham Fall 2008 Chapter 8 & 9.
Creating and Editing Feature Data Francisco Olivera, Ph.D., P.E. Srikanth Koka Department of Civil Engineering Texas A&M University.
TECNOLOGIAS DE ARMAZENAMENTO DE INFORMAÇÃO ESPACIAL.
©2005 Austin Troy Lecture 9: Introduction to GIS 1.Vector Geoprocessing Lecture by Austin Troy, University of Vermont.
GTECH 731 Lab Session 8 10/26/10 Lab 7 Geotools. Previous Labs Labs designed to gradually introduce C# and Visual Studio Started with simple, straight.
GIS Tutorial 1 Lecture 6 Digitizing.
Working with shapefiles Shapefiles are ArcView’s file format Each shapefile is a collection of files.shp -- spatial data (shape geometry).shx -- spatial.
Basic Spatial Analysis
Selecting and Displaying Features. Why do you need to select features? Why do you need to select features? Selection methods Selection methods Select.
DVAEYC IREG Meeting 2 June 2010 Tamara Manik-Perlman, Azavea (formerly Avencia) CommonSpace: A Shared Transitspace Collaboration Platform.
Spatial Query Language Group No.15 Dhruv Dhokalia Yash Khandelwal Course Relation- Chapter 11- Object and Object-Relational Databases.
1 1 ISyE 6203 Radical Tools Intro To GIS: MapPoint John H. Vande Vate Spring 2012.
Taking Microsoft SQL Server into the World of Spatial Data Management Milan Stojic, Michael Rys Program Managers
Marko Tintor Danica Porobić Microsoft Development Center Serbia.
The State of PostGIS Paul Ramsey Paul Ramsey
Creating High Performance Spatial Databases with SQL Server 2008 Alastair Aitchison.
6. Simple Features Specification Background information UML overview Simple features geometry.
GIS FOR COMMUNITY DEVELOPMENT. WHAT DOES GIS STAND FOR? Hardware and Software Data Mapping Standards GIS Savvy Users GIS G eographic I nformation S ystems.
Taking Microsoft SQL Server into the World of Spatial Data Management Michael Rys Principal Program Manager Microsoft DBI324.
Optimum route finder to the point of interest through public transport By Pratik Mehta Submitted to Dept. Comp. Science and Engineering IIT-Bombay.
SQL/MM Spatial Manage Spatial Data in an ORDBMS Knut Stolze IBM Germany,
Intro to Spatial Data in SQL Server 2008 R2 Russ Burns MVT Sr. Apps Developer.
Geographic Information Systems Data Analysis. What is GIS Data ?
SQL access and working with ST_Geometry Functions
John Pickford IBM H11 Wednesday, October 4, :30. – 14:30. Platform: Informix Practical Applications of IDS Extensibility (Part 2 of 2)
Geographic Data in GIS. Components of geographic data Three general components to geographic information Three general components to geographic information.
School of Geography FACULTY OF ENVIRONMENT Querying with ArcGIS.
TECH 104 – Technical Graphics Communication Introduction to Engineering Graphics Communication.
The Earth is Round: Mapping GPS Data with a GIS Carla McAuliffe, Ph. D. DataTools 2008 Program.
Intro. To GIS Pre-Lab Spatial Analysis April 1 st, 2013.
GEOGRAPHY DATATYPES in SQL Server by jared nielsen linkedin.com/nielsendata.
NEALLT 2016 Motivating Students with Media, Games, and Style Gettysburg College March Luba Iskold Muhlenberg College.
Geocoding and Georeferencing Scott Bell GIS Institute.
Get Familiar with Spatial Data. Slava Murygin – SQL SlavaSQL.BlogSpot.com.
Geocoding Chapter 16 GISV431 &GEN405 Dr W Britz. Georeferencing, Transformations and Geocoding Georeferencing is the aligning of geographic data to a.
Business Analyst Web App and ArcGIS Online Anna Hou Julia Holtzclaw.
Chapter 1: GIS Data Outline Representing the world as a map Coordinate systems Map scale Data quality issues About ArcGIS.
Spatial Data and Windows Azure SQL Database
Geocoding and Georeferencing
GEOCODING Fall 2016 Library Workshop.
3 Methods to End the Madness
Get Familiar with Spatial Data
Fast Track to SPATIAL Reporting!
A Look at Creating & Updating Point Files
Fun with SQL Server Spatial Data
Physical Structure of GDB
T-SQL Coding Techniques Are you playing with fire?
Using Extended Events to Diagnose Application Issues
Touring Data with Power Map
Spatial Analysis and Functions
Spatial Data Types And Indexing SQL Server 2008
The Ins and Outs of Indexes
The Ins and Outs of Indexes
Fun with SQL Server Spatial Data
GTECH 709 GIS Data Formats GIS data formats
TSQL Coding Techniques
Review- vector analyses
The Ins and Outs of Indexes
ECU103 Geography for Schools
The Ins and Outs of Indexes
Exporting GIS Features to CAD Drawings
The Ins and Outs of Indexes
Presentation transcript:

Understanding & Using Spatial Data Features in SQL Server Mindy Curnutt Partner Mindy Curnutt & Associates Consulting

About Me Wife & Mother Busy-Bee Musician Soap Making Baking Crocheting Entrepreneur Event Planning

About Me Independent Consultant 4X MS Data Platform MVP Idera ACE 2017 SQL Server since 6.5 / 1995 (20+ Years) SQLPASS Speaker, 2005, 2012-2015, 2017 PASS Program Manager 2015-2017 Twitter: @sqlgirl Email: mindy@mindycurnutt.com

Spatial Data Types Geography Geometry Ellipsoidal (Lat, Long, Z, M) Define points, lines & areas with latitude & longitude Geometry Flat Map (X, Y, Z, M) Define points, lines & areas with coordinates Use for localized & interior spaces

WHAT CAN I REPRESENT? POINT MULTIPOINT LINESTRING MULTI-LINESTRING POLYGON MULTI-POLYGON There’s more too! Complex Polygons & Multi-Polygons, Collection, Curves, Combinations…

WHAT CAN I REPRESENT? Points A GPS Position: Declare @location geography = geography::Point(@lat, @long, 4326); A Region of 20 meters around a Point (Buffer): Declare @region geography = geography::Point(@lat, @long, 4326).STBuffer(20); Show Demo 1

WHAT CAN I REPRESENT? Circular Arcs Circular Strings (3 point+) Compound Curves Curved Polygons DECLARE @g geography = 'CIRCULARSTRING( -122.358 47.653, -122.348 47.649, -122.348 47.658, -122.358 47.658, -122.358 47.653)'; Demo 2 – Circular String

WHAT CAN I REPRESENT? Circular Arcs Circular Strings Compound Curves Curve Polygons DECLARE @g geometry = 'COMPOUNDCURVE ( CIRCULARSTRING(1 0, 0 2, 3 1), (3 1, 1 1), CIRCULARSTRING(1 1, 3 4, 4 1) )';

WHAT CAN I REPRESENT Circular Arcs Circular Strings Compound Curves Curved Polygons DECLARE @g geometry = 'CURVEPOLYGON ( CIRCULARSTRING(0 4, 4 0, 8 4, 4 8, 0 4), CIRCULARSTRING(2 4, 4 2, 6 4, 4 6, 2 4) )'; SELECT @g.STArea() AS Area; Demo 4 – Circular Arcs

WHAT CAN I REPRESENT? Complex Polygons select * from timezone_world where ID = 86 select * from timezone_world where ID in ( 27,17,7,273,41,204,86,81,149,74,126 ,296,312,44,82,389,124,400,251,206, 104,67,102,41) Demo 5 – Complex Polygons

Common spatial methods in t-sql STBuffer (return type: Geography) Draws a buffer of the specified distance around the geography shape. If the shape is a point, the buffer will draw a circle. ShortestLineTo (return type: Geography) Returns an object that represent the shortest distance between two objects STIntersection (return type: Geography) Returns an object that represents the points where a geography instance intersects another geography instance. STUnion (return type: Geography) Returns an object that represents the points where a geography instance intersects another geography instance. Demo 6 – Shortest Line To & STLength / Demo 7 – STIntersection and STUnion

Common spatial methods in t-sql STContains (return type: Boolean) Specifies whether the calling geography instance spatially contains the geography instance passed to the method. STIntersects (return type: Boolean) Returns 1 if a geography instance spatially overlaps another geography instance, or 0 if it does not. STDistance (return type: Float) Returns the shortest distance between a point in a geography instance and a point in another geography instance. (Float) STLength (return type: Float) Returns in Meters the length of a Line or Curve object STArea (return type: Float) Returns Square Meters of the Area of the resulting Demo 8 – STContains and STIntersects

Examples Get all Customers within a distance of X Select * from Customers c where s.geo.STDistance(@me) < @x Get all Customers within a particular City’s Boundary Select * from Customers c where c.geo.STIntersects(@ACityBoundary) = 1 How many miles is a walk in my neighborhood with my dog? declare @g geography; SET @g= geography::STGeomFromText('LINESTRING (-96.777639 32.951932, -96.777639 32.951932, -96.777620 32.952159, -96.778624 32.952167, -96.779098 32.952243, -96.778716 32.978184)',4326); select @g; select @g.STLength() * .000621371 * 2;

Convert Objects to Spatial Data Geocoder Services GPS Visualizer – Batch Address Locator Give a list of addresses, returns Lat/Long http://www.gpsvisualizer.com/geocoder/ ArcGIS https://developers.arcgis.com/features/geocoding/ Google Maps https://google- developers.appspot.com/maps/documentation/utils/geocoder/ Texas A & M http://geoservices.tamu.edu/Services/Geocode/ Demo 9 - GeogCoding

Sources of Free Data Shapefiles United States Census - https://www.census.gov/ State and Local Governments – http://geo.data.gov http://www.mapcruzin.com/download-free-arcgis-shapefiles.htm http://www.naturalearthdata.com/ http://freegisdata.rtwilson.com/ (huge list of links) http://download.geofabrik.de/ http://nationalmap.gov/small_scale/ http://tnmap.tn.gov/ ArcGIS - http://opendata.arcgis.com/

Loading Spatial Data Shape2SQL http://www.sharpgis.net/page/SQL-Server-2008-Spatial-Tools Demo – Shape2SQL

SQL Server Art using Spatial Data Convert image to a bitmap Convert bitmap to a vector (vectormagic.com) Use Excel workbook for formatting Paste in SQL http://michaeljswart.com/2010/02/more-images-from-the- spatial-results-tab/

Credits Michael Rys, Milan Stojic – TechEd Europe 2012 DBI324 Michael J Swart Blog Alex Whittles – Purple Frog Consultancy Blog

QUESTIONS? Mindy Curnutt Independent Consultant w: www.mindycurnutt.com e: mindy@mindycurnutt.com t: @sqlgirl M O V I N G Y O U F O R W A R D