Feature request #4711

Map Composer - Align Map Item to North

Added by Larry Shaffer over 12 years ago. Updated over 7 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Map Canvas
Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:14594

Description

Now that the rotation for a map item can be a real number, instead of whole integer, it would be nice to have an Align to North check box under a Map Item's rotation setting's input field.

Then running the Align to North method might:

  1. call the QgsDecorationNorthArrow::calculateNorthDirection() method of the QgsDecorationNorthArrow class
  1. upon success of calculateNorthDirection() pull the mRotationInt private variable from the QgsDecorationNorthArrow object and rotate the selected map item in composer to north.

Unfortunately, the value of mRotationInt is an integer, not a real. So, either mRotationInt gets changed to allow a double value, or just create a new method in the QgsComposerMapWidget class that does the same thing to calculate rotation to north and the set map rotation to it, calling QgsComposerMapWidget::on_mRotationSpinBox_valueChanged( double value ) to rotate the map.

If the GUI widget were a check box, unchecking it might return the map to a zero rotation value.

I envision this as being a map item object attribute, not whole composer object attribute.

Larry

Associated revisions

Revision e8be0ed9
Added by Nyall Dawson over 7 years ago

[composer] Allow syncing pictures to true north

Previously pictures could only be synced to grid north, which
can be totally wrong for many CRSes (especially in polar areas)

Users now are given a choice of grid or true north, and can also
enter an optional offset to apply if eg magnetic north is instead
desired.

When synced to true north the bearing is calculated using the
centre point of the linked map item.

Fix #192, #4711

This fix was sponsored by the Norwegian Polar Institute's
Quantarctica project (http://quantarctica.npolar.no) and
coordinated by Faunalia.

Revision fb78285d
Added by Nyall Dawson over 7 years ago

[composer] Allow syncing pictures to true north

Previously pictures could only be synced to grid north, which
can be totally wrong for many CRSes (especially in polar areas)

Users now are given a choice of grid or true north, and can also
enter an optional offset to apply if eg magnetic north is instead
desired.

When synced to true north the bearing is calculated using the
centre point of the linked map item.

Fix #192, #4711

This fix was sponsored by the Norwegian Polar Institute's
Quantarctica project (http://quantarctica.npolar.no) and
coordinated by Faunalia.

(cherry-picked from 89cc6454b989de1746779b2f648a32d2863ebada)

Revision 13afc10d
Added by Nyall Dawson over 7 years ago

[composer] Allow syncing pictures to true north

Previously pictures could only be synced to grid north, which
can be totally wrong for many CRSes (especially in polar areas)

Users now are given a choice of grid or true north, and can also
enter an optional offset to apply if eg magnetic north is instead
desired.

When synced to true north the bearing is calculated using the
centre point of the linked map item.

Fix #192, #4711

This fix was sponsored by the Norwegian Polar Institute's
Quantarctica project (http://quantarctica.npolar.no) and
coordinated by Faunalia.

(cherry-picked from 89cc6454b989de1746779b2f648a32d2863ebada)

History

#1 Updated by Giovanni Manghi over 12 years ago

Is this ticket related to #192-16?

#2 Updated by Larry Shaffer over 12 years ago

Hi Giovanni,

I'm not referring to synchronization of another composer item to a map item's relative north (like rotating a north arrow to match a map item's north alignment).

I'm suggesting a check box under a map item's rotation setting that, when checked, automatically rotates the map item itself to align to north, where such an alignment is relative to the center of its internal bounds, not the center of the composer container of the map item.

For example:

Most of the data, and most of the maps, I make where I live (Black Hills, South Dakota) are in UTM 13N (NAD83 or WSG84) projection. Ignoring UTM convergence on the sides of any given smaller scale map, the UTM grid is generally about 1 degree rotated from true north. In my current project bounds I I have calculated that the center is 0.87 degrees off from true north. This is something that the decoration north arrow in the main map canvas already knows (at least to within whole degrees). If I input this adjustment in the for the rotation of a map item, that map will now print north-up, accurately for its center point.

So, basically, select a map item, click Align to North check box and the map item's rotation will be set so that the center of it's internal bounds (not the item's composer container) is aligned to true north.

#3 Updated by Giovanni Manghi about 12 years ago

  • Target version set to Version 2.0.0

#4 Updated by Pirmin Kalberer over 11 years ago

  • Target version changed from Version 2.0.0 to Future Release - Nice to have

#5 Updated by Nyall Dawson over 7 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF