2

I've been looking for an alternative to the openlayers plugin as a means of adding imagery basemaps to QGIS.

The plugin is great but there's a bug when exporting basemaps via QGIS map composer that causes vector layers to become offset from the underlying basemap, or vice versa.

I saw mapproxy mentioned as a possible alternative here, leading me to create this config file which nearly works I think, except for one thing: google's static map api wants tile (yx) location in a lat,long format, whereas mapproxy sends requests in a simple tile numbering system: 0,0 0,1 1,1.

I wanted to avoid accessing imagery tiles directly as this is against google's tos.

Is using mapproxy and google static maps / bing static maps feasible? Is there another way to get aerial imagery basemaps into QGIS that will work with map composer?

Being new to web mapping, I suspect I'm barking up the wrong tree so hoped to get some help here =]

  • Any luck in the end? Could you use MapProxy to proxy Google statics? – Campa Oct 28 '15 at 15:06
1

Instead of using a plugin, QGIS handles XYZ tile layers natively. In the QGIS Browser panel, find XYZ layers, and add the URL you need. This has the advantage over both OpenLayers and QuickMapServices plugins of canvas rotation being supported. It's also quicker.

0

You can simply use GDAL in order to transform a single image into a pyramid. Then you can serve your pyramid (a bunch of static files and directories) with any web server.

You need to know the corner coordinates of your image in order to be able to transform your png into a Geotiff.

#!/bin/bash

# Add geograpphical information into image
gdal_translate -of GTiff -a_ullr 1 47 2 46 -a_srs EPSG:4326  input.png output.tif
# Build Pyramid
gdal2tiles.py --zoom=2-6 --resampling=bilinear --webviewer=leaflet output.tif ./output/directory

Similar method is possible with gdal_retile.py but you probably need to build a VRT file :

#!/bin/bash

# Add geograpphical information into image
gdal_translate -of GTiff -a_ullr 1 47 2 46 -a_srs EPSG:4326  input.png output.tif

# Build VRT model
gdalbuildvrt output.tif world.vrt

# Build Pyramid
gdal_retile.py -v -r bilinear -levels 1 -ps 2048 2048 -co "TILED=YES" -co "COMPRESS=JPEG" -targetDir ./export/directory world.vrt

Here I explain a full use case with that type of methods: http://xavierraffin.com/2016/12/17/Custom-webmap-from-multiple-images/

0

OpenLayer QGIS plugin is no longer maintained, prefer use QuickMapServices plugin to get access to a multitude of basemap.

When you fisrt load the plugin, you will need to go to Internet menu --> QuickMapServices --> settings --> Get contributed pack to have a complete list of provider (Google, Bing, OSM and many others)

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.