Community of VE/MapPoint Users and Developers
This is a discussion on Route Geometry Exposed within the Virtual Earth Blogs forums, part of the Blogs category; This week at the Location Intelligence Conference , I announced that route geometry is now exposed in Virtual Earth. The ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Route Geometry Exposed This week at the Location Intelligence Conference, I announced that route geometry is now exposed in Virtual Earth. The SDK is now updated to reflect how you can get route geometry out of Virtual Earth. The catch is you have to use the tokening system by Implementing Customer Identification. Once you've authenticated, you will have access to the VERoute.ShapePoints Property. The way it works is that once you've calculated a route, you can use a callback to get the route geometry from the route. Here's a snippet of code I stole from an application that Johannes Kebeck wrote which combines SQL Server 2008 Spatial and Virtual Earth. In fact, Johannes has posted an entry about "FindNearRoute with Virtual Earth 6.1 and SQL Server 2008" on his blog. function GetRoute() { var options = new VERouteOptions; options.RouteCallback = RouteCallback; var locations = new Array(document.getElementById('txtStart').value, document.getElementById('txtEnd').value); map.GetDirections(locations, options); } function RouteCallback(route) { myRouteGeom = route.ShapePoints; } The first function (GetRoute()) is a custom JavaScript function which takes input from the user via a web form, creates an array for the origin (txtStart) and destination (txtEnd) then passes the array into the GetDirections() method for route calculation. Then we use the optional callback function in VERouteOptions.RouteCallback and set it to our second custom JavaScript function (RouteCallback()). Once the route calculation is complete, the callback will fire and we'll get the route geometry out of the route, stick it in the variable "myRouteGeom" and do whatever it is we'd like with it. For this scenario I discussed at Location Intelligence, you would send the route geometry to SQL Server 2008 Spatial, set a buffer around the route geometry and search against a database of points of interest to find which points of interest are along the route. This would replace the need to use MapPoint Web Service's FindServiceSoap.FindNearRoute() method. Exposing this method has a lot of implications in terms of bringing Virtual Earth closer together with Microsoft SQL Server 2008. Ed Katibah (Spatial Program Manager for SQL Server) demonstrated some functionality for setting a buffer, clipping the route based on it staying within a boundary and querying against a point set. So, let's say you're driving from San Diego to Seattle (sort of how I migrated to the PacNW) and you want to find all of the Starbucks along the way, but you only care about those in Oregon (because that's where the clouds really kick in and it's just plain tiring!). We'll, you can get the route geometry out of Virtual Earth, send it to SQL Server 2008, clip it based on the polygonal shape of the state of Oregon, and then query against a local copy of Starbucks locations. Optionally, you can pass the clipped route and points down to Virtual Earth for visualization. There are tons of scenarios this opens the doors for, so send me some of your cool demos and maybe your site will be the next one I show on stage. CP |
![]() |
| ||||
| Posted By | For | Type | Date | |
| Latitude / Longitude DMS -> Decimal Converter - MP2K Magazine | This thread | Refback | 05-05-2008 11:56 PM | |
| A Simple Add-in for MapPoint API Beginners - MapPoint Articles - MP2K Magazine | This thread | Refback | 05-03-2008 07:48 PM | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 05-03-2008 05:15 PM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| adding a pushpin to route when dragging the route | stephenmillington | MapPoint 2006/2009 Discussion | 1 | 08-31-2007 10:44 AM |
| How do I calculate a route distance without displaying route | spideybud | MapPoint 2006/2009 Discussion | 4 | 09-09-2003 10:14 AM |
Mayrhofen Ski
For ski holidays with a traditional Austrian touch book at Mayrhofen. Mayrhofen ski holidays are suitable for families and individuals alike. Book a great value holiday online.
Independent Travel Agent
Travel Counsellors is a completely Independent Travel Agent. Our travel agents are free to help with your travel plans.
Cheap Flight
Find cheap flights online at dealchecker.co.uk. We search the latest offers from the UK's leading Travel Agents, Tour Operators and Airlines.
Holidays to Cuba
For the best offers on holidays to Cuba, visit The Holiday Place today. Find a deal to suit you and your budget online!
Canaries
Find out all about the Canaries when you check out the ulookubook.com travel guides. Not only can you get a great holiday deal but you can find out useful information about potential holiday destinations.
Travel In
Travel.co.uk is the one you are looking for when checking out price comparison sites, so that you can travel in the way you choose.
Cheap Cyprus Holidays
Rejuvenate mind and body! Visit the Mediterranean! Cheap Cyprus holidays can be viewed at On The Beach!