Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12345»»»

Geocoding with SQL Server 2005 Expand / Collapse
Author
Message
Posted Friday, April 14, 2006 11:44 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, April 17, 2012 2:21 PM
Points: 55, Visits: 168
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/cBunch/geocodingwithsqlserver2005.asp
Post #273409
Posted Monday, May 01, 2006 6:19 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Tuesday, December 07, 2010 8:19 AM
Points: 327, Visits: 123

Corey,

Very interesting article.  Do you know if Yahoo places restrictions on the number of records passed to their system for Geocoding before they would require a license?

I make extensive use of geocoding already using licensed software.  It would be very nice to append lat/long on the database to speed things up.  The cost of passing over 10 million customer records through this type of tool may make it impractical for myself to use.

Any thoughts?

Post #276499
Posted Monday, May 01, 2006 6:25 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, April 17, 2012 2:21 PM
Points: 55, Visits: 168
Well, initially when I prepared the article, it was 50,000 hits per day. But I just checked now, and they have changed it to 5,000 hits per day . Their popularity must have gone up. Yes - 10 million would be a problem. But See the rate limiting area on this page......

http://developer.yahoo.com/maps/rest/V1/geocode.html

Also, the Terms of Use would probably restrict you from doing anything too high powered.
Post #276501
Posted Monday, May 01, 2006 7:35 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, August 08, 2007 2:25 PM
Points: 53, Visits: 1

This is really neat.

What is the easiest way to process the XML if you just write a script to capture the URL's to a file?

Post #276517
Posted Monday, May 01, 2006 7:39 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, April 17, 2012 2:21 PM
Points: 55, Visits: 168
I don't profess to be a C# wiz, so don't have an exact answer. I would start with the XmlTextReader object. In my code I put it in the Dataset, just b/c I was used to working with the dataset.
Post #276520
Posted Monday, May 01, 2006 8:50 AM
SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: Moderators
Last Login: Today @ 3:54 PM
Points: 8,369, Visits: 733
The only issue is what geocoding method you need. There are more than a half dozen which all work for areas in say Florida, but for locations in New York you end up with pointers to the opposite street corner. I forget what version we use here, but you want to be sure you are geocoding correctly, especially if the Government is over your sholder. The only issue I have with many of these site is they all use the same images that in many cases are 5+ years old.


Post #276568
Posted Monday, May 01, 2006 8:53 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, April 17, 2012 2:21 PM
Points: 55, Visits: 168
Definitely something to consider - if your company or business relies on you being accurate down to a tolerance of feet, or the density of the location (NY) is such that this accuracy would be absolutely necessary, then these free tools may not be the best.
Post #276570
Posted Monday, May 01, 2006 9:15 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, February 09, 2008 9:28 AM
Points: 4, Visits: 2

Corey,

This is a very interesting article, but how do you create the DLL with Visual Studio 2005 Standard Edition?  I do not have the option of making a "SQL Server Project".

Thanks,

Allan

Post #276580
Posted Monday, May 01, 2006 9:17 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Tuesday, April 17, 2012 2:21 PM
Points: 55, Visits: 168
I think this should work if you don't have the SQL Server project option....

1 - open VS 2005, and choose new project, type "Class Library". Name it the same as in the article (YahooGCSQL), just to keep it straightforward.
2 - erase everything in Class1.cs and replace with the code included in the article
3 - rename Class1.cs to YahooGCSQL.cs & rename the project as well

I think this should work for you. Give it a try. If there are C# experts out here that know of a better way, just let us know.
Post #276581
Posted Monday, May 01, 2006 10:25 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, February 09, 2008 9:28 AM
Points: 4, Visits: 2

The "Class Library" method worked.  Since I don't have clean addresses to start with, I changed the code to take advantage of the "Location" feature in Yahoo (http://developer.yahoo.com/maps/rest/V1/geocode.html):

Microsoft.SqlServer.Server.SqlProcedure]

public static void SPGeocode(string Address)

...

//Build the URL

URL = "http://api.local.yahoo.com/MapsService/V1/geocode?appid=MYAPPID&location=" + Address;

I also modified the Stored Procedure to get rid of the extra parameters.  Some warning messages are pretty long, so you might consider setting the length of the "warning" column to at least 250.

This is a very handy program.  Thanks for posting it, Corey!

Allan

 

Post #276604
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse