Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 5 of 5

How can I locate the position of a freeform shape ....

This is a discussion on How can I locate the position of a freeform shape .... within the MapPoint Desktop Discussion forums, part of the Map Forums category; How can I locate the position of a freeform shape object so I can keep this information in a database ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    How can I locate the position of a freeform shape object so I can keep this information in a database and use it to reproduce the same shape and position when I need it?

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    Thanks John, the only problem I have is a freeform has no Location or a center point to start from. I also did not find a way of using the "Points" of the freeform.

    Sylvain

  3. #3
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4
    Use the vertices. Look in Walt's code (referenced above) to see how he accomplishes it.. or just use Walt's solution. - Eric
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  4. #4
    Eric Frost's Avatar
    Eric Frost is offline Administrator Black Belt
    Join Date
    Jul 1992
    Posts
    5,094
    Blog Entries
    4
    Also, check out Walt's mif/mid exporter: http://www.mp2kmag.com/importersub01.asp . Whether you have MapInfo or not, this can still be useful as it exports text files, you can parse those to get the coordinates. It's compiled for you and linked from a past update: http://www.mp2kmag.com/update/?id=5 Look near the bottom. - Eric
    ~ Order MapPoint MapPoint 2013 Here and Get Free Access to the MapForums Downloads ~
    ~~
    ~ Upgrade to Get Access to the MapForums Downloads ~

  5. #5
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137
    First you need to read/download the code written by Gilles Kohl "A More Compact Method for Obtaining Lat/Long " at


    http://www.mp2kmag.com/articles.asp?ArticleID=13



    cut/paste that code into a module. Make sure you have a reference to the Microsoft Mappoint 9.0 object Library(North America)



    Assuming you have a shape on your map this code will give you a message box with the Lat/Long for the shape. Store them in you database. When you want to recreate the shape use the GetLocation method with your lat/long. Then use the addshape method. You will also need the size you want the shape to be so you might want to store that as well.



    Public thelat As Double

    Public thelon As Double


    Private Sub Command1_Click()

    Dim iShape As MapPointCtl.Shape

    Set iShape = MappointControl1.ActiveMap.Shapes(1)



    Dim themap As MapPoint.Map

    Set themap = MappointControl1.ActiveMap

    Dim theloc As MapPoint.Location

    Set theloc = iShape.Location


    CalcPos themap, theloc, thelat, thelon

    MsgBox thelat & " , " & thelon


    John

    john@support-pc.com

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Start Draw shape (freeform)
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 10-24-2006, 06:37 PM
  2. Getting the coordinates from a freeform shape
    By pst in forum MapPoint Desktop Discussion
    Replies: 5
    Last Post: 07-14-2005, 07:19 AM
  3. Locate nearest polygon shape
    By Dazzer in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 07-12-2004, 09:19 AM
  4. freeform shape exporting.. database maybe?
    By Yard in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 07-25-2003, 08:22 AM
  5. View bounds of a Freeform Shape
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 04-29-2003, 05:35 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83