[GIS] Capturing coordinates of map extents in QGIS print composer atlas

atlasextentsgoogle mapsprint-composerqgis

Here's what I have done so far:

  • In QGIS 2.10.1 Pisa on Windows 10, I have a set of polygons overlaid onto Google Maps using
    the OpenLayers plugin in QGIS.
  • Using print composer, I have created an atlas which enables me to
    show and export each polygon along with the underlying map to a single .jpg or .pdf

Here's what I'm having trouble with:

  • In print composer, it is possible to see the coordinates of the map extents for each of the atlas items. These are shown in the item properties area for the map I have added to the composition.
  • I would like to be able to export the coordinates of the map extents, by either including them in a label on the composition itself, or as a standalone dump.

I do not seem to be able to do this using the available expressions.

Best Answer

Answering my own question here. The following steps in QGIS 2.10.1 Pisa on Windows 10 helped me answer the question:

  • Let's say your polygons are in a vector layer called "foo.shp" and you've loaded them into your QGIS project. We're trying to find out the "extents" of each polygon, which are the coordinates of the corners of a squares/rectangles exactly big enough to fit each polygon in.

  • To obtain these extents for each polygon in foo.shp select "Polygon from Layer Extent" from the menu called Vector -> Research Tools. In the resulting dialogue, choose foo.shp as the input layer and check the boxes labelled "Calculate Extent for each feature separately" and (if you want to see the outcome) "Add result to canvas".

  • Then choose an output layer: you'll need to create a shapefile in /path-to-my/project/ to save the output in. Let's call it "bar.shp".

  • Once you've done this, select OK to run the operation. You will then have a new vector layer called "bar" which displays the data on the extents of the your original polygons.

  • To see this data for "bar" open the layer's Attribute Table. The full coordinates of the polygons can be exported from there.

Related Question