Skip to content

Basemaps in QGIS

April 6, 2011

Update 2012-02-02 17:57 -0800: I just wrote a post about another way to do this.

I really like QGIS. It’s a powerful GIS that runs on Linux (among other operating systems) and doesn’t require incredible amounts of CPU. One criticism I had of it was that it did not provide the same ‘click-and-go’ basemap experience one can get with ArcGIS for making simple maps (i.e. Add Basemap, select Bing, DeLorme, &c. and you’re done). No more! Thanks to the qgis-openlayers plugin available on GitHub, you can now use OSM, Google Maps, Yahoo Maps and Bing Maps as base layers in your project (side note: make sure you don’t violate any copyrights by using them). I’ve had a little trouble with the projections, but I’m not that good with dynamic reprojection in QGIS yet, so I’m sure it’s my error. Unfortunately, the layers don’t support reprojection, so your project is basically forced to use Google Mercator – which may be a showstopper but is often acceptable for quick maps (remember, QGIS can reproject your other layers). If you do want reprojection, see this post.

It’s pretty clever how the library works – it basically just renders an OpenLayers web page into the frame. It’s raster and doesn’t support an alpha channel, so this is pretty much just good for basemaps. If you have another OpenLayers basemap you’d like to use, implementing it is pretty simple – but that’s a topic for another time.

Installation is simple in recent versions of QGIS – just go to Plugins -> Fetch Python Plugins…, click ‘Add 3rd Party Repositories’ in the repositories tab, and search for and install ‘OpenLayers Plugin’ in the ‘Plugins’ tab. Restart QGIS, and find your new menu under Plugins -> OpenLayers Plugin. Cool!

  1. Zarlish permalink
    May 1, 2011 3:41 am

    Thanks for this quite useful info. Although i came across a problem while exporting the maps using open layers basemaps. When i export my map into jpg format, the basemap is not there rather only the vector layers with a blank background is there… What to do..:(

  2. mattwigway permalink*
    May 29, 2011 5:37 pm

    Hmmm. . . that’s interesting. It works for me. Are you exporting via the menu (File -> Save as Image) or with a print composer? The print composer is giving me trouble with this plugin, for some reason. I suspect it’s not allowing time for the data to buffer properly. (if you need better resolution than your screen, check out a handy post on UnderDark: )

    One more thing to check: go to File -> Project Properties and make sure the projection is set to Google Mercator (EPSG:900913)—even if you aren’t using Google Maps. You can enable dynamic reprojection to make your data fit whatever basemap you’re using.

    The reason you can’t reproject OpenLayers layers is that they are kind of hacky: it’s an HTML frame drawn behind the map.


  1. More Basemaps in QGIS « Indicatrix

Comments are closed.

%d bloggers like this: