SlideShare a Scribd company logo
Spatial Support
Relational and Non-Relational Data Relational data uses simple data types Each type has a single value Generic operations work well with the types Relational storage/query may not be optimal for Hierarchical data Sparse, variable, property bags Some types  benefit by using a custom library use extended type system (complex types, inheritance) use custom storage and non-SQL APIs use non-relational queries and indexing
Spatial Data Spatial data provides answers to location-based queries Which roads intersect the Microsoft campus? Does my land claim overlap yours? List all of the Italian restaurants within 5 kilometers Spatial data is part of almost every database If your database includes an address
Spatial Data Types The Open Geospatial Consortium defines a hierarchy of spatial data types Point Linestring Polygon MultiPoint MultiLinestring MultiPolygon GeomCollection Non-instanciable classes based on these
OGC Hierarchy of Spatial Types
SQL Server 2008 and Spatial Data SQL Server supports two spatial data types GEOMETRY - flat earth model GEOGRAPHY - round earth model Both types support all of the instanciable OGC types InstanceOf method can distinguish between them Supports two dimension data X and Y or Lat and Long members Z member - elevation (user-defined semantics) M member - measure (user-defined semantics)
GEOGRAPHY Requirements GEOGRAPHY type has additional requirements Coordinate order is  Longitude/Latitude for WKT, WKB Latitude/Longitude for GML Exterior polygon rings must have their describing coordinates in counter-clockwise order (left-hand rule) with interior rings (holes) in clockwise-order (right-hand rule)   A single GEOGRAPHY object cannot span more than a logical hemisphere
Spatial Data demo
Properties and Methods The spatial data types are exposed as SQLCLR UDTs Use '.' syntax for properties Use '.' syntax for instance methods Use '::' syntax for static methods Methods and Properties are case-sensitive Each type uses a set of properties and methods that correspond to OGC functionality With Extensions Geometry implements all OGC properties and methods Geography implements most OGC properties and methods 2-D vector only implemented
Input Spatial data is stored in a proprietary binary format Instance of the type can be NULL Can be input as Well Known binary - ST[Type]FromWKB Well Known text - ST[Type]FromText Geography Markup Language (GML) - GeomFromGml Can also use SQLCLR functions Parse Point - extension function Input from SQLCLR Type - SqlGeometry, SqlGeography Spatial builder API – Populate, IGeometrySink/IGeographySink
Output Spatial Data Can Be Output As Well Known binary - STAsBinary Well Known text - STAsText GML - AsGml Text with Z and M values - AsTextZM SQLCLR standard method ToString - returns Well Known text As SQLCLR object - SqlGeometry, SqlGeography Other useful formats are GeoRSS, KML Not Directly Supported
SRID Each instance of a spatial type must have an SRID Spatial Reference Identifier SRID specifies the specification used to compute it SRID 4326 - GPS, default for GEOGRAPHY SRID 4269 - usually used by ESRI SRID 0 - no special reference, default for GEOMETRY Methods that use multiple spatial types (e.g., STDistance) must have types with matching SRID Else method returns NULL Geography instance must reference one of these SRID stored in sys.spatial_reference_systems
Useful Methods/Properties Descriptive STArea STLength STCentroid Relation between two instances STIntersects STDistance Manipulation STUnion STSymDifference Collections STGeometryN STPointN
Sample Query Which roads intersect Microsoft’s main campus? SELECT * FROM roads  WHERE roads.geom.STIntersects(@ms)=1
Extension Methods SQL Server 2008 extends OGC methods MakeValid - Converts to OGC valid instance BufferWithTolerence - similar to STBuffer, allows approximation and variation Reduce - Simplify a complex geography or geometry NumRings, RingN - polygons with multiple rings GML support Z and M properties and AsTextZM method Filter - provides a quick intersection set but with false positives EnvelopeCenter,EnvelopeAngle for Geography types
Spatial Indexes SQL Server Spatial Indexes Based on B-Trees Uses tessellation to tile 2D to linear Divides space into grid of cells(uses Hilbert algorithm) Meant as a first level of row elimination Can produce false positives Never false negatives You specify Bounding box of top level grid - GEOMETRY index only Cells per object - number of cells recorded for matching Grids  Four Grid Levels Three Grid Densities Per Level - Low, Medium, High
Tessellation process
Spatial Analytics demo
Review Spatial data provides answers to location-based queries SQL Server supports two spatial data types GEOMETRY - flat earth model GEOGRAPHY - round earth model Spatial data has Useful properties and functions Library of spatial functions Three standard input and output formats Spatial indexes
Resources SQL Server Spatial Data Technology Center http://www.microsoft.com/sql/2008/technologies/spatial.mspx Whitepaper: Delivering Location Intelligence with Spatial Data  http://www.microsoft.com/sql/techinfo/whitepapers/spatialdata.mspx MSDN Webcast: Building Spatial Applications with SQL Server 2008, Event ID: 1032353123 Whitepaper: What's New for XML in SQL Server 2008 http://www.microsoft.com/sql/techinfo/whitepapers/sql_2008_xml.mspx Whitepaper: Managing Unstructured Data with SQL Server 2008 http://www.microsoft.com/sql/techinfo/whitepapers/sql_2008_unstructured.mspx
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation.  Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation.  MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related Content

What's hot

Storage struct
Storage structStorage struct
Storage struct
durgaprasad1407
 
Top-K Dominating Queries on Incomplete Data with Priorities
Top-K Dominating Queries on Incomplete Data with PrioritiesTop-K Dominating Queries on Incomplete Data with Priorities
Top-K Dominating Queries on Incomplete Data with Priorities
ijtsrd
 
R program
R programR program
R program
genegeek
 
NHibernate for .NET
NHibernate for .NETNHibernate for .NET
NHibernate for .NET
Guo Albert
 
8 query processing and optimization
8 query processing and optimization8 query processing and optimization
8 query processing and optimization
Kumar
 
EnviroInsite training workshop - Data visualization methods for one analyte
EnviroInsite training workshop - Data visualization methods for one analyteEnviroInsite training workshop - Data visualization methods for one analyte
EnviroInsite training workshop - Data visualization methods for one analyte
Bruce Jacobs
 
Introduction To NHibernate
Introduction To NHibernateIntroduction To NHibernate
Introduction To NHibernate
Emad Alashi
 
OODB
OODBOODB
OODB
rajukc47
 
GraphFrames: Graph Queries in Spark SQL by Ankur Dave
GraphFrames: Graph Queries in Spark SQL by Ankur DaveGraphFrames: Graph Queries in Spark SQL by Ankur Dave
GraphFrames: Graph Queries in Spark SQL by Ankur Dave
Spark Summit
 
170120107066 dbms
170120107066 dbms170120107066 dbms
170120107066 dbms
harsh kothari
 
Lecture 01
Lecture 01Lecture 01
Lecture 01
Akhtarzeb Khan
 
Introduction to data analysis using R
Introduction to data analysis using RIntroduction to data analysis using R
Introduction to data analysis using R
Victoria López
 
R programming Language , Rahul Singh
R programming Language , Rahul SinghR programming Language , Rahul Singh
R programming Language , Rahul Singh
Ravi Basil
 
Efficient Query Processing in Geographic Web Search Engines
Efficient Query Processing in Geographic Web Search EnginesEfficient Query Processing in Geographic Web Search Engines
Efficient Query Processing in Geographic Web Search Engines
Yen-Yu Chen
 
GraphFrames: Graph Queries In Spark SQL
GraphFrames: Graph Queries In Spark SQLGraphFrames: Graph Queries In Spark SQL
GraphFrames: Graph Queries In Spark SQL
Spark Summit
 
Apache Spark GraphX highlights.
Apache Spark GraphX highlights. Apache Spark GraphX highlights.
Apache Spark GraphX highlights.
Doug Needham
 
GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)
GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)
GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)
Ankur Dave
 
Machine Learning in H2O
Machine Learning in H2OMachine Learning in H2O
Machine Learning in H2O
Aakash Gupta
 
Data Structures & Algorithms
Data Structures & AlgorithmsData Structures & Algorithms
Data Structures & Algorithms
Ain-ul-Moiz Khawaja
 
Data structures and algorithm analysis in java
Data structures and algorithm analysis in javaData structures and algorithm analysis in java
Data structures and algorithm analysis in java
Muhammad Aleem Siddiqui
 

What's hot (20)

Storage struct
Storage structStorage struct
Storage struct
 
Top-K Dominating Queries on Incomplete Data with Priorities
Top-K Dominating Queries on Incomplete Data with PrioritiesTop-K Dominating Queries on Incomplete Data with Priorities
Top-K Dominating Queries on Incomplete Data with Priorities
 
R program
R programR program
R program
 
NHibernate for .NET
NHibernate for .NETNHibernate for .NET
NHibernate for .NET
 
8 query processing and optimization
8 query processing and optimization8 query processing and optimization
8 query processing and optimization
 
EnviroInsite training workshop - Data visualization methods for one analyte
EnviroInsite training workshop - Data visualization methods for one analyteEnviroInsite training workshop - Data visualization methods for one analyte
EnviroInsite training workshop - Data visualization methods for one analyte
 
Introduction To NHibernate
Introduction To NHibernateIntroduction To NHibernate
Introduction To NHibernate
 
OODB
OODBOODB
OODB
 
GraphFrames: Graph Queries in Spark SQL by Ankur Dave
GraphFrames: Graph Queries in Spark SQL by Ankur DaveGraphFrames: Graph Queries in Spark SQL by Ankur Dave
GraphFrames: Graph Queries in Spark SQL by Ankur Dave
 
170120107066 dbms
170120107066 dbms170120107066 dbms
170120107066 dbms
 
Lecture 01
Lecture 01Lecture 01
Lecture 01
 
Introduction to data analysis using R
Introduction to data analysis using RIntroduction to data analysis using R
Introduction to data analysis using R
 
R programming Language , Rahul Singh
R programming Language , Rahul SinghR programming Language , Rahul Singh
R programming Language , Rahul Singh
 
Efficient Query Processing in Geographic Web Search Engines
Efficient Query Processing in Geographic Web Search EnginesEfficient Query Processing in Geographic Web Search Engines
Efficient Query Processing in Geographic Web Search Engines
 
GraphFrames: Graph Queries In Spark SQL
GraphFrames: Graph Queries In Spark SQLGraphFrames: Graph Queries In Spark SQL
GraphFrames: Graph Queries In Spark SQL
 
Apache Spark GraphX highlights.
Apache Spark GraphX highlights. Apache Spark GraphX highlights.
Apache Spark GraphX highlights.
 
GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)
GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)
GraphX: Graph Analytics in Apache Spark (AMPCamp 5, 2014-11-20)
 
Machine Learning in H2O
Machine Learning in H2OMachine Learning in H2O
Machine Learning in H2O
 
Data Structures & Algorithms
Data Structures & AlgorithmsData Structures & Algorithms
Data Structures & Algorithms
 
Data structures and algorithm analysis in java
Data structures and algorithm analysis in javaData structures and algorithm analysis in java
Data structures and algorithm analysis in java
 

Viewers also liked

Covering the earth and the cloud the next generation of spatial in sql server...
Covering the earth and the cloud the next generation of spatial in sql server...Covering the earth and the cloud the next generation of spatial in sql server...
Covering the earth and the cloud the next generation of spatial in sql server...
Texas Natural Resources Information System
 
Data Mining: Applying data mining
Data Mining: Applying data miningData Mining: Applying data mining
Data Mining: Applying data mining
DataminingTools Inc
 
Presenting Spatial Data: Whats so spatial about spatial?
Presenting Spatial Data: Whats so spatial about spatial?Presenting Spatial Data: Whats so spatial about spatial?
Presenting Spatial Data: Whats so spatial about spatial?
Shawn Day
 
Intro to Spatial data
Intro to Spatial data Intro to Spatial data
Intro to Spatial data
Devdatta Tengshe
 
Spatial Data Model 2
Spatial Data Model 2Spatial Data Model 2
Spatial Data Model 2
Kaium Chowdhury
 
GIS
GISGIS
Spatial Data Model
Spatial Data ModelSpatial Data Model
Spatial Data Model
Kaium Chowdhury
 
ppt spatial data
ppt spatial datappt spatial data
ppt spatial data
Rahul Kumar
 
GIS Data Types
GIS Data TypesGIS Data Types
GIS Data Types
John Reiser
 
Optimizing spatial database
Optimizing spatial databaseOptimizing spatial database
Optimizing spatial database
Ishraq Al Fataftah
 
Spatial databases
Spatial databasesSpatial databases
Spatial databases
Seraphic Nazir
 
Slideshare.Com Powerpoint
Slideshare.Com PowerpointSlideshare.Com Powerpoint
Slideshare.Com Powerpoint
guested929b
 
Slideshare ppt
Slideshare pptSlideshare ppt
Slideshare ppt
Mandy Suzanne
 
2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare
SlideShare
 
What to Upload to SlideShare
What to Upload to SlideShareWhat to Upload to SlideShare
What to Upload to SlideShare
SlideShare
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
SlideShare
 

Viewers also liked (16)

Covering the earth and the cloud the next generation of spatial in sql server...
Covering the earth and the cloud the next generation of spatial in sql server...Covering the earth and the cloud the next generation of spatial in sql server...
Covering the earth and the cloud the next generation of spatial in sql server...
 
Data Mining: Applying data mining
Data Mining: Applying data miningData Mining: Applying data mining
Data Mining: Applying data mining
 
Presenting Spatial Data: Whats so spatial about spatial?
Presenting Spatial Data: Whats so spatial about spatial?Presenting Spatial Data: Whats so spatial about spatial?
Presenting Spatial Data: Whats so spatial about spatial?
 
Intro to Spatial data
Intro to Spatial data Intro to Spatial data
Intro to Spatial data
 
Spatial Data Model 2
Spatial Data Model 2Spatial Data Model 2
Spatial Data Model 2
 
GIS
GISGIS
GIS
 
Spatial Data Model
Spatial Data ModelSpatial Data Model
Spatial Data Model
 
ppt spatial data
ppt spatial datappt spatial data
ppt spatial data
 
GIS Data Types
GIS Data TypesGIS Data Types
GIS Data Types
 
Optimizing spatial database
Optimizing spatial databaseOptimizing spatial database
Optimizing spatial database
 
Spatial databases
Spatial databasesSpatial databases
Spatial databases
 
Slideshare.Com Powerpoint
Slideshare.Com PowerpointSlideshare.Com Powerpoint
Slideshare.Com Powerpoint
 
Slideshare ppt
Slideshare pptSlideshare ppt
Slideshare ppt
 
2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare2015 Upload Campaigns Calendar - SlideShare
2015 Upload Campaigns Calendar - SlideShare
 
What to Upload to SlideShare
What to Upload to SlideShareWhat to Upload to SlideShare
What to Upload to SlideShare
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
 

Similar to Spatial

Spatial Data in SQL Server
Spatial Data in SQL ServerSpatial Data in SQL Server
Spatial Data in SQL Server
Eduardo Castro
 
Spatial Data in SQL Server
Spatial Data in SQL ServerSpatial Data in SQL Server
Spatial Data in SQL Server
Eduardo Castro
 
Dev Sql Beyond Relational
Dev Sql Beyond RelationalDev Sql Beyond Relational
Dev Sql Beyond Relational
rsnarayanan
 
No(Geo)SQL
No(Geo)SQLNo(Geo)SQL
Sql Saturday Spatial Data Ss2008 Michael Stark Copy
Sql Saturday Spatial Data Ss2008 Michael Stark   CopySql Saturday Spatial Data Ss2008 Michael Stark   Copy
Sql Saturday Spatial Data Ss2008 Michael Stark Copy
mws580
 
Gis and Ruby 101 at Ruby Conf Kenya 2017 by Kamal Ogudah
Gis and Ruby 101 at Ruby Conf Kenya 2017 by Kamal OgudahGis and Ruby 101 at Ruby Conf Kenya 2017 by Kamal Ogudah
Gis and Ruby 101 at Ruby Conf Kenya 2017 by Kamal Ogudah
Michael Kimathi
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
llangit
 
Geoprocessing(Building Your Own Tool) and Geostatistical Analysis(An Introdu...
Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introdu...Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introdu...
Geoprocessing(Building Your Own Tool) and Geostatistical Analysis(An Introdu...
Nepal Flying Labs
 
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
Michael Rys
 
Post gispguk
Post gispgukPost gispguk
Post gispguk
lbtlsystems
 
Power Saturday 2019 B4 - From relational to Multimodel Azure Cosmos DB
Power Saturday 2019 B4 - From relational to Multimodel Azure Cosmos DBPower Saturday 2019 B4 - From relational to Multimodel Azure Cosmos DB
Power Saturday 2019 B4 - From relational to Multimodel Azure Cosmos DB
PowerSaturdayParis
 
An Architecture and a Metamodel for Processing Analytic and Geographic Multil...
An Architecture and a Metamodel for Processing Analytic and Geographic Multil...An Architecture and a Metamodel for Processing Analytic and Geographic Multil...
An Architecture and a Metamodel for Processing Analytic and Geographic Multil...
Beniamino Murgante
 
Open Source Databases And Gis
Open Source Databases And GisOpen Source Databases And Gis
Open Source Databases And Gis
Kudos S.A.S
 
SQL Server 2008 for .NET Developers
SQL Server 2008 for .NET DevelopersSQL Server 2008 for .NET Developers
SQL Server 2008 for .NET Developers
llangit
 
Tech Days09 Sqldev
Tech Days09 SqldevTech Days09 Sqldev
Tech Days09 Sqldev
llangit
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
llangit
 
Geographical Information System (GIS)
Geographical Information System (GIS)Geographical Information System (GIS)
Geographical Information System (GIS)
Malla Reddy University
 
introduction to geographical information system
introduction to geographical information systemintroduction to geographical information system
introduction to geographical information system
DrVenkateswarluGogan1
 
Building Scalable Semantic Geospatial RDF Stores
Building Scalable Semantic Geospatial RDF StoresBuilding Scalable Semantic Geospatial RDF Stores
Building Scalable Semantic Geospatial RDF Stores
Kostis Kyzirakos
 
PostgreSQL - Object Relational Database
PostgreSQL - Object Relational DatabasePostgreSQL - Object Relational Database
PostgreSQL - Object Relational Database
Mubashar Iqbal
 

Similar to Spatial (20)

Spatial Data in SQL Server
Spatial Data in SQL ServerSpatial Data in SQL Server
Spatial Data in SQL Server
 
Spatial Data in SQL Server
Spatial Data in SQL ServerSpatial Data in SQL Server
Spatial Data in SQL Server
 
Dev Sql Beyond Relational
Dev Sql Beyond RelationalDev Sql Beyond Relational
Dev Sql Beyond Relational
 
No(Geo)SQL
No(Geo)SQLNo(Geo)SQL
No(Geo)SQL
 
Sql Saturday Spatial Data Ss2008 Michael Stark Copy
Sql Saturday Spatial Data Ss2008 Michael Stark   CopySql Saturday Spatial Data Ss2008 Michael Stark   Copy
Sql Saturday Spatial Data Ss2008 Michael Stark Copy
 
Gis and Ruby 101 at Ruby Conf Kenya 2017 by Kamal Ogudah
Gis and Ruby 101 at Ruby Conf Kenya 2017 by Kamal OgudahGis and Ruby 101 at Ruby Conf Kenya 2017 by Kamal Ogudah
Gis and Ruby 101 at Ruby Conf Kenya 2017 by Kamal Ogudah
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
 
Geoprocessing(Building Your Own Tool) and Geostatistical Analysis(An Introdu...
Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introdu...Geoprocessing(Building Your Own Tool)  and Geostatistical Analysis(An Introdu...
Geoprocessing(Building Your Own Tool) and Geostatistical Analysis(An Introdu...
 
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
The Road to U-SQL: Experiences in Language Design (SQL Konferenz 2017 Keynote)
 
Post gispguk
Post gispgukPost gispguk
Post gispguk
 
Power Saturday 2019 B4 - From relational to Multimodel Azure Cosmos DB
Power Saturday 2019 B4 - From relational to Multimodel Azure Cosmos DBPower Saturday 2019 B4 - From relational to Multimodel Azure Cosmos DB
Power Saturday 2019 B4 - From relational to Multimodel Azure Cosmos DB
 
An Architecture and a Metamodel for Processing Analytic and Geographic Multil...
An Architecture and a Metamodel for Processing Analytic and Geographic Multil...An Architecture and a Metamodel for Processing Analytic and Geographic Multil...
An Architecture and a Metamodel for Processing Analytic and Geographic Multil...
 
Open Source Databases And Gis
Open Source Databases And GisOpen Source Databases And Gis
Open Source Databases And Gis
 
SQL Server 2008 for .NET Developers
SQL Server 2008 for .NET DevelopersSQL Server 2008 for .NET Developers
SQL Server 2008 for .NET Developers
 
Tech Days09 Sqldev
Tech Days09 SqldevTech Days09 Sqldev
Tech Days09 Sqldev
 
SQL Server 2008 for Developers
SQL Server 2008 for DevelopersSQL Server 2008 for Developers
SQL Server 2008 for Developers
 
Geographical Information System (GIS)
Geographical Information System (GIS)Geographical Information System (GIS)
Geographical Information System (GIS)
 
introduction to geographical information system
introduction to geographical information systemintroduction to geographical information system
introduction to geographical information system
 
Building Scalable Semantic Geospatial RDF Stores
Building Scalable Semantic Geospatial RDF StoresBuilding Scalable Semantic Geospatial RDF Stores
Building Scalable Semantic Geospatial RDF Stores
 
PostgreSQL - Object Relational Database
PostgreSQL - Object Relational DatabasePostgreSQL - Object Relational Database
PostgreSQL - Object Relational Database
 

More from sqlserver.co.il

Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013
sqlserver.co.il
 
Things you can find in the plan cache
Things you can find in the plan cacheThings you can find in the plan cache
Things you can find in the plan cache
sqlserver.co.il
 
Sql server user group news january 2013
Sql server user group news   january 2013Sql server user group news   january 2013
Sql server user group news january 2013
sqlserver.co.il
 
DAC 2012
DAC 2012DAC 2012
DAC 2012
sqlserver.co.il
 
Query handlingbytheserver
Query handlingbytheserverQuery handlingbytheserver
Query handlingbytheserver
sqlserver.co.il
 
Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012
sqlserver.co.il
 
Products.intro.forum version
Products.intro.forum versionProducts.intro.forum version
Products.intro.forum version
sqlserver.co.il
 
SQL Explore 2012: P&T Part 3
SQL Explore 2012: P&T Part 3SQL Explore 2012: P&T Part 3
SQL Explore 2012: P&T Part 3
sqlserver.co.il
 
SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2
sqlserver.co.il
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
sqlserver.co.il
 
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended EventsSQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
sqlserver.co.il
 
SQL Explore 2012 - Michael Zilberstein: ColumnStore
SQL Explore 2012 - Michael Zilberstein: ColumnStoreSQL Explore 2012 - Michael Zilberstein: ColumnStore
SQL Explore 2012 - Michael Zilberstein: ColumnStore
sqlserver.co.il
 
SQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DACSQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DAC
sqlserver.co.il
 
SQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: SpatialSQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: Spatial
sqlserver.co.il
 
מיכאל
מיכאלמיכאל
מיכאל
sqlserver.co.il
 
נועם
נועםנועם
נועם
sqlserver.co.il
 
עדי
עדיעדי
מיכאל
מיכאלמיכאל
מיכאל
sqlserver.co.il
 
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf FraenkelBi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
sqlserver.co.il
 
DBCC - Dubi Lebel
DBCC - Dubi LebelDBCC - Dubi Lebel
DBCC - Dubi Lebel
sqlserver.co.il
 

More from sqlserver.co.il (20)

Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013Windows azure sql_database_security_isug012013
Windows azure sql_database_security_isug012013
 
Things you can find in the plan cache
Things you can find in the plan cacheThings you can find in the plan cache
Things you can find in the plan cache
 
Sql server user group news january 2013
Sql server user group news   january 2013Sql server user group news   january 2013
Sql server user group news january 2013
 
DAC 2012
DAC 2012DAC 2012
DAC 2012
 
Query handlingbytheserver
Query handlingbytheserverQuery handlingbytheserver
Query handlingbytheserver
 
Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012Adi Sapir ISUG 123 11/10/2012
Adi Sapir ISUG 123 11/10/2012
 
Products.intro.forum version
Products.intro.forum versionProducts.intro.forum version
Products.intro.forum version
 
SQL Explore 2012: P&T Part 3
SQL Explore 2012: P&T Part 3SQL Explore 2012: P&T Part 3
SQL Explore 2012: P&T Part 3
 
SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2SQL Explore 2012: P&T Part 2
SQL Explore 2012: P&T Part 2
 
SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1SQL Explore 2012: P&T Part 1
SQL Explore 2012: P&T Part 1
 
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended EventsSQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
 
SQL Explore 2012 - Michael Zilberstein: ColumnStore
SQL Explore 2012 - Michael Zilberstein: ColumnStoreSQL Explore 2012 - Michael Zilberstein: ColumnStore
SQL Explore 2012 - Michael Zilberstein: ColumnStore
 
SQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DACSQL Explore 2012 - Meir Dudai: DAC
SQL Explore 2012 - Meir Dudai: DAC
 
SQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: SpatialSQL Explore 2012 - Aviad Deri: Spatial
SQL Explore 2012 - Aviad Deri: Spatial
 
מיכאל
מיכאלמיכאל
מיכאל
 
נועם
נועםנועם
נועם
 
עדי
עדיעדי
עדי
 
מיכאל
מיכאלמיכאל
מיכאל
 
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf FraenkelBi303 data warehousing with fast track and pdw - Assaf Fraenkel
Bi303 data warehousing with fast track and pdw - Assaf Fraenkel
 
DBCC - Dubi Lebel
DBCC - Dubi LebelDBCC - Dubi Lebel
DBCC - Dubi Lebel
 

Recently uploaded

TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
Ivanti
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 

Recently uploaded (20)

TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
June Patch Tuesday
June Patch TuesdayJune Patch Tuesday
June Patch Tuesday
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 

Spatial

  • 2. Relational and Non-Relational Data Relational data uses simple data types Each type has a single value Generic operations work well with the types Relational storage/query may not be optimal for Hierarchical data Sparse, variable, property bags Some types benefit by using a custom library use extended type system (complex types, inheritance) use custom storage and non-SQL APIs use non-relational queries and indexing
  • 3. Spatial Data Spatial data provides answers to location-based queries Which roads intersect the Microsoft campus? Does my land claim overlap yours? List all of the Italian restaurants within 5 kilometers Spatial data is part of almost every database If your database includes an address
  • 4. Spatial Data Types The Open Geospatial Consortium defines a hierarchy of spatial data types Point Linestring Polygon MultiPoint MultiLinestring MultiPolygon GeomCollection Non-instanciable classes based on these
  • 5. OGC Hierarchy of Spatial Types
  • 6. SQL Server 2008 and Spatial Data SQL Server supports two spatial data types GEOMETRY - flat earth model GEOGRAPHY - round earth model Both types support all of the instanciable OGC types InstanceOf method can distinguish between them Supports two dimension data X and Y or Lat and Long members Z member - elevation (user-defined semantics) M member - measure (user-defined semantics)
  • 7. GEOGRAPHY Requirements GEOGRAPHY type has additional requirements Coordinate order is Longitude/Latitude for WKT, WKB Latitude/Longitude for GML Exterior polygon rings must have their describing coordinates in counter-clockwise order (left-hand rule) with interior rings (holes) in clockwise-order (right-hand rule) A single GEOGRAPHY object cannot span more than a logical hemisphere
  • 9. Properties and Methods The spatial data types are exposed as SQLCLR UDTs Use '.' syntax for properties Use '.' syntax for instance methods Use '::' syntax for static methods Methods and Properties are case-sensitive Each type uses a set of properties and methods that correspond to OGC functionality With Extensions Geometry implements all OGC properties and methods Geography implements most OGC properties and methods 2-D vector only implemented
  • 10. Input Spatial data is stored in a proprietary binary format Instance of the type can be NULL Can be input as Well Known binary - ST[Type]FromWKB Well Known text - ST[Type]FromText Geography Markup Language (GML) - GeomFromGml Can also use SQLCLR functions Parse Point - extension function Input from SQLCLR Type - SqlGeometry, SqlGeography Spatial builder API – Populate, IGeometrySink/IGeographySink
  • 11. Output Spatial Data Can Be Output As Well Known binary - STAsBinary Well Known text - STAsText GML - AsGml Text with Z and M values - AsTextZM SQLCLR standard method ToString - returns Well Known text As SQLCLR object - SqlGeometry, SqlGeography Other useful formats are GeoRSS, KML Not Directly Supported
  • 12. SRID Each instance of a spatial type must have an SRID Spatial Reference Identifier SRID specifies the specification used to compute it SRID 4326 - GPS, default for GEOGRAPHY SRID 4269 - usually used by ESRI SRID 0 - no special reference, default for GEOMETRY Methods that use multiple spatial types (e.g., STDistance) must have types with matching SRID Else method returns NULL Geography instance must reference one of these SRID stored in sys.spatial_reference_systems
  • 13. Useful Methods/Properties Descriptive STArea STLength STCentroid Relation between two instances STIntersects STDistance Manipulation STUnion STSymDifference Collections STGeometryN STPointN
  • 14. Sample Query Which roads intersect Microsoft’s main campus? SELECT * FROM roads WHERE roads.geom.STIntersects(@ms)=1
  • 15. Extension Methods SQL Server 2008 extends OGC methods MakeValid - Converts to OGC valid instance BufferWithTolerence - similar to STBuffer, allows approximation and variation Reduce - Simplify a complex geography or geometry NumRings, RingN - polygons with multiple rings GML support Z and M properties and AsTextZM method Filter - provides a quick intersection set but with false positives EnvelopeCenter,EnvelopeAngle for Geography types
  • 16. Spatial Indexes SQL Server Spatial Indexes Based on B-Trees Uses tessellation to tile 2D to linear Divides space into grid of cells(uses Hilbert algorithm) Meant as a first level of row elimination Can produce false positives Never false negatives You specify Bounding box of top level grid - GEOMETRY index only Cells per object - number of cells recorded for matching Grids Four Grid Levels Three Grid Densities Per Level - Low, Medium, High
  • 19. Review Spatial data provides answers to location-based queries SQL Server supports two spatial data types GEOMETRY - flat earth model GEOGRAPHY - round earth model Spatial data has Useful properties and functions Library of spatial functions Three standard input and output formats Spatial indexes
  • 20. Resources SQL Server Spatial Data Technology Center http://www.microsoft.com/sql/2008/technologies/spatial.mspx Whitepaper: Delivering Location Intelligence with Spatial Data http://www.microsoft.com/sql/techinfo/whitepapers/spatialdata.mspx MSDN Webcast: Building Spatial Applications with SQL Server 2008, Event ID: 1032353123 Whitepaper: What's New for XML in SQL Server 2008 http://www.microsoft.com/sql/techinfo/whitepapers/sql_2008_xml.mspx Whitepaper: Managing Unstructured Data with SQL Server 2008 http://www.microsoft.com/sql/techinfo/whitepapers/sql_2008_unstructured.mspx
  • 21. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.