5. Getting Started
This chapter provides a quick overview of installing QGIS, downloading QGIS sample data, and running a first simple session visualizing raster and vector data.
5.1. Installing QGIS
QGIS project provides different ways to install QGIS depending on your platform.
5.1.1. Installing from binaries
Standard installers are available for MS Windows and macOS. Binary packages (rpm and deb) or software repositories are provided for many flavors of GNU/Linux .
For more information and instructions for your operating system check https://download.qgis.org.
5.1.2. Installing from source
If you need to build QGIS from source, please refer to the installation
instructions. They are distributed with the QGIS source code in a file
called INSTALL
. You can also find them online at
https://github.com/qgis/QGIS/blob/master/INSTALL.md.
If you want to build a particular release and not the version in development,
you should replace master
with the release branch (commonly in the
release-X_Y
form) in the above-mentioned link (installation instructions may differ).
5.1.3. Installing on external media
It is possible to install QGIS (with all plugins and settings) on a flash drive. This is achieved by defining a --profiles-path option that overrides the default user profile path and forces QSettings to use this directory, too. See section System Settings for additional information.
5.1.4. Downloading sample data
This user guide contains examples based on the QGIS sample dataset (also called
the Alaska dataset
). Download the sample data from
https://github.com/qgis/QGIS-Sample-Data/archive/master.zip and unzip the archive
on any convenient location on your system.
The Alaska dataset includes all GIS data that are used for the examples and screenshots in this user guide; it also includes a small GRASS database. The projection for the QGIS sample datasets is Alaska Albers Equal Area with units feet. The EPSG code is 2964.
PROJCS["Albers Equal Area",
GEOGCS["NAD27",
DATUM["North_American_Datum_1927",
SPHEROID["Clarke 1866",6378206.4,294.978698213898,
AUTHORITY["EPSG","7008"]],
TOWGS84[-3,142,183,0,0,0,0],
AUTHORITY["EPSG","6267"]],
PRIMEM["Greenwich",0,
AUTHORITY["EPSG","8901"]],
UNIT["degree",0.0174532925199433,
AUTHORITY["EPSG","9108"]],
AUTHORITY["EPSG","4267"]],
PROJECTION["Albers_Conic_Equal_Area"],
PARAMETER["standard_parallel_1",55],
PARAMETER["standard_parallel_2",65],
PARAMETER["latitude_of_center",50],
PARAMETER["longitude_of_center",-154],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["us_survey_feet",0.3048006096012192]]
If you intend to use QGIS as a graphical front end for GRASS, you can find a selection of sample locations (e.g., Spearfish or South Dakota) at the official GRASS GIS website, https://grass.osgeo.org/download/sample-data/.
5.2. Starting and stopping QGIS
QGIS can be started like any other application on your computer. This means that you can launch QGIS by:
double clicking the icon in your Applications folder or desktop shortcut
double clicking an existing QGIS project file (with
.qgz
or.qgs
extension). Note that this will also open the project.typing
qgis
in a command prompt (assuming that QGIS is added to your PATH or you are in its installation folder)
To stop QGIS, use:
5.3. Sample Session: Loading raster and vector layers
Now that you have QGIS installed and a sample dataset available, we will demonstrate a first sample session. In this example, we will visualize a raster and a vector layer. We will use:
the
landcover
raster layer (qgis_sample_data/raster/landcover.img
)and the
lakes
vector layer (qgis_sample_data/gml/lakes.gml
)
Where qgis_sample_data
represents the path to the unzipped dataset.
Start QGIS as seen in Starting and stopping QGIS.
To load the files in QGIS:
Click on the Open Data Source Manager icon. The Data Source Manager should open in Browser mode.
Browse to the folder
qgis_sample_data/raster/
Select the ERDAS IMG file
landcover.img
and double-click it. The landcover layer is added in the background while the Data Source Manager window remains open.To load the lakes data, browse to the folder
qgis_sample_data/gml/
, and double-click thelakes.gml
file to open it.A Coordinate Reference System Selector dialog opens. In the Filter menu, type
2964
, filtering the list of Coordinate Reference Systems below.Select the NAD27 / Alaska Albers entry
Click OK
Close the Data Source Manager window
You now have the two layers available in your project in some random colours. Let's do some customization on the lakes layer.
Zoom to an area with some lakes
Double-click the
lakes
layer in the map legend to open the Properties dialogTo change the lakes color:
To display the name of the lakes:
You can improve readability of the labels by adding a white buffer around them:
Let's now add some decorations in order to shape the map and export it out of QGIS:
Select
menuCustomize the options of the dialog as you want
Press Apply
Likewise, from the decorations menu, add more items (north arrow, copyright...) to the map canvas with custom properties.
Press Save in the opened dialog
Select a file location, a format and confirm by pressing Save again.
That's it! You can see how easy it is to visualize raster and vector layers in QGIS, configure them and generate your map in an image format you can use in other softwares. Let's move on to learn more about the available functionality, features and settings, and how to use them.
备注
To continue learning QGIS through step-by-step exercises, follow the Training manual.