MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Shape coordinates

This is a discussion on Shape coordinates within the MapPoint 2006/2009 Discussion forums, part of the Map Forums category; I need to retreive the latitude and longitude coordinates of the corners of a shape (rectangle). The way that Ive ...


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

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 09-19-2005
Junior Member
White Belt
 
Join Date: Sep 2005
Posts: 6
Shape coordinates

I need to retreive the latitude and longitude coordinates of the corners of a shape (rectangle). The way that Ive tried it is to take the centre location. Convert it into XY values, then take the width and height of the shape and then minus half the width and height from the centre XY values to retreive the upper left corner coordinates and then add them to get the lower right coordinates. Then using these I can calculate their locations. However when I do this the push pins that should appear on the corner of the shape, appear somewhere within the shape. Any ideas?

Im sure someone has already done this. Please help.
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 09-19-2005
Junior Member
White Belt
 
Join Date: Sep 2005
Posts: 6
Ive been messing around and Ive found my problem. The centre point of the shape is given as a location that when converted into XY coordinates gives the pixel position. The width and height of the shape are masured in GeoUnits (km/miles). So how do I find a location that is exactly x miles east and y miles north of another location.
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 09-19-2005
Junior Member
White Belt
 
Join Date: Sep 2005
Posts: 6
Ah ha, I use the PixelSize method. Please dont reply Ive done it now. Cheers anyway
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 09-19-2005
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
Hi,

Thanks for feedback. It can benefit others too
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-28-2007
Junior Member
White Belt
 
Join Date: Jan 2007
Posts: 5
Re: Shape coordinates

Please can you post a little example. I am playing around but can not get it work. Regardless if I am using the PixelSize or not.

Thank you.
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-28-2007
Member
Green Belt
 
Join Date: Nov 2006
Posts: 88
Re: Shape coordinates

Rushmore,

What can't you get it work? Be more specific please.

Maybe this is your solution:
* Create a rectangular shape
* Select it
* Call the selected area (which is the selected rectangular)
* Get its top/left area (which is in pixels)
* Get its width/height (which is also in pixels)
* Calculate its angle positions of the rectangle (which is also the selected area) and ofcourse these are all in pixels
* Than convert them to Lon/Lat, there is a function for it.
* Voila, you're done!

I hope that's your solution and I also hope next time you wil help me too
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-28-2007
Junior Member
White Belt
 
Join Date: Jan 2007
Posts: 5
Re: Shape coordinates

Quote:
Originally Posted by VC_Man View Post

* Create a rectangular shape
* Select it
* Call the selected area (which is the selected rectangular)
* Get its top/left area (which is in pixels)
* Get its width/height (which is also in pixels)
* Calculate its angle positions of the rectangle (which is also the selected area) and ofcourse these are all in pixels
* Than convert them to Lon/Lat, there is a function for it.
* Voila, you're done!
Ok, I have created the rectangular shape. Then I have called the Select()-Method from the shape. The shape is selected now! But If I look at the SelectedArea properties, the height, top, width and left properties are zero. What I am doing wrong?

I am using C# VS 2005 and Mappoint 2006.
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 03-01-2007
Member
Green Belt
 
Join Date: Nov 2006
Posts: 88
Re: Shape coordinates

Rushmore,

If you created a SelectedArea object, doesn't mean you have all the content in it. It is just an object you created, with nothin assigned to it, thus all the propperty's are ofcourse zero or empty. What you have to do is something like this in C#:
Code:
SelectedArea oSel;
oSel = Mappoint.SelectedArea;

/* Than do the things you want */

long /*double*/ width = oSel.width;
//etc......
I hope this will help, if not maybe Wilfried can help you, he's a C# programmer also.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 03-01-2007
Senior Member
Black Belt
 
Join Date: Nov 2004
Posts: 2,122
Re: Shape coordinates

Hi,

Quote:
Originally Posted by Rushmore View Post
Ok, I have created the rectangular shape. Then I have called the Select()-Method from the shape. The shape is selected now! But If I look at the SelectedArea properties, the height, top, width and left properties are zero.
I'm not sure if I understeand it right. A selected shape is not a selected area. A selected area is when you draw an area on the map using the mouse, like when you have to zoom in to an area. From this area you can create the shape. Is that what you want ?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 03-01-2007
Junior Member
White Belt
 
Join Date: Jan 2007
Posts: 5
Re: Shape coordinates

Quote:
Originally Posted by Wilfried View Post
Hi,



I'm not sure if I understeand it right. A selected shape is not a selected area. A selected area is when you draw an area on the map using the mouse, like when you have to zoom in to an area. From this area you can create the shape. Is that what you want ?
The main problem is, that I have a lot of pushpins (hydrants). If I display all hydrants as pushpins on the map, it is very slow (and not necessary too). So I have created a circle with a radius of 300m. But that is really difficult to handle. I have to select all hydrants from the database between the drawn circle. So I think it is easier to use the rectangular shape, I have only 4 coords to determine. But now I canīt figure out how to determine the left upper corner, right upper corner etc.

I need only the four locations (of the shape) to select the hydrants from the database.
But how?

Thank you.
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

Tags
coordinates, shape


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 10:51 PM
Getting the coordinates from a freeform shape pst MapPoint 2006/2009 Discussion 5 07-14-2005 08:19 AM
Coordinates of regular shape Dazzer MapPoint 2006/2009 Discussion 1 04-08-2005 09:15 AM
I need some coordinates Anonymous MapPoint 2006/2009 Discussion 0 03-25-2004 11:56 AM
Get coordinates in C# Anonymous MapPoint 2006/2009 Discussion 3 10-31-2003 08:11 AM


All times are GMT -5. The time now is 06:51 PM.


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


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