[Qgis-developer] Viewport rotation

Sandro Santilli strk at keybit.net
Fri Nov 21 01:28:53 PST 2014


On Thu, Nov 20, 2014 at 12:44:29PM -0700, Larry Shaffer wrote:

> Towards that end, I would say the most straightforward means of
> implementing map rotation for effective labeling is to pre-rotate the
> duplicated, temporary feature geometries first, before they are acted upon,
> i.e. before extent (view port) clipping, etc., which would be prior to
> sending into the PAL library for processing. Such an approach should keep
> from having to pass the rotation offsets into the labeling calculations,
> since the rotated features would already be in their output juxtaposition.

Right, that was my idea of threating it like a reprojection.

> Maybe the feature pre-rotation could be done in the map renderer, prior to
> sending to the labeling engine.

That's possibly what I've done by implementing rotation in QgsMapToPixel,
as I do see features and label positions all correctly rotated. Only,
the PAL view on the source layer seems to be still the original one, as 
in "parallel" mode those labels are NOT parallel to the rotated but to
the original lines (I think, not really sure).

If you want to take a look, I pushed a branch here:
https://github.com/strk/qgis/tree/rotation

I think next I'll work on a widget to make it easy to specify rotation
in the GUI so further tests are easier to conduct.

--strk;

 ()  ASCII ribbon campaign  --  Keep it simple !
 /\  http://strk.keybit.net/rants/ascii_mails.txt  


More information about the Qgis-developer mailing list