Skip to content
Snippets Groups Projects
Commit 94208571 authored by Wigal, Jacob (CIV)'s avatar Wigal, Jacob (CIV) :sparkles:
Browse files

Initial commit

parent 205258a7
No related branches found
No related tags found
No related merge requests found
Showing
with 153 additions and 0 deletions
**Table of Contents**
[[_TOC_]]
# Download QGIS
[QGIS Download link](https://qgis.org/en/site/forusers/download.htm)
# Start a new project
1. New Project
![qgis-screenshots/Untitled.png](./qgis-screenshots/Untitled.png?raw=true)
2. Add your base map
![qgis-screenshots/Untitled%201.png](./qgis-screenshots/Untitled%201.png?raw=true)
![qgis-screenshots/Untitled%202.png](./qgis-screenshots/Untitled%202.png?raw=true)
3. Zoom to your desired extent
![qgis-screenshots/Untitled%203.png](./qgis-screenshots/Untitled%203.png?raw=true)
4. Create a bookmark to save your map extent view
![qgis-screenshots/Untitled%204.png](./qgis-screenshots/Untitled%204.png?raw=true)
# Add base maps to QGIS
Go to Plug-ins>Python Console. Paste the below script into the console and run.
```python
"""
This script should be run from the Python console inside QGIS.
It adds online sources to the QGIS Browser.
Each source should contain a list with the folowing items (string type):
[sourcetype, title, authconfig, password, referer, url, username, zmax, zmin]
You can add or remove sources from the sources section of the code.
Script by Klas Karlsson
Sources from https://qms.nextgis.com/
"""
# Sources
sources = []
sources.append(["connections-xyz","Google Maps","","","","https://mt1.google.com/vt/lyrs=m&x=%7Bx%7D&y=%7By%7D&z=%7Bz%7D","","19","0"])
sources.append(["connections-xyz","Google Satellite", "", "", "", "https://mt1.google.com/vt/lyrs=s&x=%7Bx%7D&y=%7By%7D&z=%7Bz%7D", "", "19", "0"])
sources.append(["connections-xyz","Google Terrain", "", "", "", "https://mt1.google.com/vt/lyrs=t&x=%7Bx%7D&y=%7By%7D&z=%7Bz%7D", "", "19", "0"])
sources.append(["connections-xyz","Google Terrain Hybrid", "", "", "", "https://mt1.google.com/vt/lyrs=p&x=%7Bx%7D&y=%7By%7D&z=%7Bz%7D", "", "19", "0"])
sources.append(["connections-xyz","Google Satellite Hybrid", "", "", "", "https://mt1.google.com/vt/lyrs=y&x=%7Bx%7D&y=%7By%7D&z=%7Bz%7D", "", "19", "0"])
sources.append(["connections-xyz","Stamen Terrain", "", "", "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL", "http://tile.stamen.com/terrain/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "20", "0"])
sources.append(["connections-xyz","Stamen Toner", "", "", "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL", "http://tile.stamen.com/toner/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "20", "0"])
sources.append(["connections-xyz","Stamen Toner Light", "", "", "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL", "http://tile.stamen.com/toner-lite/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "20", "0"])
sources.append(["connections-xyz","Stamen Watercolor", "", "", "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under ODbL", "http://tile.stamen.com/watercolor/%7Bz%7D/%7Bx%7D/%7By%7D.jpg", "", "18", "0"])
sources.append(["connections-xyz","Wikimedia Map", "", "", "OpenStreetMap contributors, under ODbL", "https://maps.wikimedia.org/osm-intl/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "20", "1"])
sources.append(["connections-xyz","Wikimedia Hike Bike Map", "", "", "OpenStreetMap contributors, under ODbL", "http://tiles.wmflabs.org/hikebike/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "17", "1"])
sources.append(["connections-xyz","Esri Boundaries Places", "", "", "", "https://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "20", "0"])
sources.append(["connections-xyz","Esri Gray (dark)", "", "", "", "http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "16", "0"])
sources.append(["connections-xyz","Esri Gray (light)", "", "", "", "http://services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "16", "0"])
sources.append(["connections-xyz","Esri National Geographic", "", "", "", "http://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "12", "0"])
sources.append(["connections-xyz","Esri Ocean", "", "", "", "https://services.arcgisonline.com/ArcGIS/rest/services/Ocean/World_Ocean_Base/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "10", "0"])
sources.append(["connections-xyz","Esri Satellite", "", "", "", "https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "17", "0"])
sources.append(["connections-xyz","Esri Standard", "", "", "", "https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "17", "0"])
sources.append(["connections-xyz","Esri Terrain", "", "", "", "https://server.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "13", "0"])
sources.append(["connections-xyz","Esri Transportation", "", "", "", "https://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "20", "0"])
sources.append(["connections-xyz","Esri Topo World", "", "", "", "http://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/%7Bz%7D/%7By%7D/%7Bx%7D", "", "20", "0"])
sources.append(["connections-xyz","OpenStreetMap Standard", "", "", "OpenStreetMap contributors, CC-BY-SA", "http://tile.openstreetmap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "19", "0"])
sources.append(["connections-xyz","OpenStreetMap H.O.T.", "", "", "OpenStreetMap contributors, CC-BY-SA", "http://tile.openstreetmap.fr/hot/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "19", "0"])
sources.append(["connections-xyz","OpenStreetMap Monochrome", "", "", "OpenStreetMap contributors, CC-BY-SA", "http://tiles.wmflabs.org/bw-mapnik/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "19", "0"])
sources.append(["connections-xyz","OpenTopoMap", "", "", "Kartendaten: © OpenStreetMap-Mitwirkende, SRTM | Kartendarstellung: © OpenTopoMap (CC-BY-SA)", "https://tile.opentopomap.org/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "17", "1"])
sources.append(["connections-xyz","Strava All", "", "", "OpenStreetMap contributors, CC-BY-SA", "https://heatmap-external-b.strava.com/tiles/all/bluered/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "15", "0"])
sources.append(["connections-xyz","Strava Run", "", "", "OpenStreetMap contributors, CC-BY-SA", "https://heatmap-external-b.strava.com/tiles/run/bluered/%7Bz%7D/%7Bx%7D/%7By%7D.png?v=19", "", "15", "0"])
sources.append(["connections-xyz","Open Weather Map Temperature", "", "", "Map tiles by OpenWeatherMap, under CC BY-SA 4.0", "http://tile.openweathermap.org/map/temp_new/%7Bz%7D/%7Bx%7D/%7By%7D.png?APPID=1c3e4ef8e25596946ee1f3846b53218a", "", "19", "0"])
sources.append(["connections-xyz","Open Weather Map Clouds", "", "", "Map tiles by OpenWeatherMap, under CC BY-SA 4.0", "http://tile.openweathermap.org/map/clouds_new/%7Bz%7D/%7Bx%7D/%7By%7D.png?APPID=ef3c5137f6c31db50c4c6f1ce4e7e9dd", "", "19", "0"])
sources.append(["connections-xyz","Open Weather Map Wind Speed", "", "", "Map tiles by OpenWeatherMap, under CC BY-SA 4.0", "http://tile.openweathermap.org/map/wind_new/%7Bz%7D/%7Bx%7D/%7By%7D.png?APPID=f9d0069aa69438d52276ae25c1ee9893", "", "19", "0"])
sources.append(["connections-xyz","CartoDb Dark Matter", "", "", "Map tiles by CartoDB, under CC BY 3.0. Data by OpenStreetMap, under ODbL.", "http://basemaps.cartocdn.com/dark_all/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "20", "0"])
sources.append(["connections-xyz","CartoDb Positron", "", "", "Map tiles by CartoDB, under CC BY 3.0. Data by OpenStreetMap, under ODbL.", "http://basemaps.cartocdn.com/light_all/%7Bz%7D/%7Bx%7D/%7By%7D.png", "", "20", "0"])
sources.append(["connections-xyz","Bing VirtualEarth", "", "", "", "http://ecn.t3.tiles.virtualearth.net/tiles/a{q}.jpeg?g=1", "", "19", "1"])
# Add sources to browser
for source in sources:
connectionType = source[0]
connectionName = source[1]
QSettings().setValue("qgis/%s/%s/authcfg" % (connectionType, connectionName), source[2])
QSettings().setValue("qgis/%s/%s/password" % (connectionType, connectionName), source[3])
QSettings().setValue("qgis/%s/%s/referer" % (connectionType, connectionName), source[4])
QSettings().setValue("qgis/%s/%s/url" % (connectionType, connectionName), source[5])
QSettings().setValue("qgis/%s/%s/username" % (connectionType, connectionName), source[6])
QSettings().setValue("qgis/%s/%s/zmax" % (connectionType, connectionName), source[7])
QSettings().setValue("qgis/%s/%s/zmin" % (connectionType, connectionName), source[8])
# Update GUI
iface.reloadConnections()
```
# Create points/lines/shapes
1. New Geopackage Layer (later make sure to export to geojson)
![qgis-screenshots/Untitled%205.png](./qgis-screenshots/Untitled%205.png?raw=true)
2. Toggle Editing Mode On
![qgis-screenshots/Untitled%206.png](./qgis-screenshots/Untitled%206.png?raw=true)
3. Create your feature
- Right-click to complete
- Esc to undo all uncompleted edits
- Vertex Tool/Edit panel can be used to adjust position
![qgis-screenshots/Untitled%207.png](./qgis-screenshots/Untitled%207.png?raw=true)
4. Toggle Editing Mode Off and Save
5. See what you have created using the Identify Features Tool
![qgis-screenshots/Untitled%208.png](./qgis-screenshots/Untitled%208.png?raw=true)
# Make changes to the attribute table
1. Open the attribute table
![qgis-screenshots/Untitled%209.png](./qgis-screenshots/Untitled%209.png?raw=true)
2. Toggle Editing Mode On
![qgis-screenshots/Untitled%2010.png](./qgis-screenshots/Untitled%2010.png?raw=true)
3. From here you can do a number of things such as...
- Create a new field
![qgis-screenshots/Untitled%2011.png](./qgis-screenshots/Untitled%2011.png?raw=true)
- Access the Field Calculator (quickly assign/replace/edit values aka attribute table operations)
![qgis-screenshots/Untitled%2012.png](./qgis-screenshots/Untitled%2012.png?raw=true)
- Select Features (attribute fields) by expressions
![qgis-screenshots/Untitled%2013.png](./qgis-screenshots/Untitled%2013.png?raw=true)
# Import a raster
- Layer>Add Layer>Add Raster Layer
- OR just drag and drop
# Clip (or crop) a raster
Raster>Extraction>Clip Raster by Extent
# Export layer as GeoJSON
1. Right click the layer you wish to export
2. Select Export>Save Features As...
![qgis-screenshots/Screen_Shot_2020-06-25_at_3.49.17_PM.png](./qgis-screenshots/Screen_Shot_2020-06-25_at_3.49.17_PM.png?raw=true)
3. Under Format choose GeoJSON
# Select geometry by overlapping layers
[Stack Exchange Solution](https://gis.stackexchange.com/questions/61753/selecting-features-within-polygon-from-another-layer-using-qgis)
\ No newline at end of file
qgis/qgis-screenshots/Screen_Shot_2020-06-25_at_3.49.17_PM.png

326 KiB

qgis/qgis-screenshots/Untitled 1.png

4.8 KiB

qgis/qgis-screenshots/Untitled 10.png

2.64 KiB

qgis/qgis-screenshots/Untitled 11.png

1.56 KiB

qgis/qgis-screenshots/Untitled 12.png

1.72 KiB

qgis/qgis-screenshots/Untitled 13.png

2.54 KiB

qgis/qgis-screenshots/Untitled 2.png

4.11 KiB

qgis/qgis-screenshots/Untitled 3.png

4.35 KiB

qgis/qgis-screenshots/Untitled 4.png

35.6 KiB

qgis/qgis-screenshots/Untitled 5.png

4.07 KiB

qgis/qgis-screenshots/Untitled 6.png

2.64 KiB

qgis/qgis-screenshots/Untitled 7.png

1.83 KiB

qgis/qgis-screenshots/Untitled 8.png

3.2 KiB

qgis/qgis-screenshots/Untitled 9.png

647 B

qgis/qgis-screenshots/Untitled.png

626 B

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment