how to work with spatial data RRS feed

  • Question

  • Hi All,
                 I want to map my cube with spatial data,
                 I am new to this spatial data,i don't know how to work with spatial
                 data and even how to open it in the wizard.I have no idea about it.
                could anyone please help me by telling that how should i start working
                with spatial data.
               plz tell me that how will i get open this spatial data in sqlserver 2008.
              is there anyother wizard for it.
    Monday, March 2, 2009 9:18 AM

All replies

  • I don't think there are any 'wizards' specifically for spatial data.... the spatial datatypes, geometry and geography, are simply new datatypes like varchar(32), int, datetime etc. The difference is that they are object-based CLR-datatypes (like UDTs that you may have used in SQL Server 2005) that are associated with their own specific set of methods.

    However, even though using the datatypes is not complicated, there is a LOT to learn about about working with spatial data that you'll want to get to grips with.... try reading up the spatial articles at the following blogs:

    If you've got a specific problem that you are trying to solve, perhaps you could give some more details in your post and we might be able to help..... I'm not sure what 'map my cube with spatial data' means - do you have customer addresses that you want to plot? Or delivery routes? Postal districts? What business problem are you trying to solve by using spatial data?

    Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290
    Monday, March 2, 2009 9:50 AM

  • thnx for the reply,

     look,what i am trying to say is.
    I have made a cube in SSAS, and cube consist a geographic dimension.

    My fields are country, region,  state, and city.Nw i want to show sales by geography.

    that's why i want to integrate cube with spatial data.

    Suppose on the map of india,  if i point on some city it should show some relevent data.

    that means sales.

    that's why i need to integrate cube and maps(spatial data).

    Now are you getting my point??

    plz tell me how can i do this....... 
    Monday, March 2, 2009 12:01 PM
  • SQL Server provides the backend database functionality necessary to store and manipulate spatial data, but it is not designed for displaying it. So if you want to show a 'map' you need to integrate the output of SQL Server with a mapping tool (Virtual Earth or Google Maps can be used, as well as plenty of others). I would concentrate on a simple table of geographic data before worrying about cubes.
    If you only want to show a quick visualisation of some spatial results, you can use the spatial results tab in SQL Server Management Studio, as follows:

    CREATE TABLE #IndianCities ( 
    city varchar(32), 
    region varchar(32), 
    country varchar(32), 
    sales int
    location geography 
    INSERT INTO #IndianCities VALUES 
    SELECT * FROM #IndianCities 

    The parameters passed to the Point() method represent the latitude and longitude of each city (taken from http://www.mapsofindia.com/lat_long/kerala/kerala.htm) and the final parameter represents the spatial reference system from which these coordinates were obtained (4326 = GPS).
    Switch to the spatial results tab and you'll get a display of each pushpin representing the cities in the table. Hovering your mouse cursor over them brings up an infobox containing the relevant rows of data from the table relating to that city. If you overlay this on a set of polygon data representing countries of the world, for instance, then you get this result: (the points representing each city are pretty small - you could make them bigger by adding an STBuffer() around the results of the geography column)

    Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290
    Monday, March 2, 2009 12:58 PM
  • hi,
             which version of sql server management studio is supporting  spatial data.
      Because i have the enterprise edition of sql server2008, when i execute the query in query pane,
    it is giving me the error saying can not find geography data type.

     so what should i do.
    Thursday, March 5, 2009 9:26 AM
  • As far as I know all versions of Sql Server 2008 support the spatial datatypes - even SQL Server Express. Are you definitely running the query against a 2008 DB?
    What happens if you try the following simple query:
    DECLARE @g geometry 
    SET @g = geometry::Point(1,2,3) 

    Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290
    Thursday, March 5, 2009 9:38 AM

  • i HI,
               it's perfactly running on the localhost,  but when i try to run these queries on the second instance
    of server.it is giving me the error"Can not find geography datatype".

    but when i run these queries on localhost it is perfactly running.
    but when i write select * from indiancities.
    iit is not giving me the spatial result tab.
    why this is happening.

    i am using the version     Microsoft SQL Server 2008 (CTP) - 10.0.1442.32
    Friday, March 6, 2009 6:48 AM
  • Ah-ha! You are running a CTP release of SQL Server (I think v10.0.1442.32 was Release Candidate 0).

    Basically, a CTP (Community Technical Preview) version is a bit like a Beta version of the software. It is not designed for production use, and does not necessarily contain all of the features of the final version. The Spatial Results tab was only introduced very shortly before SQL Server 2008 was released, so wasn't included in any of the CTPs.

    I recommend that you upgrade to a full version of SQL Server 2008 as soon as possible.... partly because I expect the CTP version to expire soon, and partly to make sure you are properly licenced. (You can even use spatial data in SQL Server 2008 Express, which is freely available for certain use from http://www.microsoft.com/express/sql/download/)

    Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290
    Friday, March 6, 2009 9:11 AM
  • yes  you are right i am having that version, and i have a license. please tell me for this which version i have to download and from where i can download it. 
    Friday, March 6, 2009 9:48 AM
  • If you already have paid for SQL Server 2008 licence, I'd contact your licence provider to get hold of the software!

    You can download the Express version from the link I included in my last post - http://www.microsoft.com/express/sql/download - but this is the cut-down, express version (limited to 1 CPU, 4Gb database size, some other features missing). If you have an enterprise licence I'd make sure you are using the enterprise version...

    Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290
    Friday, March 6, 2009 1:08 PM
  • Thnx for a reply,
                                    I have downloaded  SQL Server 2008 Express with Advanced Services
                                     from the above link...is this the right version?
    Saturday, March 7, 2009 5:28 AM
  • Hi Guys,

    I have tried these codes but when i run it i dont have the spatial result tab coming up. At the moment i have downloaded visual studio 2017(SSDT).

    Is there anything else that i need to download to get the spatial result tab to appear.




    Sunday, July 7, 2019 11:40 PM