SlideShare una empresa de Scribd logo
1 de 21
SQL Server 2008 Spatial  Geography  Implemented in ASP.net and Virtual Earth  Michael Stark StarkNetwork.com Michael@starknetwork.com blog.starknetwork.com
Outline Background Overview Spatial in SQL 2008 Creating a spatial Query in SSMS Spatial Query in ListView control Spatial Query wired up to Virtual Earth  21 Other ideas for mapping Implementation Issues This session is … a quick tour of  the spatial features of  SQL Server 2008. This session is NOT … An in-depth study of the spatial features of SQL Server 2008 An in-depth explanation of ListView Control An in-depth explanation of Virtual Earth
Overview Tyler’s Article SQL Server Magazine SQLMAG.com  Instant Doc ID  100528 Tyler Chessman's article in SQL Server Magazine's December 2008 issue is my primary source of information to implement my spatial solutions.  Visit sqlmag.com and search for instant doc ID 100528.  I have a link on my blog to the article.
Overview What is Spatial Data? Example of Spatial Data SQL Server’s answer Spatial data represents the shape and physical location of an object.   The object can be a house, business, sub-division, or a county.   SQL Server 2008 has two new data types GEOMETRY and GEOGRAPHY.   GEOMETRY works with flat objects.  GEOGRAPHY considers the shape of the earth.
GEOMETRYGEOGRAPHY	 CLR Data Types No need to enable CLR Many Methods Open Geospatial Consortium GEOGRAPHY and GEOMETRY are CLR data types.  You do not need to have CLR enabled on the SQL Server instance.   Microsoft has provided a long list of OGC methods.   These are methods that are part of the independent  Open Geospatial Consortium list of specifications.
OGC Methods	 OGC  Open Geospatial Consortium SQL Server 2008 supports  the Open Geospatial Consortium (OGC) methods on geometry instances.   These methods  make it very easy to perform  geospatial tasks that were once very difficult. STArea STAsText STBoundary STBuffer STCentroid STContains STConvexHull STCrosses STDifference
OGC Methods	 OGC  Open Geospatial Consortium SQL Server 2008 supports  the Open Geospatial Consortium (OGC) methods on geometry instances.   These methods  make it very easy to perform  geospatial tasks that were once very difficult. STDimension STDisJoint STDistance STEndPoint STEnvelope STEquals STExteriorRing STGeometryN STGeometryType
OGC Methods	 OGC  Open Geospatial Consortium SQL Server 2008 supports  the Open Geospatial Consortium (OGC) methods on geometry instances.   These methods  make it very easy to perform  geospatial tasks that were once very difficult. STInteriorRing STIntersection STIntersects STIsClosed STIsEmpty STIsRing STIsSimple STIsValid STLength
OGC Methods	 OGC  Open Geospatial Consortium SQL Server 2008 supports  the Open Geospatial Consortium (OGC) methods on geometry instances.   These methods  make it very easy to perform  geospatial tasks that were once very difficult. STNumGeometries STNumInteriorRing STNumPoints STOverlaps STPointN STPointOnSurface STIsSimple STRelate STSrid
OGC Methods	 OGC  Open Geospatial Consortium SQL Server 2008 supports  the Open Geospatial Consortium (OGC) methods on geometry instances.   These methods  make it very easy to perform  geospatial tasks that were once very difficult. STStartPoint STSymDifference STTouches STUnion STWithin STX STY
DEMONSTRATION	 List of functions to demonstrate I will demonstrate  STGeomFromText STDistance AsGML STasText STGeometryType STNumPoints.   The demonstration will return a list of stores within a provided distance of a given point.
STDistance STDistance( Point , SRID ) The STDistance function requires an argument of the SQLgeometrytype Convert the latitude and longitude to SQLgeometrytype.  Declare a variable of the geography type.   Set the variable togeography::STGeomFromText('point(lon lat)',4326). Notice that  the point is a string. Notice there is no comma between lat and lon 4326 is an SRID and is used to tell the function what method to use to calculate distance on a not-so-round planet.
SQL Statement Declare @CodeGEOG  geography = geography::STGeomFromText('Point(-95.3410 29.7070)',4326); Select top(5) addr.AddressID as id , addr.addressline1,addr.city, addr.SpatialLocation, -- Will show the raw data addr.SpatialLocation.AsGml() as SpationalGML, addr.SpatialLocation.STAsText() as SpatialText, addr.SpatialLocation.STGeometryType() as GeoType, addr.SpatialLocation.STNumPoints() as Points, addr.SpatialLocation.STDistance(@CodeGEOG) as distance_in_meters, addr.SpatialLocation.STDistance(@CodeGEOG)/1609.344 as distance_in_miles from dbo.Addressaddr Where addr.SpatialLocation.STDistance(@CodeGEOG)/1609.344 < 50   order by distance_in_miles
SSMS A demonstration of running a spatial query DEMO
Into Action A very quick run through Wire-up Spatial Query to List View Control Virtual Earth
List View Control
Virtual Earth
21 Ways John O'Brien of the GEOWebGuru.com has compiled a list of 20 ways to use VirtualEarth.  See it here http://www.geowebguru.com/articles/86-twenty-ways-to-use-the-virtual-earth-platform-as-a-developer-  Visit Weather.com to see this flash and VirtualEarth in actionhttp://www.weather.com/weather/map/interactive/33626?from=36hr_topnav_undeclared  O’Brien lists 20 ways http://maps.live.com http://dev.live.com/virtualearth http://blogs.msdn.com/VirtualEarth3D/ And more I add one more way –  ,[object Object],[object Object]
Conclusion This session was … a quick tour of  the spatial features of  SQL Server 2008. This session was NOT … ,[object Object]
An in-depth explanation of ListView Control
An in-depth explanation of Virtual EarthBackground Overview Spatial in SQL 2008 Creating a spatial Query in SSMS Spatial Query in ListView control Spatial Query wired up to Virtual Earth  21 Ways to implement VE Deployment Issues

Más contenido relacionado

Destacado

Wireless Networking Final Exam Results
Wireless Networking Final Exam ResultsWireless Networking Final Exam Results
Wireless Networking Final Exam ResultsWalmart Super Center
 
Spatial Data in SQL Server
Spatial Data in SQL ServerSpatial Data in SQL Server
Spatial Data in SQL ServerEduardo Castro
 
SQL Server Query Processor
SQL Server Query ProcessorSQL Server Query Processor
SQL Server Query ProcessorEduardo Castro
 
Creating, Maintaining and Executing your Social Media Editorial Calendar
Creating, Maintaining and Executing your Social Media Editorial CalendarCreating, Maintaining and Executing your Social Media Editorial Calendar
Creating, Maintaining and Executing your Social Media Editorial CalendarTrivera Interactive
 
Vistazo a lo nuevo en SQL Server 2016
Vistazo a lo nuevo en SQL Server 2016Vistazo a lo nuevo en SQL Server 2016
Vistazo a lo nuevo en SQL Server 2016Eduardo Castro
 
Servicios cognitivos y su integración
Servicios cognitivos y su integraciónServicios cognitivos y su integración
Servicios cognitivos y su integraciónEduardo Castro
 

Destacado (6)

Wireless Networking Final Exam Results
Wireless Networking Final Exam ResultsWireless Networking Final Exam Results
Wireless Networking Final Exam Results
 
Spatial Data in SQL Server
Spatial Data in SQL ServerSpatial Data in SQL Server
Spatial Data in SQL Server
 
SQL Server Query Processor
SQL Server Query ProcessorSQL Server Query Processor
SQL Server Query Processor
 
Creating, Maintaining and Executing your Social Media Editorial Calendar
Creating, Maintaining and Executing your Social Media Editorial CalendarCreating, Maintaining and Executing your Social Media Editorial Calendar
Creating, Maintaining and Executing your Social Media Editorial Calendar
 
Vistazo a lo nuevo en SQL Server 2016
Vistazo a lo nuevo en SQL Server 2016Vistazo a lo nuevo en SQL Server 2016
Vistazo a lo nuevo en SQL Server 2016
 
Servicios cognitivos y su integración
Servicios cognitivos y su integraciónServicios cognitivos y su integración
Servicios cognitivos y su integración
 

Similar a SQL Server 2008 Spatial Geography with VE

Intro To PostGIS
Intro To PostGISIntro To PostGIS
Intro To PostGISmleslie
 
Introduction to Oracle Spatial
Introduction to Oracle SpatialIntroduction to Oracle Spatial
Introduction to Oracle SpatialEhsan Hamzei
 
GeoMesa on Apache Spark SQL with Anthony Fox
GeoMesa on Apache Spark SQL with Anthony FoxGeoMesa on Apache Spark SQL with Anthony Fox
GeoMesa on Apache Spark SQL with Anthony FoxDatabricks
 
Representing and Querying Geospatial Information in the Semantic Web
Representing and Querying Geospatial Information in the Semantic WebRepresenting and Querying Geospatial Information in the Semantic Web
Representing and Querying Geospatial Information in the Semantic WebKostis Kyzirakos
 
2017 RM-URISA Track: Spatial SQL - The Best Kept Secret in the Geospatial World
2017 RM-URISA Track:  Spatial SQL - The Best Kept Secret in the Geospatial World2017 RM-URISA Track:  Spatial SQL - The Best Kept Secret in the Geospatial World
2017 RM-URISA Track: Spatial SQL - The Best Kept Secret in the Geospatial WorldGIS in the Rockies
 
Introduction To PostGIS
Introduction To PostGISIntroduction To PostGIS
Introduction To PostGISmleslie
 
ST-Toolkit, a Framework for Trajectory Data Warehousing
ST-Toolkit, a Framework for Trajectory Data WarehousingST-Toolkit, a Framework for Trajectory Data Warehousing
ST-Toolkit, a Framework for Trajectory Data WarehousingSimone Campora
 
LocationTech Projects
LocationTech ProjectsLocationTech Projects
LocationTech ProjectsJody Garnett
 
Building Scalable Semantic Geospatial RDF Stores
Building Scalable Semantic Geospatial RDF StoresBuilding Scalable Semantic Geospatial RDF Stores
Building Scalable Semantic Geospatial RDF StoresKostis Kyzirakos
 
Postgres Vision 2018: PostGIS and Spatial Extensions
Postgres Vision 2018: PostGIS and Spatial ExtensionsPostgres Vision 2018: PostGIS and Spatial Extensions
Postgres Vision 2018: PostGIS and Spatial ExtensionsEDB
 
Compass Framework
Compass FrameworkCompass Framework
Compass FrameworkLukas Vlcek
 
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...djkucera
 
SQL Geography Datatypes by Jared Nielsen and the FUZION Agency
SQL Geography Datatypes by Jared Nielsen and the FUZION AgencySQL Geography Datatypes by Jared Nielsen and the FUZION Agency
SQL Geography Datatypes by Jared Nielsen and the FUZION AgencyJared Nielsen
 

Similar a SQL Server 2008 Spatial Geography with VE (20)

Intro To PostGIS
Intro To PostGISIntro To PostGIS
Intro To PostGIS
 
Introduction to Oracle Spatial
Introduction to Oracle SpatialIntroduction to Oracle Spatial
Introduction to Oracle Spatial
 
GeoMesa on Apache Spark SQL with Anthony Fox
GeoMesa on Apache Spark SQL with Anthony FoxGeoMesa on Apache Spark SQL with Anthony Fox
GeoMesa on Apache Spark SQL with Anthony Fox
 
GeoMesa on Spark SQL: Extracting Location Intelligence from Data
GeoMesa on Spark SQL: Extracting Location Intelligence from DataGeoMesa on Spark SQL: Extracting Location Intelligence from Data
GeoMesa on Spark SQL: Extracting Location Intelligence from Data
 
Spatial
SpatialSpatial
Spatial
 
SQL Windowing
SQL WindowingSQL Windowing
SQL Windowing
 
Representing and Querying Geospatial Information in the Semantic Web
Representing and Querying Geospatial Information in the Semantic WebRepresenting and Querying Geospatial Information in the Semantic Web
Representing and Querying Geospatial Information in the Semantic Web
 
2017 RM-URISA Track: Spatial SQL - The Best Kept Secret in the Geospatial World
2017 RM-URISA Track:  Spatial SQL - The Best Kept Secret in the Geospatial World2017 RM-URISA Track:  Spatial SQL - The Best Kept Secret in the Geospatial World
2017 RM-URISA Track: Spatial SQL - The Best Kept Secret in the Geospatial World
 
Introduction To PostGIS
Introduction To PostGISIntroduction To PostGIS
Introduction To PostGIS
 
ST-Toolkit, a Framework for Trajectory Data Warehousing
ST-Toolkit, a Framework for Trajectory Data WarehousingST-Toolkit, a Framework for Trajectory Data Warehousing
ST-Toolkit, a Framework for Trajectory Data Warehousing
 
LocationTech Projects
LocationTech ProjectsLocationTech Projects
LocationTech Projects
 
Building Scalable Semantic Geospatial RDF Stores
Building Scalable Semantic Geospatial RDF StoresBuilding Scalable Semantic Geospatial RDF Stores
Building Scalable Semantic Geospatial RDF Stores
 
Postgres Vision 2018: PostGIS and Spatial Extensions
Postgres Vision 2018: PostGIS and Spatial ExtensionsPostgres Vision 2018: PostGIS and Spatial Extensions
Postgres Vision 2018: PostGIS and Spatial Extensions
 
JDBC – Java Database Connectivity
JDBC – Java Database ConnectivityJDBC – Java Database Connectivity
JDBC – Java Database Connectivity
 
Coding Ajax
Coding AjaxCoding Ajax
Coding Ajax
 
Compass Framework
Compass FrameworkCompass Framework
Compass Framework
 
Spatial SQL
Spatial SQLSpatial SQL
Spatial SQL
 
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
Collaborate 2009 - Migrating a Data Warehouse from Microsoft SQL Server to Or...
 
Oracle Spatial
Oracle SpatialOracle Spatial
Oracle Spatial
 
SQL Geography Datatypes by Jared Nielsen and the FUZION Agency
SQL Geography Datatypes by Jared Nielsen and the FUZION AgencySQL Geography Datatypes by Jared Nielsen and the FUZION Agency
SQL Geography Datatypes by Jared Nielsen and the FUZION Agency
 

Último

9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi
9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi
9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 DelhiCall Girls in Delhi
 
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLSeo
 
The Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case studyThe Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case studyEthan lee
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableDipal Arora
 
Keppel Ltd. 1Q 2024 Business Update Presentation Slides
Keppel Ltd. 1Q 2024 Business Update  Presentation SlidesKeppel Ltd. 1Q 2024 Business Update  Presentation Slides
Keppel Ltd. 1Q 2024 Business Update Presentation SlidesKeppelCorporation
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...lizamodels9
 
Cash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsCash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsApsara Of India
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdfRenandantas16
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Serviceritikaroy0888
 
Tech Startup Growth Hacking 101 - Basics on Growth Marketing
Tech Startup Growth Hacking 101  - Basics on Growth MarketingTech Startup Growth Hacking 101  - Basics on Growth Marketing
Tech Startup Growth Hacking 101 - Basics on Growth MarketingShawn Pang
 
Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communicationskarancommunications
 
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒anilsa9823
 
Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Servicediscovermytutordmt
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Delhi Call girls
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Dipal Arora
 
KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...
KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...
KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...Any kyc Account
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsP&CO
 
GD Birla and his contribution in management
GD Birla and his contribution in managementGD Birla and his contribution in management
GD Birla and his contribution in managementchhavia330
 
Grateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfGrateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfPaul Menig
 

Último (20)

9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi
9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi
9599632723 Top Call Girls in Delhi at your Door Step Available 24x7 Delhi
 
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRLMONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
MONA 98765-12871 CALL GIRLS IN LUDHIANA LUDHIANA CALL GIRL
 
The Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case studyThe Coffee Bean & Tea Leaf(CBTL), Business strategy case study
The Coffee Bean & Tea Leaf(CBTL), Business strategy case study
 
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service AvailableCall Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
Call Girls Pune Just Call 9907093804 Top Class Call Girl Service Available
 
Keppel Ltd. 1Q 2024 Business Update Presentation Slides
Keppel Ltd. 1Q 2024 Business Update  Presentation SlidesKeppel Ltd. 1Q 2024 Business Update  Presentation Slides
Keppel Ltd. 1Q 2024 Business Update Presentation Slides
 
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
Call Girls In DLf Gurgaon ➥99902@11544 ( Best price)100% Genuine Escort In 24...
 
Cash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call GirlsCash Payment 9602870969 Escort Service in Udaipur Call Girls
Cash Payment 9602870969 Escort Service in Udaipur Call Girls
 
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf0183760ssssssssssssssssssssssssssss00101011 (27).pdf
0183760ssssssssssssssssssssssssssss00101011 (27).pdf
 
Call Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine ServiceCall Girls In Panjim North Goa 9971646499 Genuine Service
Call Girls In Panjim North Goa 9971646499 Genuine Service
 
Tech Startup Growth Hacking 101 - Basics on Growth Marketing
Tech Startup Growth Hacking 101  - Basics on Growth MarketingTech Startup Growth Hacking 101  - Basics on Growth Marketing
Tech Startup Growth Hacking 101 - Basics on Growth Marketing
 
Pharma Works Profile of Karan Communications
Pharma Works Profile of Karan CommunicationsPharma Works Profile of Karan Communications
Pharma Works Profile of Karan Communications
 
Forklift Operations: Safety through Cartoons
Forklift Operations: Safety through CartoonsForklift Operations: Safety through Cartoons
Forklift Operations: Safety through Cartoons
 
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒VIP Call Girls In Saharaganj ( Lucknow  ) 🔝 8923113531 🔝  Cash Payment (COD) 👒
VIP Call Girls In Saharaganj ( Lucknow ) 🔝 8923113531 🔝 Cash Payment (COD) 👒
 
Call Girls in Gomti Nagar - 7388211116 - With room Service
Call Girls in Gomti Nagar - 7388211116  - With room ServiceCall Girls in Gomti Nagar - 7388211116  - With room Service
Call Girls in Gomti Nagar - 7388211116 - With room Service
 
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
Best VIP Call Girls Noida Sector 40 Call Me: 8448380779
 
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
Call Girls Navi Mumbai Just Call 9907093804 Top Class Call Girl Service Avail...
 
KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...
KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...
KYC-Verified Accounts: Helping Companies Handle Challenging Regulatory Enviro...
 
Value Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and painsValue Proposition canvas- Customer needs and pains
Value Proposition canvas- Customer needs and pains
 
GD Birla and his contribution in management
GD Birla and his contribution in managementGD Birla and his contribution in management
GD Birla and his contribution in management
 
Grateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdfGrateful 7 speech thanking everyone that has helped.pdf
Grateful 7 speech thanking everyone that has helped.pdf
 

SQL Server 2008 Spatial Geography with VE

  • 1. SQL Server 2008 Spatial Geography Implemented in ASP.net and Virtual Earth Michael Stark StarkNetwork.com Michael@starknetwork.com blog.starknetwork.com
  • 2. Outline Background Overview Spatial in SQL 2008 Creating a spatial Query in SSMS Spatial Query in ListView control Spatial Query wired up to Virtual Earth 21 Other ideas for mapping Implementation Issues This session is … a quick tour of the spatial features of SQL Server 2008. This session is NOT … An in-depth study of the spatial features of SQL Server 2008 An in-depth explanation of ListView Control An in-depth explanation of Virtual Earth
  • 3. Overview Tyler’s Article SQL Server Magazine SQLMAG.com Instant Doc ID 100528 Tyler Chessman's article in SQL Server Magazine's December 2008 issue is my primary source of information to implement my spatial solutions. Visit sqlmag.com and search for instant doc ID 100528. I have a link on my blog to the article.
  • 4. Overview What is Spatial Data? Example of Spatial Data SQL Server’s answer Spatial data represents the shape and physical location of an object. The object can be a house, business, sub-division, or a county. SQL Server 2008 has two new data types GEOMETRY and GEOGRAPHY. GEOMETRY works with flat objects. GEOGRAPHY considers the shape of the earth.
  • 5. GEOMETRYGEOGRAPHY CLR Data Types No need to enable CLR Many Methods Open Geospatial Consortium GEOGRAPHY and GEOMETRY are CLR data types. You do not need to have CLR enabled on the SQL Server instance. Microsoft has provided a long list of OGC methods. These are methods that are part of the independent Open Geospatial Consortium list of specifications.
  • 6. OGC Methods OGC Open Geospatial Consortium SQL Server 2008 supports the Open Geospatial Consortium (OGC) methods on geometry instances. These methods make it very easy to perform geospatial tasks that were once very difficult. STArea STAsText STBoundary STBuffer STCentroid STContains STConvexHull STCrosses STDifference
  • 7. OGC Methods OGC Open Geospatial Consortium SQL Server 2008 supports the Open Geospatial Consortium (OGC) methods on geometry instances. These methods make it very easy to perform geospatial tasks that were once very difficult. STDimension STDisJoint STDistance STEndPoint STEnvelope STEquals STExteriorRing STGeometryN STGeometryType
  • 8. OGC Methods OGC Open Geospatial Consortium SQL Server 2008 supports the Open Geospatial Consortium (OGC) methods on geometry instances. These methods make it very easy to perform geospatial tasks that were once very difficult. STInteriorRing STIntersection STIntersects STIsClosed STIsEmpty STIsRing STIsSimple STIsValid STLength
  • 9. OGC Methods OGC Open Geospatial Consortium SQL Server 2008 supports the Open Geospatial Consortium (OGC) methods on geometry instances. These methods make it very easy to perform geospatial tasks that were once very difficult. STNumGeometries STNumInteriorRing STNumPoints STOverlaps STPointN STPointOnSurface STIsSimple STRelate STSrid
  • 10. OGC Methods OGC Open Geospatial Consortium SQL Server 2008 supports the Open Geospatial Consortium (OGC) methods on geometry instances. These methods make it very easy to perform geospatial tasks that were once very difficult. STStartPoint STSymDifference STTouches STUnion STWithin STX STY
  • 11. DEMONSTRATION List of functions to demonstrate I will demonstrate STGeomFromText STDistance AsGML STasText STGeometryType STNumPoints. The demonstration will return a list of stores within a provided distance of a given point.
  • 12. STDistance STDistance( Point , SRID ) The STDistance function requires an argument of the SQLgeometrytype Convert the latitude and longitude to SQLgeometrytype. Declare a variable of the geography type. Set the variable togeography::STGeomFromText('point(lon lat)',4326). Notice that the point is a string. Notice there is no comma between lat and lon 4326 is an SRID and is used to tell the function what method to use to calculate distance on a not-so-round planet.
  • 13. SQL Statement Declare @CodeGEOG geography = geography::STGeomFromText('Point(-95.3410 29.7070)',4326); Select top(5) addr.AddressID as id , addr.addressline1,addr.city, addr.SpatialLocation, -- Will show the raw data addr.SpatialLocation.AsGml() as SpationalGML, addr.SpatialLocation.STAsText() as SpatialText, addr.SpatialLocation.STGeometryType() as GeoType, addr.SpatialLocation.STNumPoints() as Points, addr.SpatialLocation.STDistance(@CodeGEOG) as distance_in_meters, addr.SpatialLocation.STDistance(@CodeGEOG)/1609.344 as distance_in_miles from dbo.Addressaddr Where addr.SpatialLocation.STDistance(@CodeGEOG)/1609.344 < 50 order by distance_in_miles
  • 14. SSMS A demonstration of running a spatial query DEMO
  • 15. Into Action A very quick run through Wire-up Spatial Query to List View Control Virtual Earth
  • 18.
  • 19.
  • 20. An in-depth explanation of ListView Control
  • 21. An in-depth explanation of Virtual EarthBackground Overview Spatial in SQL 2008 Creating a spatial Query in SSMS Spatial Query in ListView control Spatial Query wired up to Virtual Earth 21 Ways to implement VE Deployment Issues
  • 22. SQL Server 2008 Spatial Geography Implemented in ASP.net and Virtual Earth Michael Stark StarkNetwork.com Michael@starknetwork.com http://blog.starknetwork.com