[Qgis-developer] Replacing Extent with Center in QgsMapSettings (for rotation)

Richard Duivenvoorde rdmailings at duif.net
Fri Nov 28 01:10:31 PST 2014


Hi Sandro,

I think you have a valid point, and hope that other core devs will chime in.

I'm also wondering about this kind of use cases outside the geo world,
like how do they do that in the CAD world, 3D world or rendering world?
And what about non-ortogonal projections which do not have a square
extent either?

Regards,

Richard Duivenvoorde

On 27-11-14 18:36, Sandro Santilli wrote:
> I've finally handled to get a correctly rendered rotated map
> (git://github.com/strk/QGIS.git "rotation" branch) but more work
> will be needed to correctly get the source data extent and output
> rectangle for clipping purpose.
> 
> As I continue working in the branch, I can't stop thinking that
> the QgsMapSetting class should be refactored to move away from
> the concept of "extent" as a defining setting.
> 
> Currently, callers set the map's "extent", which togheter with
> the output viewport size is used to derive the scale and the
> "visible extent" (see QgsMapSettings::updateDerived).
> 
> Once the concept of rotation is added, the meaning of "extent"
> becomes very confusing. What does it represent, exactly ?
> 
> The only "stable" concept you can derive from the extent is its
> center, which togheter with a scale and a rotation could be
> used to derive the visible extent.
> 
> OpenLayers indeed has center, rotation and scale as the defining
> parameters of a view: http://openlayers.org/en/v3.0.0/apidoc/ol.View.html
> 
> In this scenario, panning would move the center, retaining scale
> and rotation. Zooming would change scale, retaninig rotation and center
> (combined zoom+pan could still be used). Rotation would retain the
> scale and center.
> 
> Right now the class has mExtent and a mVisibleExtent members,
> with the new configuration only the "visible extent" would make sense,
> and could always be computed given an output size (currently also
> a member of the class).
> 
> How would you see a transition toward this new configuration ?
> 
> If you want to follow the progress for rotation support, there's
> a pull request for it: https://github.com/qgis/QGIS/pull/1700
> 
> --srk;
> 
>  ()  ASCII ribbon campaign  --  Keep it simple !
>  /\  http://strk.keybit.net/rants/ascii_mails.txt  
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 



More information about the Qgis-developer mailing list