Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the wordpress-seo domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home4/lifeint9/public_html/vandelayweb/wp-includes/functions.php on line 6114

Warning: Cannot modify header information - headers already sent by (output started at /home4/lifeint9/public_html/vandelayweb/wp-includes/functions.php:6114) in /home4/lifeint9/public_html/vandelayweb/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/lifeint9/public_html/vandelayweb/wp-includes/functions.php:6114) in /home4/lifeint9/public_html/vandelayweb/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/lifeint9/public_html/vandelayweb/wp-includes/functions.php:6114) in /home4/lifeint9/public_html/vandelayweb/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/lifeint9/public_html/vandelayweb/wp-includes/functions.php:6114) in /home4/lifeint9/public_html/vandelayweb/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/lifeint9/public_html/vandelayweb/wp-includes/functions.php:6114) in /home4/lifeint9/public_html/vandelayweb/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/lifeint9/public_html/vandelayweb/wp-includes/functions.php:6114) in /home4/lifeint9/public_html/vandelayweb/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/lifeint9/public_html/vandelayweb/wp-includes/functions.php:6114) in /home4/lifeint9/public_html/vandelayweb/wp-includes/rest-api/class-wp-rest-server.php on line 1893

Warning: Cannot modify header information - headers already sent by (output started at /home4/lifeint9/public_html/vandelayweb/wp-includes/functions.php:6114) in /home4/lifeint9/public_html/vandelayweb/wp-includes/rest-api/class-wp-rest-server.php on line 1893
{"id":2170,"date":"2013-07-04T21:09:59","date_gmt":"2013-07-04T21:09:59","guid":{"rendered":"http:\/\/www.vandelayweb.com\/?p=1"},"modified":"2019-03-21T05:12:43","modified_gmt":"2019-03-21T05:12:43","slug":"getting-latitude-longitude-from-a-street-address-using-c-sharp-and-visual-studio-net","status":"publish","type":"post","link":"https:\/\/www.vandelayweb.com\/getting-latitude-longitude-from-a-street-address-using-c-sharp-and-visual-studio-net\/","title":{"rendered":"Getting Latitude & Longitude from a Street Address Using c# and Visual Studio.net"},"content":{"rendered":"

I was working on a project last night utilizing Bing embeddable Maps and wanted to generate these maps on the fly for some WordPress post automation I was employing. I took the map embed code and tried to simply swap out the address references for each new location. That was a no go. It seems the address is more or less window dressing in the Maps equation. What the Microsoft developers really key off of is the latitude and longitude coordinates nested in the string. So the question became, how can I easily pull these elements into Visual Studio?<\/p>\n

Enter Bing Maps API. You can pass the web services the street address, and they’ll pop out the the latitude and longitude along with plenty of other useful info. If you are entertaining this approach for a large scale project, I’d definitely suggest digging into the documentation to take advantage of all the bells and whistles this API has to offer. Here are a few helpful links over on Microsoft’s site.<\/p>\n

http:\/\/www.microsoft.com\/maps\/developers\/web.aspx<\/a>
\n
http:\/\/msdn.microsoft.com\/en-us\/library\/cc161074.aspx<\/a><\/p>\n

For our quick and dirty approach, the method below quickly gets at the heart of the matter. As you can see, we pass in all the address elements and reassemble them as parts of the Uri. We created our XMLDocument object (don’t forget you need to import the System.Xml library) then load up the returned XML data block. From here we define the Namespace then drill down via XPath to target the latitude and longitude values returned. I was returning them as one string with a tilda in between. Really painfully simple.<\/p>\n