Graphics Reference
In-Depth Information
Next, we need an overlay, which will show lakes and rivers on top of our base map. To get
this information, go back to the Downloads tab and select the Physical link under the
Medium scale data, 1:50m section. The dataset you want is called Rivers, Lake Center-
lines , so click on the Download rivers and lake centerlines link to obtain this file.
Finally, we'll want to highlight the cities on top of our base map. Go back to the Down-
loads page and select the Cultural link under the Medium scale data, 1:50m heading. At
the bottom is a section labelled Urban Areas . Click on the Download urban areas link
to download this file.
Once you've done all this, you should have the following three files:
• A raster base map in a file named NE1_50M_SR_W.zip
• Lake and river vector data in a file named
ne_50m_rivers_lake_centerlines.zip
• Urban area vector data in a file named ne_50m_urban_areas.zip
Since these are ZIP archives, you will need to unzip these files and store them somewhere
at a convenient location on your hard disk.
Tip
You'll need to type in the full path to these datasets, so you might want to put them some-
where convenient, for example, in your home or user directory. In this way, the path you
type won't be too long.
Now that we have our data, let's use the QGIS Python Console to import this data into a
project. If you've already loaded some data into QGIS (for example, by following the tu-
torial in the QGIS User Guide), choose the New option from the Project menu to start
again with a blank project. Then, type the following into the QGIS Python Console:
layer1 = iface.addRasterLayer("/path/to/NE1_50M_SR_W/
NE1_50M_SR_W.tif", "basemap")
Make sure you replace /path/to/ with the full path to the NE1_50M_SR_W directory
you downloaded. Assuming you typed the path correctly, the Natural Earth 1 base map
should appear in the QGIS window:
Search WWH ::




Custom Search