Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Map Rotation

Hi,

I am glad and thankful to tell you that i am able to rotate the map now. 
To achieve this i have done following things.
1) Rotate the graphics with specified angle before passing to render method.
2) apply rotation parameter to worldToPixel and pixelToWorld method if
applicable.
3) rotate the current bounds and set it to viewportModel.


But there are some inplications about it.
Now the problem is after rotation if i zoom/ pan then some features near the
map boundary are not visible.
What i have observed if some % of area of a feature is whithin the bounds
then the it is visible otherwise it cuts down form the map display.

Please give me some idea about what can be done or where am i suppose to
look in for the problem.



Andrea Antonello-3 wrote:
> 
>> He is also know as Andrea Antonello (and is available on this list) - he
>> was just travelling for a bit and missed out
>> on the map rotation discussion.
> 
> Indeed I did, thanks for pinging me. :)
> 
> [...]
>>>> Also note that moovida knows how to add more options to the viewport
>>>> model
>>>> (he has added "time" and "elevation" ... so adding a rotation is
>>>> possible).
> 
> Yep, to do so you have to change the EMF model to add the needed field
> for the rotation to the viewport. Last time I did so I broke something
> in the crs :) So I would prefer having Jesse to teach you how to do
> that.
> 
> Andrea
> 
> 
> 
>>>>
>>>> Jody
>>>>
>>>> On 08/04/2010, at 3:05 PM, Trupti Pol wrote:
>>>>
>>>>>
>>>>> Hi Jesse,
>>>>>
>>>>> Thanks for the reply.
>>>>>
>>>>> According to your suggestion  i rotated the graphics in renderer
>>>>> (BasicFeatureRenderer).
>>>>> Also taken care of pixelToWorld() and worldToPixel() methods.
>>>>>
>>>>> Thus now i am able to rotate the map.
>>>>> But the problem is of bounds. I am unable to set the bounds for the
>>>>> viewport.
>>>>>
>>>>> Thus i can see the rotated image on the viewport but as i pan towards
>>>>> the
>>>>> edges of the viewport the some part of the map is cutting down. I
>>>>> think
>>>>> this
>>>>> is only because of the invalid bounds.
>>>>>
>>>>> Please give me some idea about how to set the rotated image bounds to
>>>>> viewport bounds ?
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> Jesse Eichar-4 wrote:
>>>>>>
>>>>>> I think it depends on how you want the functionality to work.  There
>>>>>> are
>>>>>> map
>>>>>> transformation commands that you can send to the map that can rotate
>>>>>> the
>>>>>> map.  I think that perhaps the transformation is reset after a pan or
>>>>>> zoom
>>>>>> though, I cannot remember that anymore for certain.
>>>>>>
>>>>>> The main component for displaying the map is the ViewportPane.  But
>>>>>> that
>>>>>> is
>>>>>> only for the main screen not for printing and overviews.  You can use
>>>>>> draw
>>>>>> commands to rotate the viewport pane if you like.  But if you want to
>>>>>> make
>>>>>> the rotation at a deeper level like at the renderer level then it is
>>>>>> slightly more difficult.  I think each renderer handles translation
>>>>>> from
>>>>>> world to map coordinates individually. For example WMSRenderer lets
>>>>>> the
>>>>>> WMS
>>>>>> handle it and the BasicFeatureRenderer uses
>>>>>> ViewportModel.getAffineTransform.
>>>>>>
>>>>>> So each of these would probably need to be modified.  The good news
>>>>>> is
>>>>>> that
>>>>>> the modification would be minor for each.
>>>>>>
>>>>>> Each renderer has a render(Graphic2D g) method.  You could modify
>>>>>> each
>>>>>> so
>>>>>> set a transform on the graphics 2d.
>>>>>>
>>>>>> Jesse
>>>>>>
>>>>>> On Mon, Mar 29, 2010 at 7:38 AM, Trupti Pol <ktrup7@xxxxxxxxx> wrote:
>>>>>>
>>>>>>>
>>>>>>> Hi ,
>>>>>>>
>>>>>>> We need to rotate map in one of product which uses udig - M7 as the
>>>>>>> target
>>>>>>> Platform
>>>>>>> I have alreay gone thru the previous post dtd somewhere in 2008.
>>>>>>> I just wanted to know is there any provision in udig M7 currently to
>>>>>>> rotate
>>>>>>> the Map.
>>>>>>>
>>>>>>> What will the amount of efforts required?
>>>>>>> Will it be difficult one or not possible at all?
>>>>>>>
>>>>>>> I would also like to know the areas which will have direct impact of
>>>>>>> this
>>>>>>> functionality.
>>>>>>>
>>>>>>> Looking for some positive response.
>>>>>>> Thanks in advance.
>>>>>>>
>>>>>>> Trupti Pol.
>>>>>>>
>>>>>>> -----
>>>>>>> Thanks & Regards,
>>>>>>> Trupti Pol
>>>>>>> --
>>>>>>> View this message in context:
>>>>>>> http://old.nabble.com/Map-Rotation-tp28064993p28064993.html
>>>>>>> Sent from the udig-devel mailing list archive at Nabble.com.
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> User-friendly Desktop Internet GIS (uDig)
>>>>>>> http://udig.refractions.net
>>>>>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> User-friendly Desktop Internet GIS (uDig)
>>>>>> http://udig.refractions.net
>>>>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> -----
>>>>> Thanks & Regards,
>>>>> Trupti Pol
>>>>> --
>>>>> View this message in context:
>>>>> http://old.nabble.com/Map-Rotation-tp28064993p28174161.html
>>>>> Sent from the udig-devel mailing list archive at Nabble.com.
>>>>>
>>>>> _______________________________________________
>>>>> User-friendly Desktop Internet GIS (uDig)
>>>>> http://udig.refractions.net
>>>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>>
>>>> _______________________________________________
>>>> User-friendly Desktop Internet GIS (uDig)
>>>> http://udig.refractions.net
>>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>>>
>>>>
>>>
>>>
>>> -----
>>> Thanks & Regards,
>>> Trupti Pol
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Map-Rotation-tp28064993p28187656.html
>>> Sent from the udig-devel mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> User-friendly Desktop Internet GIS (uDig)
>>> http://udig.refractions.net
>>> http://lists.refractions.net/mailman/listinfo/udig-devel
>>
>>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel
> 
> 


-----
Thanks & Regards,
Trupti Pol
-- 
View this message in context: http://old.nabble.com/Map-Rotation-tp28064993p28456771.html
Sent from the udig-devel mailing list archive at Nabble.com.



Back to the top