Map Rotation

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Map Rotation

Trupti Pol
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.
Reply | Threaded
Open this post in threaded view
|

Re: Map Rotation

Jesse Eichar
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 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: Map Rotation

Trupti Pol
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@gmail.com> 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
Reply | Threaded
Open this post in threaded view
|

Re: Map Rotation

Jody Garnett-2
I should also note that the geotools community experimented with adding rotation (as an option for geoserver available via open layers app).
So perhaps there some support inside the geotools renderer that could be made use of.

With respect to the bounds; it is a bit of a pickle...

If we allow rotation it becomes better to track the "viewport" by way of:
- center
- scale
- rotation

Rather then a bounding box.

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).

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 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: Map Rotation

Trupti Pol
Hi Jody,

I would like to get some input from moovida as you mentioned.
Please tell me how to contact him (mail id or something).
Or It will be more better if you will forward this to moovida so that i will get some info about how to add more options to viewport model.

Otherwise working with bounds is quite difficult and will lead to unnecessary changes in many more functionalities.

Thanks & Regards,
Trupti



Jody Garnett-3 wrote
I should also note that the geotools community experimented with adding rotation (as an option for geoserver available via open layers app).
So perhaps there some support inside the geotools renderer that could be made use of.

With respect to the bounds; it is a bit of a pickle...

If we allow rotation it becomes better to track the "viewport" by way of:
- center
- scale
- rotation

Rather then a bounding box.

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).

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@gmail.com> 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
Reply | Threaded
Open this post in threaded view
|

Re: Map Rotation

Jody Garnett-2
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.

Jody

On 09/04/2010, at 3:00 PM, Trupti Pol wrote:

>
> Hi Jody,
>
> I would like to get some input from moovida as you mentioned.
> Please tell me how to contact him (mail id or something).
> Or It will be more better if you will forward this to moovida so that i will
> get some info about how to add more options to viewport model.
>
> Otherwise working with bounds is quite difficult and will lead to
> unnecessary changes in many more functionalities.
>
> Thanks & Regards,
> Trupti
>
>
>
>
> Jody Garnett-3 wrote:
>>
>> I should also note that the geotools community experimented with adding
>> rotation (as an option for geoserver available via open layers app).
>> So perhaps there some support inside the geotools renderer that could be
>> made use of.
>>
>> With respect to the bounds; it is a bit of a pickle...
>>
>> If we allow rotation it becomes better to track the "viewport" by way of:
>> - center
>> - scale
>> - rotation
>>
>> Rather then a bounding box.
>>
>> 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).
>>
>> 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 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: Map Rotation

Andrea Antonello
> 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 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: Map Rotation

Trupti Pol
Thanks a lot Andrea,

Jesse, can you please tell me about how to add a new Field "Rotation" to the EMF model. This is required for rotation of the viewport.
Please suggest some tutorial or something for the same.


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@gmail.com> 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
Reply | Threaded
Open this post in threaded view
|

Re: Map Rotation

Trupti Pol
In reply to this post by Andrea Antonello
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 implications 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@gmail.com> 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