Useful instructions for doing various operations in QGIS collected into one place.
Instructions adapted from here.
Steps:
-
Open the Python Console in QGIS by going to the "Plugins" dropdown menu and selecting on "Python Console":
-
Copy the script from https://github.com/klakar/QGIS_resources/blob/master/collections/Geosupportsystem/python/qgis_basemaps.py into the Python Console and run it. This will populate the "XYZ Tiles" section in the Browser with a variety of basemaps that you can add to your project.
Prerequisites:
-
Postman or another setup that will allow you to call an API. Your browser should also work.
-
Also need a valid Bing Maps key. You can get a basic developer tier key by making an account at https://www.bingmapsportal.com/Application. Your key will appear in a table on this page once you succeed in making the account and getting a key.
Steps:
- Use the Bing Maps imagery metadata API to get the tile service URL, which is dynamic.
- Use the following URL, replace
<BingMapsKey>
with your key, and choose the type of imagery you’d like to see (example here is requestingAerialWithLabelsOnDemand
- options are listed in the linked documentation).
http://dev.virtualearth.net/REST/V1/Imagery/Metadata/AerialWithLabelsOnDemand?output=json&include=ImageryProviders&key=<BingMapsKey>
- GET with the completed URL, and the returned JSON should include the following field somewhere nested in there:
"imageHeight": 256,
"imageUrl": "http://ecn.{subdomain}.tiles.virtualearth.net/tiles/a{quadkey}.jpeg?g=8266",
"imageUrlSubdomains": [
"t0",
"t1",
"t2",
"t3"
],
"imageWidth": 256,
-
Copy the
imageUrl
field and select animageUrlSubdomain
(any will do) -
In QGIS, in the Browser panel, add a New Connection to “XYZ Tiles"
- In the dialog, fill the URL with the
imageURL
, filling in theimageUrlSubdomain
with a valid value, and also write “q” in the place of the Quadkey.
-
Set the Tile Resolution to 256 and click "OK".
-
Add a layer of the connection type you just created to the project (by right-clicking on it under "XYZ tiles" and clicking "add layer to project")
Prerequisite: a GEE account.
Installation and authentication instructions: https://gee-community.github.io/qgis-earthengine-plugin/
In QGIS' Python Console or Editor, start with
import ee
from ee_plugin import Map
The result of a Map.addLayer()
call will add the result as an XYZ tile layer to the current project. The name of the layer will be the name you designated in the Map.addLayer()
call.
The following screenshot shows running a script to add a Sentinel-2 median composite over a time period as a layer.