barf
Member
This tutorial describes extracting ortho-photos from Web Mapping Tile Services (WMTS) using QGIS.
Finding aerial and satellite imagery sources can be the most difficult part of this process. High-resolution photos are often copyrighted and not free for re-use, leaving LandSat or expensive commercial imagery as the only option. Things are improving though, with thanks to open source initiatives like OpenStreetMap and OpenAerialMap.
This tutorial uses examples from the Land Information New Zealand (LINZ) data service APIs, but the process is similar for other WMTS/WMS services.
WMTS connection setup:
Finding aerial and satellite imagery sources can be the most difficult part of this process. High-resolution photos are often copyrighted and not free for re-use, leaving LandSat or expensive commercial imagery as the only option. Things are improving though, with thanks to open source initiatives like OpenStreetMap and OpenAerialMap.
This tutorial uses examples from the Land Information New Zealand (LINZ) data service APIs, but the process is similar for other WMTS/WMS services.
WMTS connection setup:
- Download and install QGIS.
- Create a new project using a localised map projection (eg; EPSG:2193 for New Zealand).
- To add a new WMTS source, go to the Layer menu -> Add Layer -> WMTS.
- Click 'New' to add a new connection.
- Enter a name for your own reference, and the URL of the WMTS server's "WMTSCapabilities.xml" file.
- Click 'Connect'. If the connection is successful, the Layers tab will show and list the available layers. Pay attention to the CRS column -- use tile sets which are in your local projection wherever possible (or harmonise the project CRS with available tile CRS).
- Click 'Add' on the layers you want to import and then 'Close'. The QGIS map window should now update. If you do not see it, right click it in the layers window and select 'Zoom to layer'.
- Layer -> Create Layer -> New Shapefile Layer.
- Select the Project CRS, layer type 'Polygon' and choose a filename for the new .shp file that will be saved.
- Click the pencil icon to 'Toggle editing'.
- Click 'Add point feature' then click on the map where the origin/centre of the rectangle will be. It will ask for an id, but just click OK because we only want the position information here.
- (Optional, but a good idea: round the origin to whole units in the CRS). Click 'Vertex Tool' and right-click the point you just added. Truncate the fractional units to zero, or enter a more sensible origin by hand.
- Click 'Save layer edits' and the 'Toggle editing' button to leave edit mode.
- Plugins -> Manage and install plugins. Install the plugin called 'Shape Tools'. This plugin can create a rectangle around the point we just made.
- Click 'Create Polygon' and a window will appear asking for the parameters.
- Select the input point layer, number of sides is 4. Starting angle is 45. Radius in kilometers, and the radius.
- For the Output Layer, choose to Save to file and choose a filename for the .shp file.
- Click 'Run' and bask in the glory of your first virtual cookie cutter! Right click and edit the layer properties to make it extra colourful, cool and transparent.
- Right click the WMTS layer, and go to Export -> Save As.
- Select format: GeoTIFF and un-tick 'Create VRT' - we don't want a VRT.
- Choose a filename for the .tif file output, and select the project CRS.
- Set extents manually, or calculate extents from the layer we created earlier:
- Set export resolution. Horizontal and vertical values here are in meters/pixel, or alternatively, set the columns and rows in pixels (and meters/pixel will be computed). To find the WMTS layer's supported zoom levels/resolutions, look up the service's documentation or metadata.
- Click OK to export. A progress bar should appear down the bottom. If it fails, check your requested resolution and size, some WMTS services might say noooo if you try and pull 2GB in one request. YMMV.
Last edited: