Community of VE/MapPoint Users and Developers
This is a discussion on Shape Vertices slow on accessing large poly within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Hey there people - Using VB6 and MapPoint 2006 here. I made sure to search the forums first before asking ...
| |||||||
| Register | Blogs | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| I made sure to search the forums first before asking on this one... I have a large polygon - large in the sense it has some 3000 + vertice pairs of lat/lon. When I cycle through to get the lat/lon ? I observe it takes 2 to 3 seconds PER reference to my shape object. Whether I go MyLocation = MyShape.Vertices(n).Location OR simply MyLat = MyShape.Vertices(n).Location.Latitude (of course these are not the real variable names ! ) Clearly it's that it's got over 3,000 pts in it, seems this is an ugly under the hood scenario for MP. My question is - anyone know WHY or WHAT I can do to remedy this ? I really just want to extract the lat/lon from this giant poly to persist it - as so many do in a DB. In my mind, ALL I want in this case is the lat/lon, and I'm surprised lat and lon are not intrinsic (I always avoid this word, throws me sometimes) - I mean, if the shape object is on a map, you'd THINK each 'point' of the poly would HAVE to already have lat/lon computed and stored in the shape object. SEEMS it's deriving it, and it takes 2 to 3 seconds per access to the vertices. If I have a smaller poly ? it's considerably shorter, if very small ? 10 pts ? very very quick. Somewhere in the MS code under the hood I bet it's for whatever reason evaluating the entire collection of vertice data for each reference to the shape object. Sure feels like there is some bubble sort code behind the scenes in MP on this one! I am also guessing it might not be that lat / lon have to be 'derived' each reference to the vertice index, BUT that the shape object has the kitchen sink and more along with it, where I JUST need to lat / lon in this case from the vertices- and I'm probably paying for all the other 'stuff' brought along intrinsic (there's that word again ! - this is where bad habits form if I start to mis-use the term, see ? now I have to ask what is extrinsic to an object - ugh!) to the shape object. So anyone have any ideas as to why ? or perhaps how I could get past this ? it takes over 1 hour on a pretty fast machine (I never said 'box' back in the 70's as a child, of course that was a mainframe and a hazeltine 1000 [wow - 4k onboard RAM]) to cycle through all 3,000 + pts. My code is via VB6. It's pretty much a For I=0 to ubound(oShape.Vertices) I call the CalcPos function so often used here, but I do observe Latitude and Longitude exposed as properties off of Shape.Vertices(i).Location.Latittude - EITHER WAY - just referencing oShape.Vertices(i).Location.Latitude <- costs 3 seconds, so I assign set oLocaton = oShape.Vertices(i).Location And get Lat and Lon almost immediatly from the shape object. Puzzling it's so costly JUST to cycle through the vertices. I better end this post as I seem to not know when to stop zooming in on the horizon to help others get the picture. Thanks in advance for any insights Tim Miltz Junior developer of some fly by night outsourcing solution that will get you project results promised in 3 days over 18 weeks ! |
| |||
| Re: Shape Vertices slow on accessing large poly
Hi, I assume that so large shape is drawn programatically. But wy do you need the lat/long pairs? Because when it is drawn programmitacly then the program already knows it. Maybe I do not understeand completely what you try to do?
__________________ rgds, Wilfried Mestdagh www.mestdagh.biz MapPoint coding demo Order MapPoint 2009 with Routing and User Tools Spreadsheet |
| ||||
| Re: Shape Vertices slow on accessing large poly
---- In my mind, ALL I want in this case is the lat/lon, and I'm surprised lat and lon are not intrinsic (I always avoid this word, throws me sometimes) - I mean, if the shape object is on a map, you'd THINK each 'point' of the poly would HAVE to already have lat/lon computed and stored in the shape object. ---- They are stored in the shape object! A shape has lots of coordinates - infact a coordinate for each vertex - hence an array of vertices. I think you have a conceptual problem. An array of longitudes, and an array of latitudes is a very poor design. For example, vertices might be defined in other ways (street addresses). No defining an array of vertices and each vertex as a location is the proper way of doing it. 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 |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Just wondering how MapPoint knows when a poly is closed. | tfmiltz | MapPoint 2006/2009 Discussion | 2 | 11-22-2007 10:53 PM |
| Re-open Is user drawn freeform Poly Closed thread | tfmiltz | MapPoint 2006/2009 Discussion | 2 | 11-09-2007 12:58 PM |
| Custom Poly Line segment Delete trapping | tfmiltz | MapPoint 2006/2009 Discussion | 2 | 10-23-2007 09:02 PM |
| MP 2004 really slow with large custom territories | Anonymous | MapPoint 2006/2009 Discussion | 4 | 02-04-2004 06:21 AM |
| How to determine the length of Shape.vertices in Delphi? | schuchhardp | MapPoint 2006/2009 Discussion | 0 | 12-13-2002 04:45 AM |
Late Ski Holidays
Hoping to book a ski holiday at the last minute? Well for late ski holidays visit Holiday Hypermarket and you can find the latest great deals for you.
Flights to Portugal
Find and book flights to Portugal. Travel Counsellors can help with travel to Portugal including flights and accommodation.
Portugal Holidays
Lisbon is perhaps Europe's most pleasant and affordable city. Check out the fantastic architecture, delicious seafood and non-stop night-life. Book Portugal Holidays with us.
Antigua Holidays
We have the most popular Antigua holidays at highly competitive prices at The Holiday Place. Book a break in sunny Antigua today.
Balearics
Before booking to the Balearics Islands make sure you check out our travel guide online. The Balearics are renowned for their vibrant nightlife but there are also some stunning Gothic cathedrals, Stone Age ruins and fishing villages.
Cheap Inclusive
Make use of our service at Travel.co.uk to help you to research cheap inclusive holidays.
Gran Canaria Holidays
Visit the Canary Islands! See information on Gran Canaria holidays at On The Beach!