Community of VE/MapPoint Users and Developers
This is a discussion on C# FindNearby within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hello, I use the FindNearby fuction in a C# program to determine the nearest street to a position given by ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| C# FindNearby I use the FindNearby fuction in a C# program to determine the nearest street to a position given by latitude/longitude. I have the following problem: the returned FindResult can contain Location and Pushpin objects. How can I find out the type of each element in the FindResult? It seems to me they are all of the type ComObject. I'm just trying to find out the nearest street. Bye, MD |
| |||
|
Hi, Code: FindResults Nearby = PP.Location.FindNearby(10);
foreach (object o in Nearby) {
if (o is Pushpin)
// this is a pushpin
else if (o is Location)
// this is a Location
Code: FindResults Nearby = PP.Location.FindNearby(10);
foreach (object o in Nearby) {
Location loc = o as Location
if (o != null) {
// voila !
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: C# FindNearby
Hi, Quote:
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| ||||
| FindNearest only give you "points of interest", so no streets. But of course these points of interest have a streetaddress in many case. In many cases? Hmmm, I'm having problems here with FindNearby. I was using it fine, but when you ask for the nearest ATMs within 20 miles say, it isn't much use if a dozen of them are all called "Bank of America". I need some (human) way to distinguish them, eg. street address. At the moment I'm finding StreetAddress is nothing. Let me see how many are affected, it was looking like all of them a few minutes ago, though... Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009 |
| ||||
|
Looks like you're right Wilfried. Virtually all the POIs I've tried in the Dallas area have street information. A handful don't - just enough to crash my program unless I check the StreetAddress property for null/nothing! Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009 |
| |||
|
Hi Richard, Quote:
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| ||||
|
No I'm fine Wilfried. I was adding my own code to my own program and found it crashing. It is one more thing to check, but at least the data is there in most cases - which I think is enough for this customer. Richard
__________________ Winwaed Software Technology LLC http://www.winwaed.com See http://www.mapping-tools.com for MapPoint Tools Pre-Order MapPoint 2009 today: http://www.mapping-tools.com/mappoint2009 |
![]() |
| Tags |
| findnearby |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| FindNearby or QueryCircle | RickS | MapPoint 2006/2009 Discussion | 1 | 12-27-2005 10:53 AM |
| Problem or Bug using FindNearby | Anonymous | MapPoint 2006/2009 Discussion | 0 | 09-13-2004 01:05 PM |
| FindNearby problem | webjagger | MapPoint 2006/2009 Discussion | 0 | 06-25-2004 06:56 AM |
| Help with FindNearby | BobIDEAS | MapPoint 2006/2009 Discussion | 1 | 01-30-2003 11:17 PM |
| FindNearby Method | Anonymous | MapPoint 2006/2009 Discussion | 0 | 09-24-2002 10:08 AM |