.
This chapter gives a quick overview of installing QGIS, some sample data from the QGIS web page, and running a first and simple session visualizing raster and vector layers.
Installation of QGIS is very simple. Standard installer packages are available for MS Windows and Mac OS X. For many flavors of GNU/Linux, binary packages (rpm and deb) or software repositories are provided to add to your installation manager. Get the latest information on binary packages at the QGIS website at http://download.qgis.org.
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 http://htmlpreview.github.io/?https://raw.github.com/qgis/QGIS/master/doc/INSTALL.html
QGIS allows you to define a --configpath option that overrides the default path for user configuration (e.g., ~/.qgis2 under Linux) and forces QSettings to use this directory, too. This allows you to, for instance, carry a QGIS installation on a flash drive together with all plugins and settings. See section Systeemmenu for additional information.
The user guide contains examples based on the QGIS sample dataset.
The Windows installer has an option to download the QGIS sample dataset. If checked, the data will be downloaded to your My Documents folder and placed in a folder called GIS Database. You may use Windows Explorer to move this folder to any convenient location. If you did not select the checkbox to install the sample dataset during the initial QGIS installation, you may do one of the following:
GIS-gegevens gebruiken die u al heeft
For GNU/Linux and Mac OS X, there are not yet dataset installation packages available as rpm, deb or dmg. To use the sample dataset, download the file qgis_sample_data as a ZIP archive from http://qgis.org/downloads/data and unzip the archive on your system.
The Alaska dataset includes all GIS data that are used for examples and screenshots in the user guide; it also includes a small GRASS database. The projection for the QGIS sample dataset 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, http://grass.osgeo.org/download/sample-data/.
Now that you have QGIS installed and a sample dataset available, we would like to demonstrate a short and simple QGIS sample session. 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.
Blader naar de map qgis_sample_data/raster/, selecteer het ERDAS Img bestand landcover.img en klik op [Open].
Dubbelklik op de kaartlaag lakes in het paneel Lagen aan de linkerkant, om het dialoogvenster Laag-eigenschappen te openen.
Selecteer de tab Stijl en selecteer blauw als vulkleur.
Klik op [Apply], en controleer of het resultaat er goed uitziet, klik tenslotte op [OK].
You can see how easy it is to visualize raster and vector layers in QGIS. Let’s move on to the sections that follow to learn more about the available functionality, features and settings, and how to use them.
In section Sample Session you already learned how to start QGIS. We will repeat this here, and you will see that QGIS also provides further command line options.
To stop QGIS, click the menu option File QGIS ‣ Quit, or use the shortcut Ctrl+Q.
QGIS supports a number of options when started from the command line. To get a list of the options, enter qgis --help on the command line. The usage statement for QGIS is:
qgis --help
QGIS - 2.6.0-Brighton 'Brighton' (exported)
QGIS is a user friendly Open Source Geographic Information System.
Usage: /usr/bin/qgis.bin [OPTION] [FILE]
OPTION:
[--snapshot filename] emit snapshot of loaded datasets to given file
[--width width] width of snapshot to emit
[--height height] height of snapshot to emit
[--lang language] use language for interface text
[--project projectfile] load the given QGIS project
[--extent xmin,ymin,xmax,ymax] set initial map extent
[--nologo] hide splash screen
[--noplugins] don't restore plugins on startup
[--nocustomization] don't apply GUI customization
[--customizationfile] use the given ini file as GUI customization
[--optionspath path] use the given QSettings path
[--configpath path] use the given path for all user configuration
[--code path] run the given python file on load
[--defaultui] start by resetting user ui settings to default
[--help] this text
FILE:
Files specified on the command line can include rasters,
vectors, and QGIS project files (.qgs):
1. Rasters - supported formats include GeoTiff, DEM
and others supported by GDAL
2. Vectors - supported formats include ESRI Shapefiles
and others supported by OGR and PostgreSQL layers using
the PostGIS extension
Tip
Voorbeeld gebruik argumenten opdrachtregel
You can start QGIS by specifying one or more data files on the command line. For example, assuming you are in the qgis_sample_data directory, you could start QGIS with a vector layer and a raster file set to load on startup using the following command: qgis ./raster/landcover.img ./gml/lakes.gml
Opdrachtregel optie –-snapshot
Deze optie geeft de mogelijkheid om een schermafdruk te maken in de indeling PNG van de huidige weergave. Dit is een handige optie wanneer u heel veel projecten hebt en u snel schermafdrukken wilt maken van de projecten.
Standaard genereert dit een PNG-bestand met een resolutie van 800x600 pixels. Dit kan worden aangepast door de opties --width en --height mee te geven op de opdrachtregel. Een bestandsnaam kan worden meegegeven achter --snapshot.
Opdrachtregel optie –-lang
Based on your locale, QGIS selects the correct localization. If you would like to change your language, you can specify a language code. For example, --lang=it starts QGIS in italian localization.
Opdrachtregel optie –-project
Starting QGIS with an existing project file is also possible. Just add the command line option --project followed by your project name and QGIS will open with all layers in the given file loaded.
Opdrachtregel optie –-extent
Met deze optie kunt u precies het geografische gebied aangeven dat u direct na het opstarten in beeld wilt zien. De volgende coördinaten van de linker benedenhoek en de rechter bovenhoek dienen, gescheiden door een komma, als volgt ingegeven te worden:
--extent xmin,ymin,xmax,ymax
Opdrachtregel optie --nologo
This command line argument hides the splash screen when you start QGIS.
Opdrachtregel optie --noplugins
Wanneer het opstarten problemen geeft en u denkt dat dit veroorzaakt wordt door plug-ins, kunt u deze optie meegeven zodat de plug-ins niet direct worden bijgeladen tijdens het opstarten. De plug-ins zullen nadien wel beschikbaar zijn vanuit Plug-ins beheren en installeren.
Opdrachtregel optie --customizationfile
Met deze opdrachtregel optie, kunt u een bestand voor aanpassingen aan de GUI opgeven dat wordt toegepast tijdens het opstarten.
Opdrachtregel optie --nocustomization
Met deze opdrachtregel optie zullen bestaande aanpassingen aan de GUI niet worden toegepast tijdens het opstarten.
Opdrachtregel optie --optionspath
You can have multiple configurations and decide which one to use when starting QGIS with this option. See Opties to confirm where the operating system saves the settings files. Presently, there is no way to specify a file to write settings to; therefore, you can create a copy of the original settings file and rename it. The option specifies path to directory with settings. For example, to use /path/to/config/QGIS/QGIS2.ini settings file, use option:
--optionspath /path/to/config/
Opdrachtregel optie --configpath
This option is similar to the one above, but furthermore overrides the default path for user configuration (~/.qgis2) and forces QSettings to use this directory, too. This allows users to, for instance, carry a QGIS installation on a flash drive together with all plugins and settings.
Opdrachtregel optie --code
This option can be used to run a given python file directly after QGIS has started.
Als u bijvoorbeeld een bestand voor Python heeft, dat is genaamd load_alaska.py, met de volgende inhoud:
from qgis.utils import iface
raster_file = "/home/gisadmin/Documents/qgis_sample_data/raster/landcover.img"
layer_name = "Alaska"
iface.addRasterLayer(raster_file, layer_name)
Assuming you are in the directory where the file load_alaska.py is located, you can start QGIS, load the raster file landcover.img and give the layer the name ‘Alaska’ using the following command: qgis --code load_alaska.py
The state of your QGIS session is considered a project. QGIS works on one project at a time. Settings are considered as being either per-project or as a default for new projects (see section Opties). QGIS can save the state of your workspace into a project file using the menu options Project ‣ Save or Project ‣ Save As....
Load saved projects into a QGIS session using Project ‣ Open..., Project ‣ New from template or Project ‣ Open Recent ‣.
If you wish to clear your session and start fresh, choose Project ‣ New. Either of these menu options will prompt you to save the existing project if changes have been made since it was opened or last saved.
De soorten informatie die worden opgeslagen in een projectbestand zijn:
De toegevoegde lagen
Welke lagen kunnen worden bevraagd
De eigenschappen van de laag, inclusief symbologie en stijlen
Gebruikte coördinatensysteem voor het kaartvenster
De grootte en inhoud van de kaart zoals u deze het laatst zag
Printvormgeving
Elementen van Printvormgeving met instellingen
Instellingen voor atlas van Printvormgeving
Instellingen voor digitaliseren
Relaties voor tabellen
Projectmacro’s
Standaard stijlen voor project
Instellingen voor plug-ins
Instellingen voor QGIS Server van de tab Instellingen OWS in de Projecteigenschappen
Opgeslagen query’s in DB Manager
The project file is saved in XML format, so it is possible to edit the file outside QGIS if you know what you are doing. The file format has been updated several times compared with earlier QGIS versions. Project files from older QGIS versions may not work properly anymore. To be made aware of this, in the General tab under Settings ‣ Options you can select:
Whenever you save a project in QGIS a backup of the project file is made with the extension ~.
There are several ways to generate output from your QGIS session. We have discussed one already in section Projecten, saving as a project file. Here is a sampling of other ways to produce output files: