SQL Server Mentalist


Home | Pages | Archives


BISQL # 100 – SQL Server with Spatial Data–Opportunity, Use, New Features and Example with few Queries

June 28, 2012 7:29 am

Hi Friends,

I can’t imagine this is my 100th post in SQL Mentalist Blog. We will have review post for this all 100 SQL post, Thanks to all my readers, Subscribers and well-wisher’s.

In this blog information / Discussion we are going to review one of the Teched 2012 of presentation :

Taking Microsoft SQL Server into the World of Spatial Data Management of Michael Rys

In this article we are going to cover following topics for Spatial Data in SQL server

Increased user-sophistication with use Spatial Data

Ubiquitous geographical technology

Where we can use Spatial Data (In real world Business Scenarios )

What is Spatial Data ?

What are new features Introduced in SQL Server 2012

Circular arcs segmentsimage

Circular arc support on a ellipsoidimage

Featured New Type Features in SQL Server 2012

>>My GPS position is (@lat, @lon)

declare @g geography = geography::Point(@lat, @lon, 4326);

>>Get a region of 20m around me

declare @region geography = geography::Point(@lat, @lon).STBuffer(20);

>>Get all stores within distance X

select * from Stores s

where s.geo.STDistance(@me)<@x

>>Get all stores inside a city X

select * from Stores s

where s.geo.STIntersects(@myCityBoundary)=1

Try this on your SSMS

--My GPS position is (@lat, @lon)

declare @g geography = geography::Point(@lat, @lon, 4326);

--Get a region of 20m around me

declare @region geography = geography::Point(@lat, @lon).STBuffer(20);

--Get all stores within distance X

select * from Stores s

where s.geo.STDistance(@me)<@x

--Get all stores inside a city X

--select * from Stores s

where s.geo.STIntersects(@myCityBoundary)=1

What is Comprehensive Spatial Support

We can say geography data and geometry data is interrelation between actual reality and representation of same as follows :

image

What are Spatial format and example

  1. Well-Known-Binary
  2. Well-Known-Text
  3. GML With there respective example

Well-Known-Binary:

0x0103000000010000000500000000000000004CDDC000000000004C0D4100000000004CDD4

000000000004CDD4000000000C07A104100000000004CDD400000000000BD0F410000000000

88134100000000004CDDC000000000004C0D41

Well-Known-Text:

‘POLYGON(( -30000 240000, 30000 30000, 270000 30000, 260000 320000, -30000 240000))’

GML:

<Polygon xmlns="http://www.opengis.net/gml"&gt;

<exterior><LinearRing><posList>

-30000 240000 30000 30000 270000 30000 260000

320000 -30000 240000

</posList></LinearRing></exterior>

</Polygon>

How to Load Spatial Data?

With help of following way we can load spatial data

Shape2SQL

MapPoint Add-in for SQL Server

SAFE FME

ESRI ArcGIS

Pitney Bowes EasyLoader

Resource

Author Details for your direct querying 

image

Hope this helps !!

Those who have not ye subscribe my Blog yet they can subscribe it !So that I can post you @ real time and all sort of knowledge in your mail without Zero spamming !!

Happy Learning and Sharing !!

If you want daily link and analysis or interesting link go to following website which will give @ your inbox please subscribe our following link resource blog :

Link Resource Website

For More information related to BI World visit my Mentalist Blog

Link Resource Blog >> Daily Interesting links

SQL Server Mentalist >> SQL Learning Blog

Business Intelligence Mentalist >> BI World

Connect With me on

| Facebook |Twitter | LinkedIn| Google+ | Word Press | RSS |

Posted by Vishal Pawar

Categories: Query, SQL

Tags:

Leave a Reply



Mobile Site | Full Site


Get a free blog at WordPress.com Theme: WordPress Mobile Edition by Alex King.