locked
How to start RRS feed

  • Question

  • Hi ,

    I am just a begineer in spatial data format, I want to develop an application in c#.
    I want to display map of any location asked by user(like google map).
    I want to add extra details on map like information about flats, owner name,rent etc when user hover a mouse on map the detail will appear in popup.
    after going through your forum I understand little bit like I need Sql Server 2008 R2 CTP and to show map I need to use google maps or virtual earth. 
    but I don't understand what is the use of GeoRSS feed and where to fire queries.
    how to wrote queries (is any different syntax?) 
    is it possible to create my own map?(without the use of google map n all)
    where to find latitude and longitude?
    Friday, February 19, 2010 7:31 AM

All replies

  • You don't need  SQL Server 2008 R2. In fact, you might not need a spatial database at all - from your description, it sounds like you simply want to store various columns of information related to a longitude/latitude coordinate. You can do this in any SQL database, like this:

    CREATE TABLE Flats (
      Address varchar(128),
      OwnerName varchar(64),
      Rent money,
      Latitude float,
      Longitude float
    );

    You then can simply loop through every column in your table and add the information to a pushpin on the map. The only time when you benefit from a spatial database (and the geometry/geography datatypes provided by SQL Server 2008) is when you want to start filtering or manipulating your spatial data, or if you want to store more complicated types of information such as lines or polygons.
    So, if you wanted to search for flats that were within a 25m radius of a point, or those lying within a certain postcode, or if you wanted to plot the route from each flat to the nearset school or whatever, *that's* when you benefit from SQL Server 2008. (Note that you don't need SQL Server 2008 R2 - it doesn't add any spatial features on top of those available in SQL Server 2008 other than if you use Reporting Services).
    If you just want to plot a point on the map at every lat/long coordinate in the table, the above will work just fine for you.

    Note that this is only about storing/retrieving the information in a database - SQL Server 2008 does not deal with plotting that information on Bing Maps/Google Maps. That's where GeoRSS comes in, since it is one standard format of transferring spatial data between applications. GeoRSS is just a dialect of XML (just like, for example, XHTML or KML are). You write a SELECT query in SQL Server that selects records from your database and outputs that results in GeoRSS format (using a combination of XQuery and the AsGml() method), and then use a web handler to send that result to Bing Maps / Google Maps, which can parse and import it using only a few lines of code.
    Note that there are plenty of other methods of getting data from SQL Server to web mapping clients, but if you're just starting out, you'll probably find it the easiest.

    You can of course create your own map application, but you'll need to get the source data (i.e. country outlines, roads, rivers, cities) from somewhere.... and it seems little point doing this when it's already available, for free, from either Bing or Google.

    As for finding the latitude/longitude of a location, that's called Geocoding. There's several posts already about that on this forum - a search should come up with some hits. 



    Beginning Spatial with SQL Server http://www.apress.com/book/view/1430218290
    Friday, February 19, 2010 12:48 PM
    Answerer
  • The author won't plug his own book blatently, so let me. It's terrific.

    http://www.apress.com/book/view/1430218290
    what what what
    Sunday, February 21, 2010 3:27 AM
  • Thank you Sir,
     
    I understand much more ,
    I wanted to create my own map, as I searched I found that source data like country outline n all will be available in shape files. that shape file are avaliable free also.that shape files need to convert into your tables thats why spatial data type was needed(as per my consideration) .

    I wanted to provide search for flats that were within a 25m radius of a point, or those lying within a certain postcode, orto plot the route from each flat to the nearset school, everything!

    How exactly do all that stuff?
    don't need to save that route and all in tables? 

    one extra thing is to do "Editable map" If user want to edit some info about flat n all just by double clicking on it, user can fill information in form(ne need to fill lat/log, it should come directly by clicking).

    (and and mainly I wanted to do all this stuff using MVC architecture..!)
    Monday, February 22, 2010 9:55 AM