Feature request #6985

Export print layout as image with world file

Added by Giovanni Manghi over 4 years ago. Updated over 3 years ago.

Status:Closed Start Date:01/12/2013
Priority:Low Due date:
Assigned to:Hugo Mercier % Done:

0%

Category:-
Target version:Future Release - High Priority
Platform: Resolution:fixed/implemented
Platform version: Pull Request or Patch supplied:No
Status info: Tag:

Description

It would be nice to have an option to export a layout as a georeferenced tiff (tiff+tfw), with regards to a specific map object.

History

Updated by Vincent Picavet about 4 years ago

Hi,

Can you elaborate on this ?

The need is to export one composer page as tiff image, and write a tfw extent file as well, corresponding to the page extent as if a specific map in it was extended to the whole page ?

What happens when the composer is multi-page ?

Do you have a use case for that ? Any specific example ?

Updated by Giovanni Manghi about 4 years ago

Vincent Picavet wrote:

Hi,

Can you elaborate on this ?

The need is to export one composer page as tiff image, and write a tfw extent file as well, corresponding to the page extent as if a specific map in it was extended to the whole page ?

What happens when the composer is multi-page ?

Do you have a use case for that ? Any specific example ?

Hi Vincent, good afternoon.

Geo-referenced layouts are requested as mandatory by some public administrations, like the Portuguese one (I can send you the link to the law if needed). At the moment in QGIS this means to export the layout as image and then georeference manually to create the mandatory worldfile. Other GIS packages do create the worldfile while exporting the layout as image.

To solve the problem of >1 map objects and >1 pages it would be enough to consider just the 1st map object (map0) and just to the fist page.

Updated by Vincent Picavet about 4 years ago

I still do not get it. What you call "layout" is a full composer export as image ? I do not really get the point of having it georeferenced, as it is not really a map by itself, but a document with various things on it (legend, text, figures, tables, etc.), and therefore it does not really make sense to georeference it globally.

The tfw file you want exported, does it correspond to the extent of one of the specific map on the composer export, or to the composer paper export boundaries ? The former is trivial, the latter needs more work.

Updated by Giovanni Manghi about 4 years ago

Vincent Picavet wrote:

I still do not get it.

I don't get it too, I'm just referring what is mandatory in same places. This missing feature (regardless how much stupid/strange can seem) is limiting quite a lot the adoption of qgis, at least around here.

What you call "layout" is a full composer export as image ?

In this case "layout" means the first page of a qgis layout, exported as image (usually a tif). In other packages the layouts are made of 1 page, as it was in qgis until 1.8, so in general this eventual new feature should just take into account the first page and the first map object (map0).

I do not really get the point of having it georeferenced, as it is not really a map by itself, but a document with various things on it (legend, text, figures, tables, etc.), and therefore it does not really make sense to georeference it globally.

The point of having the world file for the exported layout is to allow someone import it into gis software and see at least the map part of the layout overlayed with other layers (for evaluation purposes), and regardless of the stuff that is in the layout other than the actual map.

The tfw file you want exported, does it correspond to the extent of one of the specific map on the composer export, or to the composer paper export boundaries ? The former is trivial, the latter needs more work.

I guess that the worldfile should take into account the boundaries of the page using them as an "extension" of the map0 object extent.

Updated by Larry Shaffer about 4 years ago

Giovanni Manghi wrote:

Vincent Picavet wrote:

The tfw file you want exported, does it correspond to the extent of one of the specific map on the composer export, or to the composer paper export boundaries ? The former is trivial, the latter needs more work.

I guess that the worldfile should take into account the boundaries of the page using them as an "extension" of the map0 object extent.

Maybe an option to export ground control points for the defined map extent (i.e. the chosen main map of the composer page layout), then produce a .tfw for the extrapolated 'page' extent. The GCPs could be output in the QGIS Georeferencer's .points file format, so the files are ready to be loaded into the georeferencer. This would help in instances where the extrapolated .tfw file maybe doesn't work right and you have to try re-creating it or doing some adjustments in the georeferencer.

Updated by Vincent Picavet about 4 years ago

What you call "layout" is a full composer export as image ?

In this case "layout" means the first page of a qgis layout, exported as image (usually a tif). In other packages the layouts are made of 1 page, as it was in qgis until 1.8, so in general this eventual new feature should just take into account the first page and the first map object (map0).

Ok

The point of having the world file for the exported layout is to allow someone import it into gis software and see at least the map part of the layout overlayed with other layers (for evaluation purposes), and regardless of the stuff that is in the layout other than the actual map.

You can do that by exporting the QGIS canvas as image instead of a composer layout. Georeferencing a layout is a strange idea globally, but why not.

I guess that the worldfile should take into account the boundaries of the page using them as an "extension" of the map0 object extent.

Yes, got it now, even if it's not easy to see real use for this.

But the law is the law.

Updated by Vincent Picavet almost 4 years ago

  • Assigned to set to Hugo Mercier
  • Target version changed from Future Release - Nice to have to Future Release - High Priority

Oslandia will implement this feature for 2.1.

Updated by Hugo Mercier almost 4 years ago

So, if I understand correctly :
- the user has to choose the map object on which to compute the world file
- the computation depends on the current map extent, the current dpi and the page size

About the GUI integration, I am going to add a checkbox "generate a world file" with a combo box to select the map just below the "print as raster" checkbox.

The world file will be generated each time the composition is exported to an image file (if the checkbox is checked)

Please react if this does not seem correct to you.

Updated by Giovanni Manghi almost 4 years ago

Hugo Mercier wrote:

So, if I understand correctly : - the user has to choose the map object on which to compute the world file - the computation depends on the current map extent, the current dpi and the page size

About the GUI integration, I am going to add a checkbox "generate a world file" with a combo box to select the map just below the "print as raster" checkbox.

The world file will be generated each time the composition is exported to an image file (if the checkbox is checked)

Please react if this does not seem correct to you.

seems correct to me!

Updated by Paolo Cavallini almost 4 years ago

Agreed.

Updated by Paolo Cavallini almost 4 years ago

Please note: if there is only one map in the layout, no choice should be requested.

Updated by Hugo Mercier almost 4 years ago

Yes sure, if there is only one map in the layout, the combo box will only contain this one map and it will thus be automatically selected.

Updated by Hugo Mercier almost 4 years ago

I've just pushed the changeset :
https://github.com/qgis/Quantum-GIS/pull/658

Updated by Paolo Cavallini over 3 years ago

  • Status changed from Open to Closed
  • Resolution set to fixed/implemented

AFAIK, this has been implemented. Reopen if necessary.

Also available in: Atom