Community of VE/MapPoint Users and Developers
This is a discussion on Need Help VB App Speed and Findresult Error within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I am creating a VB application that searches for matches of Office locations to a user suplied address -objLOC(1) . ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| Need Help VB App Speed and Findresult Error Also if the address is bad, like say a PO Box instead of a street address, it bombs out with a " MEthod Find Address Results of Object_Map Failed " error, shouldn't it just find it with a bad result quality? Here is the code Do Until rsA.EOF Set objFIND = Me.MappointControl1.ActiveMap.FindAddressResults (rsA! aglocstradr, rsA!agloccity, , rsA!agloczip) If objFIND.ResultsQuality <> geoFirstResultGood Then GoTo Nextone Set objLoc(x) = objFIND.Item(1) If objLoc(1).DistanceTo(objLoc(x)) > 25 Then GoTo Nextone Set objPIN(x) = MappointControl1.ActiveMap.AddPushpin(objLoc(x), rsA!agname) objPIN(x).Symbol = 25 x = x + 1 Nextone: rsA.MoveNext Loop |
| |||
| Re: Need Help VB App Speed and Findresult Error
Hi, Please set next time your code between [ code] [ /code] tags for better readability. You should do a few additional checks. First of all you should sheck if the item is a Location object (because it also can be a Pushpin object). Then if it is a Location object. Then you can see if it is a valid address by checking the StreetAddress property. It can be null (I think Nothing in VB). But you can also check the Type property for this (Look for GeoShowDataBy in the help), but checking StreetAddress should be ok also. About speed, try to figure out whitch line of code take the most time to see what we can speedup. If the DistanceTo take time then you can write this yourself, and if it is the adding of pushpins then you can use a file to add them all at once. But I think it is the FindAddressResults that take the most time. There is a windows API call GetTickCount that you can use to measure the time (milliseconds, but is sufficient in this case).
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| |||
| Re: Need Help VB App Speed and Findresult Error
You should create a base pushpin map with all your office locations as pushpins (instead of forcing mappoint to geocode the offices each time you do a search.) When performing the search, geocode the starting (customer) address, and create a radius around it. Then use the QueryCircle() method to find all office locations within a 25 mile radius. HTH Paul |
![]() |
| Tags |
| app, error, findresult, speed |
| ||||
| Posted By | For | Type | Date | |
| MapPoint Download - MP2K Magazine | This thread | Refback | 04-28-2007 07:07 AM | |
| Spatial Data Importer Contest Submission - MP2K Magazine | This thread | Refback | 04-24-2007 08:01 PM | |
| Using MapPoint from Word, Access and Excel - MapPoint Articles - MP2K Magazine | This thread | Refback | 04-24-2007 02:38 PM | |
| Home Locator Sample Application - MapPoint Articles - MP2K Magazine | This thread | Refback | 04-23-2007 10:03 PM | |
| Creating Geocoding Exceptions for MapPoint Web Service Applications - MapPoint Articles - MP2K Magazine | This thread | Refback | 04-19-2007 04:37 PM | |
| Microsoft MapPoint 2006 - MP2K Magazine | This thread | Refback | 04-17-2007 01:59 PM | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 04-16-2007 10:11 AM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Run-time error 2147467259 80004005 automation error | ThomasB | MapPoint 2006/2009 Discussion | 2 | 02-27-2007 11:41 AM |
| Open Map Speed | Yazzy | MapPoint 2006/2009 Discussion | 1 | 06-27-2005 10:52 AM |
| Speed of the service | sbedin | MapPoint Web Service and Virtual Earth | 0 | 12-21-2004 10:13 AM |
| Excel VBA or VB6 For Speed | DavidP | MapPoint 2006/2009 Discussion | 3 | 08-14-2004 05:50 PM |
| How to speed up MapPoint | Dean | MapPoint 2006/2009 Discussion | 0 | 08-30-2002 10:16 AM |