Re: [OpenMap Users] Rotate a OMAreaList

From: Ruben DF <rdocasalf_at_yahoo.es>
Date: Mon, 3 Aug 2009 13:50:12 +0000 (GMT)

Of course, I could find out the movements in x and y in the rotation (by means of sin anc cos azimuth angle, lenght line...etc) and get the new rotated point of the line, but it would be very tedious. I was trying in the other way because I noticed in OMText you could rotate the text with setRotationAngle method. My idea is to do the same thing , at least, with OMLines. I really need a high accuracy at rotations and movements.


--- El lun, 3/8/09, Don Dietrick <dietrick_at_bbn.com> escribió:

De: Don Dietrick <dietrick_at_bbn.com>
Asunto: Re: [OpenMap Users] Rotate a OMAreaList
Para: "Ruben DF" <rdocasalf_at_yahoo.es>
CC: openmap-users_at_bbn.com
Fecha: lunes, 3 agosto, 2009 3:32

Hi Ruben,

I understand that you're trying to rotate lines and polygons, but my real question is why?  What are you trying to represent with a lat/lon line or polygon that is rotated, or rather, what meaning are you trying to convey by rotating a lat/lon poly?  Do you think you might have to find the center point, check the azimuth and distance to each point, and then modify the azimuth angle to each point?  That would produce different results than rotating the poly in xy space, but it would also be slower.  Do you need a precise location of the rotated poly points?

- Don

Ruben DF wrote:
> Don, thanks for answering.
>
> I used forward method successfully just a few hours after sending my previous message (reading the openmap documentation)
>
> However, I continue trying to rotate an OMLine. I can rotate the line calling (Graphics2D)g).rotate(angle, x,y) at render method (X and Y transformed from Lat/Long by forward method), but, when I zoom or pan the map, the line is getting crazy, the line seems to lose the center, moving around over the map...I think I must set new lat long postion (after rotating) to fix the new position but i dont know how i can retrieve the X,Y position from the line after rotating (Graphics2D does not have any method to get the coordinates...) in order to translate to lat/long positions later...
>
> Don, I need to rotate polygons, lines...etc giving an azimuth input...
>
> Thanks in advance
>
> --- El *vie, 31/7/09, Don Dietrick /<dietrick_at_bbn.com>/* escribió:
>
>
>     De: Don Dietrick <dietrick_at_bbn.com>
>     Asunto: Re: [OpenMap Users] Rotate a OMAreaList
>     Para: "Ruben DF" <rdocasalf_at_yahoo.es>
>     Fecha: viernes, 31 julio, 2009 6:14
>
>     Hi Ruben,
>
>     The Projection object translates between lat/lon and x/y, using
>     the forward() methods.
>
>     Of you rotate a lat/lon line, though, you are basically killing
>     the geospatial meaning of the line.  What are you trying to display?
>
>     - Don
>
>
>     On Jul 22, 2009, at 6:17 AM, Ruben DF wrote:
>
>     > Hi,
>     >
>     > I have a shape defined by an OMAreaList. How could i rotate that
>     shape fixing a specific point? I have started to rotate a simple
>     OMLine adding at render(g) method the code line:
>     >
>     > ((Graphics2D)g.rotate(angle,x,y)
>     >
>     > I suppose that x and y are the center coordinates of the
>     rotation. Since i have latitude and longitude points, how can i
>     translate those points in X and Y points?
>     >
>     > Thanks a lot
>     > Regards
>     >
>
>



--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Mon Aug 03 2009 - 09:50:42 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:09 EDT