2

I'm using a pyqgis script to save multiple images of a map and then stitch the images together to create a larger image. One of the layers is a point layer containing all the labels. I noticed that if a point is outside the current map canvas extent, the label for that point is not shown even if the actual label text falls within the extent of the map canvas. This results in labels being cut off at the edges of the saved images. Is there a way to force labels to be shown even if the feature falls outside the map canvas extent?

  • Are you using the print composer or the main project window? – csk Nov 29 '16 at 16:46
  • I'm using the main project window. – exkoria Nov 29 '16 at 18:54
  • I have ideas for two possible solutions. 1) Try the new map canvas magnifier (introduced in QGIS 2.16) in the main project window. It graphically zooms in on the map without changing the scale, so perhaps it will keep the label placement consistent. Or, 2) In print composer, make a very large map that shows the entire extent of the map. Make the page smaller than the map so that you only export part of the map. – csk Dec 4 '16 at 4:07
  • Thanks. Something like 1) might be possible. I'm thinking perhaps that I can show the canvas with a bigger extent than the bounding box I use to save the image. But I have to look if it's actually possible. Solution 2) is just not possible for me since the map is way too big for one single image. – exkoria Dec 4 '16 at 18:59
1

In the main project window, use the new map canvas magnifier, introduced in QGIS 2.16. It graphically zooms in on the map without changing the scale, so it should keep the label placement consistent and even show partial labels for features that are off screen.

Screenshot from QGIS 2.16 changelog on qgis.com

Screenshot from QGIS 2.16 changelog on qgis.com

  • Thanks. I'll look into this feature and see how to do it programatically from python. – exkoria Dec 9 '16 at 20:02
0

In print composer, make a very large map that shows the entire extent of the map. Make the page smaller than the map. Only the part of the map on the page will be exported. Move the map and repeat as needed to cover the entire map. answer to "QGIS - Show labels for point features outside map canvas"

In this close-up, you can see labels for points that are outside the page are displayed on the map (and will be displayed in the exported image). closeup for answer to "QGIS - Show labels for point features outside map canvas" It might help to add a grid to the map and use the grid lines as guides for where to place the pages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.