Site menu:

Cyclocross For Roadies: How and Why to Get Started - Buy Now!

Site search

Categories

Map Books in QGIS

Have you ever wanted to automate the creation of a mapbook? Well, QGIS has a great plugin called EasyPrint that does just that! It makes the process simple and quick once you know how it works.  I’ll try to explain exactly that below!

Installation:

EasyPrint is written by Stefan Ziegler, who we all owe a big thanks! You can install the plugin from the “Fetch Python Plugins” menu. If you don’t see it there, you may need to add the CatAIS Repository. To do so, go to “Plugins > Fetch Python Plugins” and click the “Repositories” tab. At the bottom, click “Add 3rd party repositories,” then “OK.” Then switch back to the “Plugins” tab, and type”EasyPrint” in the search. You should have one result, which you should select before clicking “Install plugin.”

EasyPrint in the Plugin Installer

EasyPrint in the Plugin Installer

Once the plugin is installed, you can enable it under the “Plugins > Manage Plugins” menu if it is not already enabled. If the install was successful, you can access “EasyPrint” in your plugins menu, or via the toolbar icon that looks like this:

EasyPrint Icon

EasyPrint Icon

If you already have the plugin installed, you may want to see if there’s an updated version–the new version seems to increase stability quite a bit!

Functionality:

EasyPrint has several functions. When you click the icon, you’ll get a three-tabbed interface that looks like this:

EasyPrint GUI

EasyPrint GUI

The first tab, “SimpleMap” allows you to create a one-page map, very similar to the standard QGIS Composer window. It uses layouts that come with EasyPrint or one that you can customize (more about that later.) In fact, this option even opens the EasyPrint layout in the composer window. To me, this tab seems unneccessary, because this process is more difficult than using the standard composer. Thus, I don’t see a real need for the SimpleMap option at all, except that it lets you quickly turn on or off things like the grid, copyright, etc. via checkbox rather than adding or removing them from a layout. However, it’s important to note that the next two tabs will use some of the settings from this first tab, so make sure you note them and set them appropriately.

Where EasyPrint really shines is in the ability to automate the creation of multi-page map books, rather than just simple maps. The second tab, “Mapbook by grid” allows you to print one page per ’tile’ based on a grid it will create. Make sure to set the scale you want your maps to be created at by choosing it on the first tab. EasyPrint will use the extent of the layer you choose under “Map layer” when creating the grid. I found this a bit confusing, and it took me a while to figure it out. You can also tell EasyPrint if you want to print all grid tiles (Regular Grid,) or only tiles that actually contain features on your chosen map layer (Regular Grid w/o empty grids option). If you select the ‘w/o empty grid’ option, EasyPrint will check if there is a feature present in “Map Layer” you have selected, and if so, create a page for that map tile. If not, it will skip it and move to the next tile. Once you’ve set these options appropriately, hit “Create.” You’ll see a new layer called “Mapbook Grid” appear in the layer legend as EasyPrint creates the grid. Note that this is where EasyPrint often crashes for me, throwing a fun Python Error. Save your work before hitting ‘Create’ and just try try it again. It almost always works the second time! Once the grid is created, it’s as simple as selecting any of the optional parameters, and telling EasyPrint where to export your file(s). Then hit “OK” and wait for your .pdf(s) to be created!

Here’s a quick example of a mapbook created using the “Regular Grid” function. Note that tile 2.1 is empty, and would have been skipped if I had selected “Regular Grid w/o empty grid”)

Page 1

Page 1

Page 2

Page 2

Page 3

Page 3

Page 4

Page 4

Page 5

Page 5

 

Page 6

Page 6

Page 7

Page 7

The third tab, “Mapbook by feature” is the one that drew me to the tool in the first place. It works similarly to the “Mapbook by Grid” tab, but rather than creating tiles at a fixed scale in a grid pattern, it creates a sheet for each individual feature in a layer. The scale will vary based on the size of the feature, and you can set the amount of ‘buffer’ space around each feature to give some context to each map. You can also choose attributes from the table to use as titles and subtitles, and these will change on every page. Sweet!

Here’s an example of the same dataset shown above, but using the “Mapbook by feature” tab this time. Note that it only creates a page for each of the three features, and the scale varies depending on the feature size. Also note the titles, which change on each page based on data in the attribute table. In my case, they are the very useful (“One,” “Two,” and “Three”) Pretty slick!

Page 1

Page 1

Page 2

Page 2

Page 3

Page 3

Page 4

Page 4

Layouts:

By default, EasyPrint comes with three layouts. Unfortunately, they are not very useful for anyone except the person who created them! Thus, you’ll very likely want to create and use your own. Because this post is getting long, and because I’m still playing with the layout customization, I will leave that topic for a new post! It’s (unfortunately) not a super user friendly process, so I’ll try to break it down in the next post. Stay tuned! (If you want to get started earlier than that, take a poke at layouts.xml in your \user\.qgis\python\plugins\easyprint\layouts\ folder!)

Conclusion:

This is a fantastic plugin! Despite crashing occasionally (save your Project often!) it does a great job when it works.

My wish list for this one is pretty short right now. Basically, I’d love to see this map book creation functionality built into the core Composer window in QGIS, or at the very least have the EasyPrint plugin extended to include support for templates created via the composer. Some modifications to ‘intuitiveness’ (like not using settings from the first tab on subsequent tabs) would be nice, but not critical. It all works once you get the hang of it!

Comments

Pingback from GIS-Lab Blog» Архив блога » Новости вокруг 62
Time November 23, 2011 at 3:16 pm

[…] QGIS – про плагин EasyPrint в картинках. […]

Comment from joe larson
Time November 23, 2011 at 5:38 pm

Thanks for turning me onto this Darren. I also think this could be a great contribution to the core of QGIS. I noticed geographic coordinate systems don’t work with the EasyPrint Grid – but I think it would be great to have lat/lon coords for various reasons: Search and Rescue, Wildfires, etc.

Comment from darrencope
Time November 23, 2011 at 5:52 pm

Joe,
Great point. I forgot to mention that–lat/lon support would be a nice one for the wishlist!

Comment from Paulo van Breugel
Time December 8, 2011 at 4:32 pm

Looks like an interesting plugin (an let me second the suggestion to integrate this with the print composer). Thanks for sharing!

Comment from Alister
Time December 15, 2011 at 10:48 pm

Should maybe recommend using it with the memory layer saver plugin, or manually saving the grid layer.

Comment from Bosti
Time February 21, 2012 at 6:39 pm

hi,

Great plugin, but: any idea why it makes me only one pdf instead of 2? I have 2 squares in grid..

thnx, Regards, Bosti

Comment from benjie
Time September 9, 2013 at 2:12 am

Hi Darren,

Thanks for your blog. I was able to generate the grid but was always having an error when hitting ok on the Easyprint dialog. Would you have any ideas why?

Cheers!

Comment from darrencope
Time September 9, 2013 at 6:48 am

Hi benje. I’m not sure why! However, (and I’ve been meaning to update this post to reflect such) the new QGIS has a built-in Atlas creation tool that is much simpler and works beautifully. I suggest you give that a try!

Comment from carint
Time September 10, 2013 at 3:27 am

new as in QGIS 2.0?

Comment from darrencope
Time September 10, 2013 at 7:03 am

I’m not sure when it first appeared, but is for sure in the 1.9.0 nightly builds. If you’re on Windows, you can easily install it via OSGEO4W.

Write a comment





Bookshelf 2.0 developed by revood.com

More in GIS (11 of 33 articles)


QGIS has a great feature that allows you to create pie charts for feature symbols! I have known about it ...