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

Marco Hugentobler marco.hugentobler at sourcepole.ch
Fri Nov 28 01:25:30 PST 2014


Hi Sandro

>which togheter with a scale and a rotation could be
>used to derive the visible extent.

How would scale be defined for maps in degrees (witout constant scale on 
the map)?
Alternatively, there could be a rectangle (four corner points) instead 
of a bounding box.

Regards,
Marco


On 27.11.2014 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


-- 
Dr. Marco Hugentobler
Sourcepole -  Linux & Open Source Solutions
Weberstrasse 5, CH-8004 Zürich, Switzerland
marco.hugentobler at sourcepole.ch http://www.sourcepole.ch
Technical Advisor QGIS Project Steering Committee



More information about the Qgis-developer mailing list