Bug report #5827

Printing issue

Added by Vivien Deparday over 2 years ago. Updated about 14 hours ago.

Status:Open Start Date:06/19/2012
Priority:Normal Due date:
Assigned to:Pirmin Kalberer % Done:

0%

Category:-
Target version:-
Patch supplied:No Tag:

Description

I am trying to print a map (as an image) with the map composer. The map is composed of two vector layers (boundaries) displayed over tiles (Google Street or OpenStreetMap). It looks good in the main interface. It looks good in the map composer.
However, when printing the map as an image with the map composer, in the resulting exported image, the vector layers are no longer aligned properly with the tiles. It also looks like the tiles are at the wrong scale.

I have the same issue with Google Street and OpenStreetMap. I have not tested the other layers.

I am using:
OpenLayers Plugin v 0.92
QGIS 1.8.0 (from ubuntu-gis unstable)
Kubuntu 12.04

It sounds similar to this issue: http://hub.qgis.org/issues/4223

printing_issue.zip (519.6 kB) Otto Dassau, 11/06/2012 05:56 am

Screenshot_QGIS_google.jpg (751.5 kB) Christian Seemann, 02/15/2013 08:47 am

Test_google_a4_5000.pdf (213 kB) Christian Seemann, 02/15/2013 08:48 am

GenderMap.png - Result, png, location shifted (1.2 MB) Evelien Christiaanse, 03/20/2014 02:18 am

Screenshot1.png - Screenshot print composer (596.2 kB) Evelien Christiaanse, 03/20/2014 02:18 am

TransKLA.pdf - Result, pdf, scale changed (1 MB) Evelien Christiaanse, 03/20/2014 02:18 am

A1_map_size.PNG (16 kB) damien stephens, 08/14/2014 05:30 pm

bad_mapcomposer.jpeg - Map with bug (631.8 kB) sdf what, 09/03/2014 12:40 pm

good_exportimage.jpeg - Map without bug (dark lines tract boundaries, orange dots three lakes) (233.1 kB) sdf what, 09/03/2014 12:40 pm

composer_original_page-dim.jpg (318.9 kB) Simon W, 01/30/2015 11:17 pm

composer_original_page-dim_pdf_misaligned.pdf (1.9 MB) Simon W, 01/30/2015 11:17 pm

composer_tweaked_page-dim.jpg (345.4 kB) Simon W, 01/30/2015 11:17 pm

composer_tweaked_page-dim_pdf_aligned.pdf (2.1 MB) Simon W, 01/30/2015 11:17 pm

History

Updated by MRick - over 2 years ago

I have exactly the same problem with QGIS 1.8.0 under Mac OS X.

This bug is similar to the issue: http://hub.qgis.org/issues/4223 that has been fixed for 1.7.0, but it is coming back again with QGIS 1.8 …

Edit: it will not happen with all the layers : if I use a Google based layer, no problem, with an OSM based layer, the bug happens.

Updated by MRick - over 2 years ago

I made tests back to version 1.7 and everything works perfectly well.
Printing is even smoother with version 1.7 than version 1.8.

Updated by Pirmin Kalberer over 2 years ago

We can't reproduce these printing problems using QGIS 1.8 and master branch. Could you provide us a minimal dataset?

Updated by Otto Dassau over 2 years ago

Hi,

I just had the same problem with QGIS 1.8 under opensuse 12.2. I added a zip file. If you open the project "printing_issue.qgs" and the included DIN a3 map composition, all seems fine (see image screenshot.jpg). But when I export as PDF the google and vector layer extent don't fit anymore.

I use the openlayers plugin version 1.0.0

Regards
Otto

Updated by Otto Dassau over 2 years ago

  • Assigned to set to Pirmin Kalberer

Hi,

problems occur in both plugin versions 0.93 and 1.0.0 when I try to create DIN A3 maps. For DIN A4 it seems to work better.

Regards
Otto

Updated by Christian Seemann about 2 years ago

Hi everyone!

I got exactly the same Problem (see attached file):

QGIS 1.8.0 Lisboa
OpenLayers 1.1.0
Mac OS X 10.6.8 Snow Leopard

and Scale or Paper Size make no difference.
I noticed that it often works better "at the beginning" when I start QGIS but after a few (2 or 3) exports and after panning / working on the map int the main window, it starts "matching" the openlayers (google, osm...) a little slower with the vector layer.
...As if the memory was full! (8GB)
And suddenly the export shows the misalignment.

Anyway, I also would be very happy and grateful for some help!!
Thanks and regards

Chris

Updated by Christian Seemann about 2 years ago

...and this is the PDF result!

P.S. Sorry for posting the 2 Pics in different messages!

Updated by MRick - over 1 year ago

Still not working after all this time and latest update of both OpenLayers and QGis …

Updated by Rowan Murphy over 1 year ago

Am having exactly the same issue with:
  • QGIS 2.0.1
  • Open Layers 1.1.1

We do a lot of jobs on QGIS with many different vector/raster layers using Google aerial, Bing aerial underlay (Open Layers). The error is consistent across all projects with QGIS 2.X.X or higher.

On the same PC with the same map files/layers we do not experience this issue with:
  • QGIS 1.8.0
  • Open Layers latests stable release (from:http://openlayers.org/api/OpenLayers.js)

Is there anything that can be helped? Are we making a mistake in settings or do we have to remain with QGIS 1.8.0 until a fix is available?

Updated by Fridolin Haag about 1 year ago

Still the same with Open Layers 1.1.2 (and QGIS 2.0.1).
Seems to be the same as: Bug #8824 , which was closed because: "The OpenLayers plugin does not support printing in the map composer."
It was suggested it has to do with the Map Composer failing to support "on the fly" projection, but reprojecting my layers to the basemap projection did not help.

Updated by Evelien Christiaanse 12 months ago

I have had the same issue recently while using 2.2.0. I made a vector layer and had it over an Open Street Maps layer, it looked fine when I made it in the print composer. However, as I exported it (pdf or png) the OSM layer was changed in scale or location.

Updated by A G 7 months ago

Hi all

Thanks to all those who developed and contributed towards this plugin =].

I believe I'm getting this problem also. I tried to do bit of testing.

QGIS Desktop version 2.0.1-Dufour 64-bit (ubuntu trusty repo) and Openlayers plugin 1.1.4 works for me under either conditions:

  • OTF projection off + vector layer with CRS EPSG 3587
  • OTF projection on + vector layer with CRS not using EPSG 3587 (EPSG:27700 in this case)

However, for me, the following suffer from the "misaligned map composer exports" bug:

  • QGIS Desktop 2.4 64-bit + Openlayers plugin 1.3.3
  • QGIS Desktop 2.5-master 64-bit + Openlayers plugin 1.3.3

Test Details

Computer System
Ubuntu 14.04.1 64-bit

Setup 01
QGIS Desktop: 2.0.1-Dufour 64-bit (from default ubuntu trusty source)
Openlayers Plugin: 1.1.4
Project CRS: EPSG 3587
Project Layers: 1 x shapefile (EPSG 3587), 1 x google satellite basemap
QGIS Desktop Map Scale: 1:5141

QGIS Map Composer Map Scale: 7151
Paper Size: A4
Paper Orientation: Landscape
Export Resolution: 300 DPI

Export Results
PDF: correctly aligned
Image: correctly aligned
PS: correctly aligned

Test 02
change to on the fly projection
PDF: correctly aligned
Image: correctly aligned
PS: correctly aligned

Test 03
change map composer map scale to 6000
PDF: correctly aligned
Image: correctly aligned
PS: correctly aligned

Test 04
reproject vector layer to a different crs and load over basemap
PDF: correctly aligned
Image: correctly aligned
PS: correctly aligned

Setup 02
QGIS Desktop: 2.4 64-bit (from qgis repos)
Openlayers Plugin: 1.3.3
Project CRS: EPSG 3587
Project Layers: 1 x shapefile (EPSG 3587), 1 x google satellite basemap
QGIS Desktop Map Scale: 1:5141

QGIS Map Composer Map Scale: 7151
Paper Size: A4
Paper Orientation: Landscape
Export Resolution: 300 DPI

PDF: incorrectly aligned
Image: incorrectly aligned
PS: incorrectly aligned

Test 01
reproject vector layer to a different crs and load over basemap
PDF: incorrectly aligned
Image: incorrectly aligned
PS: incorrectly aligned

Setup 03
QGIS Desktop: 2.5-master 64-bit (from qgis repos)
Openlayers Plugin: 1.3.3
Project CRS: EPSG 3587
Project Layers: 1 x shapefile (EPSG 3587), 1 x google satellite basemap
QGIS Desktop Map Scale: 1:5141

QGIS Map Composer Map Scale: 7151
Paper Size: A4
Paper Orientation: Landscape
Export Resolution: 300 DPI

PDF: incorrectly aligned
Image: incorrectly aligned
PS: incorrectly aligned

Test 01
reproject vector layer to a different crs and load over basemap
PDF: incorrectly aligned
Image: incorrectly aligned
PS: incorrectly aligned

Test 02
try out bing and osm basemaps
PDF: incorrectly aligned
Image: incorrectly aligned
PS: incorrectly aligned

Updated by damien stephens 7 months ago

I think I have identified the problem. when printing in windows if you set the position and size of the map layer in the composer exactly equal to the page size, the open layers match the vector layers, otherwise the openlayers get their extents from the page size and then fit the layer to the smaller map size, causing misalignment.

basically the open layers plugin is using the page size instead of the map size when choosing the are of the open layer to display when printing. should be a simple fix for someone with coding skills? unlike myself.

As a work around just set the map size to exactly the page size in the composer. attached image shows the setting for A1.

Updated by Simon Bowyer 7 months ago

Damien - good work, I was having terrible problems with this. Just tested your method on Win 7 using QGIS 2.4 and it fixes it. Thanks!

Updated by sdf what 6 months ago

I am having the same problems with misalignment when creating an image or pdf from composer.

QGIS version 2.4.0, Openlayers 1.3.3, Windows 7. I have set everything to SRS 3857, both OTF and not.

I will try tonight with my freebsd machine at home, and I will also install the dev QGIS on the windows machine and try again.

The workaround in 5827#note-14 doesn't work for me, and it smooshes the map against the upper left corner of the paper anyway.

The export-as-image function works fine, though (see good image attached).

Based on the diversity of situations in the bug report, I wonder if it isn't something not exactly Open Layers??

I am hoping to teach a class using QGIS this October, and having this feature ironed out would help silence the ESRI cool-aid drinkers....

Updated by Rodrigo Principe 5 months ago

I have the same problem... QGIS 2.4, Openlayer 1.3.3, windows 7 (if it is relevant). The workaround #5827 (note 14) didn't work for me. I think this is a major issue to solve (come on developers!).. QGIS can be so powerful, but if I can't print it out, I will be forced to change software (I don´t want to). Thank you!

Updated by Jim O'Leary 3 months ago

I have the same problem with QGIS 2.6. I tried the fix above, but the Google Map itself does not show in the output image (shows fine in the Composer). I found that clicking Move item content and dragging the map a bit helps the Google Map to show in the output. Also, QGIS 2.2 works better than QGIS 2.6.

Like Rodrigo above I am planning a series of courses on QGIS. Printing with a good background is a key ingredient. Hope those smart developers can lay the ax to the root soon.

Updated by Robin Watson about 1 month ago

I have the same issue with 2.6.1 on Ubuntu 14.04, and with 2.4 on W7. The workaround suggested by damien stephens (entry 13 above) works for me.

I also find that the exported background map is a bit hit-and-miss quality-wise. Sometimes it exports Ok (except for the issue above), but sometimes there are bits of the background map missing. I might get an empty circular ring, or a missing square, or what appears to be a lower-resolution version of the background tile. If I repeat the export enough times (say 4 or 5) then usually it has worked by then.

Updated by Simon Stock about 1 month ago

I also have the issue with misaligned layers while printing with QGIS 2.6 and the 1.3.5 OpenLayer Plugin under Windows 7 x64. Like already mentioned by Robin, I also get empty rings and missing squares in the output.

The workaround by Damien works but I don't want my maps to be displayed on the whole page. Or did I get something wrong?

Updated by Simon W about 1 month ago

Love the software! However, this pdf output problem is a huge block for us and this post is over 2 years old and still relevant.
I have the same vector layer / google streets misalignment issue as my namesake above with same OS, QGIS and OpenLayers version. CSR = 3857. I managed to get everything realigned after I performed the page dim mod mentioned by Damien but now I am lacking margins in my map... I agree with others, It seems like a quick fix, yes?

Another related issue is with the Google Tiles. Highways shields and labels are too small and don't match the composer both in pdf and jpg. Maybe the initial poster Vivien was referencing this? Maybe this should be a new issue?

Updated by Andrew Backinsell about 14 hours ago

Can I be a pain and say I don't understand the solution in number 14. Can someone briefly spell out the steps in "As a work around just set the map size to exactly the page size in the composer"?

As you can imagine I am new to all this, I have managed to create lots of layered maps and they are running on Google My Maps but have stumbled at this final hard copy/print stage using this plug-in. I have tried the second workaround "Move item content" and can adjust the composer to appear correct but when I save the file it's still way way off.

Also available in: Atom