Intro to Spatial Data in SQL Server 2008 R2 Russ Burns MVT Sr. Apps Developer.

12
Intro to Spatial Data in SQL Server 2008 R2 Russ Burns MVT Sr. Apps Developer

Transcript of Intro to Spatial Data in SQL Server 2008 R2 Russ Burns MVT Sr. Apps Developer.

Intro to Spatial Data in SQL Server 2008 R2

Russ BurnsMVT Sr. Apps Developer

About PASS

The PASS community encompasses everyone who uses the Microsoft SQL Server or Business Intelligence Platforms. This includes database administrators, application developers, Business Intelligence professionals, information technology professionals, executives, consultants, educators, instructors, and students.

The Professional Association for SQL Server (PASS) is the only independent, user-run, not-for-profit association dedicated to the SQL Server community helping its members Connect, Share, and Learn

by: – Facilitating member networking and exchange of information through our websites,

Chapters, annual Summits, regional and local events, and virtual communities

– Working with Microsoft to influence the evolution of SQL Server products and services

– Delivering high quality, up-to-date, technical content, presentations, and other educational material for professional development

Russ Burns

• Senior Apps Developer with Mesilla Valley Transportation

• Over a dozen years working with SQL Server• Contact Info: [email protected]

Agenda

•What is SQL Spatial?•What does it look like in SQL?•How will users see it?•Does it do more than maps?•What is next?

What is SQL Spatial?

• Represent 2D space– Points, Lines, Polygons.

• With functions!– Area, distance,

intersection, etc.

• Data Types added in SQL Server 2008.

• Reporting Services support with 2008 R2.

What does it look like in SQL?

• SELECT geom FROM dbo.USStates

• SELECT CAST(geom as varchar(max)) FROM dbo.USStates

• or even visually:

How will users see it?

• 3rd party controls– http://sharpmap.codeplex.com/– Write your own viewer

• Virtual Earth, Google Maps, etc.– Translate into KML and post on public website

• SQL Server 2008 R2 Reporting Services

Does it do more than maps?

• Office Layout with performance

What is next?

• SQL Server 2012– Arcs

• GEOGRAPHY::STGeomFromText('CIRCULARSTRING(0 -23.43778, 0 0, 0

23.43778)',4326)• First and third points define ends. Middle point defines point

the arc passes through.

– Circle• Multiple Arcs

– Aggregates– Improved Precision and Performance – http://msdn.microsoft.com/en-us/library/hh377580.aspx

Did-Ya-Know’s

• Moving Spatial Data– Windows Command Line

• Bcp “mapdata.dbo.usstates” out “e:\states.bin” –T –n

– T-SQL• bulk insert usstates from ‘E:\states.bin’ with

(dataFileType=‘Native’)

• Links:• http://msdn.microsoft.com/en-us/magazine/dd434647.aspx• http://www.sqlservercentral.com/articles/

SQL+Server+2008+R2/72530• http://jasonfollas.com/blog/archive/2008/03/14/sql-server-2008-

spatial-data-part-1.aspx• http://technet.microsoft.com/en-us/library/bb933802.aspx

Thanks!

• Register at http://www.sqlpass.org and join LCEP (southwest)

• Future Presentations• Free stuff and Q&A• Come back next month!

• Email me with any questions

Thank You from PASS

www.sqlpass.org