MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Query by shape / polygon

This is a discussion on Query by shape / polygon within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; Is it possible with mappoint drawing a polygon and then search for all user-defined pusphins lying within that polygon? I ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-16-2003
Member
Yellow Belt
 
Join Date: Dec 2002
Posts: 39
Query by shape / polygon

Is it possible with mappoint drawing a polygon and then search for all user-defined pusphins lying within that polygon?
I want to do this via VB Code. Any ideas?

Thanks a lot



Peter
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 01-16-2003
John Meyer's Avatar
Senior Member
Blue Belt
 
Join Date: Jul 2002
Posts: 479
In the help file there is a method "QueryPolygon method" that has an example. I'm not sure if you have seen that and are looking for something else or what?
__________________
John
http://www.support-pc.com

Order MapPoint 2006 Here
https://secure.mp2kmag.com/?refer=support-PC
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 02-07-2003
Member
Yellow Belt
 
Join Date: Dec 2002
Posts: 39
Yep, it works.

Problem is: Every shape is drawn by a square. I want the user to draw the shap onto the map.
Some codesnipplets / ideas out there?

Thanks a lot

Peter
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 02-07-2003
Senior Member
Black Belt
 
Join Date: Jul 2002
Posts: 5,138
i did the same thing a couple of weeks ago.. you can use all the tools offered by mappoint as long as you use "Close Curve" to create a valid polygone..

only thing you cant use is Highlight ..


i tested with the following . freeform, rectangle, scribble and line.

if you want code i can retreive some..

Code:
      For Each mpShape In mpMap.Shapes
        If mpShape.Type < geoLine Then
          For Each mpData In mpMap.DataSets
            Set mpRec = mpData.QueryShape(mpShape)
            mpRec.MoveFirst
            Do While mpRec.EOF = False
              'Found .?
              If mpRec.Pushpin.Name = "Pin #" & i Then
                frm_main.txt_event = "Found" & i & vbCrLf & frm_main.txt_event
                found = True
                GoTo FOUND_IT 'save some time
              End If
              mpRec.MoveNext
            Loop
          Next mpData
        End If
      Next mpShape
FOUND_IT:
maybe its not the pretiest code.. but it does the job well for me so far
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 02-10-2003
Member
Yellow Belt
 
Join Date: Dec 2002
Posts: 39
This is what I already have, I need the part of the code for getting the user-defined points for the freeform...
Maybe you have some code-snipplets for that?

Thanks anyway!

Peter
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 02-10-2003
Member
Yellow Belt
 
Join Date: Dec 2002
Posts: 39
What I did now is: I show the user the drawing toolbar so that the user can drw a polygon. But how do I get the polygon programmaticaly so I can execute the queryPolygon method?

Besides: I wanted the user to draw the polygon without the draw-toolbar. Any ideas?

Thanks

Peter
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 02-12-2003
Junior Member
White Belt
 
Join Date: Jan 2003
Posts: 8
Areas within a user defined polygon

Haven't tried it yet but I need to do something similar - what I've thought is to use the MouseDown to log all the points as the user clicks on the map - translate the screen positions to real coordinates using XYToLocation - this provides your location object that can then be added to your own array. Then use the array of location in the AddPolyLine method... well it seems like a good idea :) If I get it working I'll post something.

Andy
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 02-12-2003
Member
Yellow Belt
 
Join Date: Dec 2002
Posts: 39
This is exactly what I need. I do not work on it right now. If you got it first, it would be very nice if you send the code!

Greetings from Berlin / Germany!

:-)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Does an object reside in my Shape or Shape boundaries? hotrdd MapPoint 2006/2009 Discussion 1 08-04-2005 09:51 PM
Locate nearest polygon shape Dazzer MapPoint 2006/2009 Discussion 1 07-12-2004 09:19 AM
Information within polygon Dazzer MapPoint 2006/2009 Discussion 1 04-28-2004 08:50 AM
Distance from Polygon random0000 MapPoint 2006/2009 Discussion 1 04-14-2003 09:18 PM
query shape produces wrong results David Kachuck MapPoint 2006/2009 Discussion 2 12-24-2002 09:52 AM


All times are GMT -5. The time now is 01:00 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map

Cheap Ski Holidays Bulgaria
Cheap ski holidays in Bulgaria are a wonderful introduction for first time skiers. Off the slopes, Bulgaria has a fascinating cultural heritage to explore.

Greece Holidays
Find great Greece Holidays with Travel Counsellors. A personal Travel Counsellor can help you plan the perfect holiday to Greece.

Cheap Flight Canada
Making a cheap flight to Canada can become a reality when you book online with dealchecker.co.uk. Our simple search allows you to see for yourself who is the cheapest.

Holidays to Sri Lanka
Holidays to Sri Lanka are enriched by the glittering tapestry of culture and breath taking mountain views. Book a holiday there today!

Cheap Egypt Holidays
Pick up a bargain cheap Egypt holiday online when you visit ulookubook.com. Just check out our tips to make sure you book at the right time to get a great holiday for a great price. Finding cheap Egypt holidays can be simple when you know how.

Cheap holiday comparison
Travel.co.uk is a comparison service which makes it easy to search and find your cheap holiday options.

Cheap Holidays in Fuerteventura
Save your money! Live like royalty! Visit the Canary Islands! Get info on cheap holidays in Fuerteventura, only at On The Beach.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51