Community of VE/MapPoint Users and Developers
This is a discussion on QueryPolygon Results Question within the Development forums, part of the MapPoint 2006/2009 Discussion category; I am relatively new to MapPoint. I am coding a Windows Forms app (VB.NET 2005) using the OCX that ships ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| locations(0) = objMap.XYToLocation(0, 0) locations(1) = objMap.XYToLocation(objMap.Width, 0) locations(2) = objMap.XYToLocation(objMap.Width, objMap.Height) locations(3) = objMap.XYToLocation(0, objMap.Height) locations(4) = objMap.XYToLocation(0, 0) Dim objDataSet As MapPoint.DataSet = objMap.DataSets(1) objSelectedPushpins = objDataSet.QueryPolygon(locations) I'm finding that when I have pushpins near the edges of the map, some of the pushpins at the top of the map are not always being selected while some pushpins just below the visible portion of the map are being selected. This seems to most prevalent when I'm zoomed out. My theory is that while I'm feeding the QueryPolygon method coordinates of a perfect rectangle, that rectangle needs to be applied to a spherical object in the background (i.e. the Earth) before the data can be queried. The rectangle is distorted by the curvature of the Earth. This causes a visual discrepancy between what you think should be selected and what actually gets selected. Am I making any sense at all? If so, does anyone know if my theory is correct? Does QueryPolygon take the curvature of the Earth into consideration and might that account for what I'm seeing? Or do I just have a bug? Thanks. |
| |||
|
I've come across this issue as well. Your theory is correct. The rectangle is computed and rendered in flat-space, when it should be rendered as a trapezoid with curved east-west sides. The only solution I came up with at the time was to expand the rectangle into a hexagon with the east-west points expanded outward according to the current zoom level. I wound up breaking/expanding the east-west points at one-third north of the lesser absolute latitude. (south of the equator, you'd use one-third south) This does still incorporate some error, particularly at the east-west points, but it is far less than the flat-space rectangle. HTH -Paul |
![]() |
| ||||
| Posted By | For | Type | Date | |
| MapPoint Download - MP2K Magazine | This thread | Refback | 01-13-2008 07:41 AM | |
| Automating MapPoint with Perl - MapPoint Articles - MP2K Magazine | This thread | Refback | 01-13-2008 12:22 AM | |
| Spambayes Install For Outlook Express - MapPoint Articles - MP2K Magazine | This thread | Refback | 01-12-2008 08:32 PM | |
| The Magazine for MapPoint - MP2K Magazine | This thread | Refback | 01-10-2008 01:00 PM | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| QueryPolygon Error | dfriebus | Development | 2 | 12-31-2007 07:51 AM |
| Two results for one address :-( | alex_kuechler | MapPoint 2006/2009 Discussion | 8 | 03-08-2007 04:24 AM |
| GPS Coordinates Results | tommyf | MapPoint 2006/2009 Discussion | 10 | 02-14-2007 03:02 AM |
| FindAddress Results in c# | starbuck | MapPoint 2006/2009 Discussion | 1 | 09-21-2004 05:00 PM |
| help - new user, no results | Anonymous | Products: Pushpin Tool, Single State Mapper | 1 | 07-29-2003 10:56 PM |
Cheap flights to Madrid
Visit Madrid with bullfighting and the "Golden Triangle of Art" ready for you to view. For cheap flights to Madrid book here.
Greece Holidays
Find great Greece Holidays with Travel Counsellors. A personal Travel Counsellor can help you plan the perfect holiday to Greece.
Cheap Flights to Cape Town
Here at dealchecker.co.uk we’ll shop around for cheap flights to Cape Town so you don’t have to. Find and Compare prices from over twenty UK travel agents with just one search.
Holidays to Barbados
Holidays to Barbados have so much to offer. Enjoy the beauty of this Caribbean island for less by booking your holiday through us.
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.
Cheap Travel
For cheap travel options, visit Travel.co.uk and explore the benefits of our comparison site.
Cheap Holidays in Gran Canaria
Would you like to visit the Canary Islands, but you're on a budget? Get information on cheap holidays in Gran Canaria at On The Beach.