Spatial SQL RRS feed

  • Question

  • Hi,

    In a nutshell can someone please explain how Spatial SQL works?


    Thursday, June 14, 2012 8:56 AM


  • Spatial information describes the location of features in space.

    Geospatial information, which is generally what people mean when they refer to spatial information, describes the position of features on the earth's surface.

    Those "features" might be pretty much anything - countries, roads, rivers, houses, sales regions, customers, delivery routes, power cable lines, flood zones... basically anything that could be drawn on a map.

    SQL Server 2008/R2/2012 provides a method to store such spatial information, and to let you write queries against that data to answer questions like "How far is it from A to B?", "Does the path from X to Z go through Y?", "What is the area of space occupied by M?".

    Because of the specialised nature of these queries, and the way in which they differ from regular database queries of numeric or character data, SQL Server implements spatial data using two SQLCLR datatypes - geography and geometry. The syntax required to write queries against columns of these datatypes is therefore a little bit different to regular T-SQL syntax you might be familiar with, but other than that it's just like working with any other sort of data.

    twitter: @alastaira blog: http://alastaira.wordpress.com/

    • Proposed as answer by Iric Wen Monday, June 18, 2012 9:07 AM
    • Marked as answer by Iric Wen Thursday, June 21, 2012 8:50 AM
    Thursday, June 14, 2012 10:51 AM