0% found this document useful (0 votes)
28 views

Qgis Tutorial Nyit 2024

Uploaded by

Stuti shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views

Qgis Tutorial Nyit 2024

Uploaded by

Stuti shah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

QGIS

TUTORIALS
2024

Professor:

Adriana Chávez
CLASS 1

2 3
1. DATA SOURCES 2. TYPES OF DATA

Global • Points
• Lines
• Natural Earth Data • Polygons
• USGS Earth Explorer • Tables
• OpenStreetMap • Rasters (color bands)
• Esri Open Data Hub
• NASA’s Socioeconomic Data and Applications Center (SEDAC)
For each shape file you’ll have 5 files. You need to download all
• Open topography
the folder with data, if not it’s not going to work.
• UNEP Environmental Data Explorer
• NASA Earth Observations
• Digital Social Science Center (DSSC) Columbia University Shapefiles
• Geo Data Tufts
• Cornell University Geospatial Information Repository . dbf it’s a table
• UN Environment Programme .cpg are points
• World Health Organization .prj it’s information about the projection
.shx it’s a support file for the shape
USA .shp is our vectorial information (this is the one you will plug into
QGIS)
• US Census
• Data.gov
• Social explorer (On Columbia University network) 3. PROJECTIONS

NYC and NY State “A projection is the means by which you display the coordinate
system and your data on a flat surface, such as a piece of paper or
• NYC Open Data a digital screen. Mathematical calculations are used to convert the
• Bytes of the Big Apple coordinate system used on the curved surface of earth to one for a
• NY GIS Clearinghouse flat surface.” Source: ArcGIS PRO

CITATION

When creating any GIS file you should always cite your sources.
Including the source, date, etc.

ORGANIZING YOUR DATA

It is very recommended that you save a folder in your C: Folder.

C: // QGIS >
00_DATA

It is recommended creating an excel file with the sources, and


data layers, so that you can track the information.

4 5
You can explore other projections such as: Robinson, Fuller, Goode Canvas and Legend
Homolosine (land), Goode Homolosine (ocean), Polar UPS North, You can change the background color to black to have a more
Vertical perspective, etc. See more projections in this link. For “autocad” feel.
example: The world from space. Map Tools
Select the units. For example: meters, feet, etc.

4. ORGANIZE YOUR DATA


5. PROJECTIONS
Before you start it’s very important to organize your folders.

C: // QGIS > To select the projection you will click on > Options > CRS:
00_DATA Coordinates > Select your coordinate system. For example: set
01_GIS default > EPSG 3857 - WGS 84 / Pseudo-Mercator
02_EXPORT (To save layers that you create)
Verify the parameters of the selected projection. For example:
Important Units.
When you save your files remember not to add too many
characters in the file’s name and don’t use spaces or special 6. ADD A BASE IMAGE
characters in file names
(use . or _). This will prevent your file from crashing. GIS Data You can add a Google Maps or a Google Satellite image as a
occupies a lot of space, so you can also have an external hard drive background.
to save your information. Always remember to save! You don’t
want to lose your file. Install the HCMGIS Plugin
Go to plugin > Manage and install plugins > Search HCMGIS >
Set up your file Install
Set up language English (American). You can use your language of Once installed go to HCMGIS on the top and add Google Maps,
preference. Google Satellite or Bing Virtua Earth. By now you should be able
to see a map on your screen.

6 7
XYZ Tiles
Another way to do it is to add it manually. Go to XYZ Tiles > New
Connection > Copy-paste the following > Add a layer to the project
and you should be able to see the base map.

Note: For google maps: select zoom level 19 (This zoom level will
allow you to visualize the most amount of data when you zoom in)

Google Maps: https://mt1.google.com/vt/lyrs=r&x={x}&y={y}&z={z}


Google Satellite: https://www.google.cn/maps
vt?lyrs=s@189&gl=cn&x={x}&y={y}&z={z}
Google Satellite Hybrid: https://mt1.google.com/vt/
lyrs=y&x={x}&y={y}&z={z}
Google Terrain: https://mt1.google.com/vt/
lyrs=t&x={x}&y={y}&z={z}
Google Roads: https://mt1.google.com/vt/
lyrs=h&x={x}&y={y}&z={z} 7. ADDING A LAYER

The easiest way to add a layer is to open your folder and drag it
into the screen > Grab the .shp file and add it. You can also go to
Layer > Add Layer > Add Vector Layer > Select the layer you want
to add from your data folder. You can select your preferred layer
format that you want to add.

8 9
Try to add some layers. For example: Cities, UTM, rivers, 9. TOOLS
nightlights, shipping, countries, etc.
Zoom in - zoom out. Just like in Autocad or Rhino.
Zoom to layer. You can click right in the layer and will zoom into
your preferred layer.
Pan. Use the hand for panning.

8. LAYER ORDER

Having the layers in the right order is important to have a


structured mapping project. Just like in Illustrator, you can create
groups with sub-layers to organize your data. To do so click on the 10. BOOKMARKS
second icon “Add group” you can create groups. Organize your
layers according to your preference. To create a bookmark of your preferred view or zoom in, go to
New Spatial Bookmark on the toolbar and create a new view. This
will allow you to save a view of what you have on your screen.
The Bookmark will appear in the browser box under “Spatial
Bookmarks”.

10 11
For example, you can do a zoom into the Caribbean and create Select from the attribute table
a bookmark. You can also edit the scale. Let’s say 1:500000 or From the attribute table you can filter information and select
preferred. specific attributes. For example, Select by country > Belize >
You’ll see selected data in yellow. Remember to click on “Deselect
all features from the layer”

11. ATTRIBUTE TABLES Select features and export


You can select with the mouse or directly in the attribute table.
Each layer has an extensive amount of information. You can see From the selection you can also export and create a new layer.
what’s the information -or attributes- your layer has by pressing Right click > Export as > Save selected features as > ESRI
the right click > Open Attribute Table. You’ll see the full amount of Shapefile, .KML, or cvs, etc. > You have to select a file name and
data that your layer has. also specify the location of your layer in the C: drive. This is useful
if you want to extract data from a large data set or if you want to
This is equivalent to an excel sheet where you have lots of data, export it to other formats.
with different cells on it. The attributes are very valuable as it
contains a lot of information that you can later visualize in many
different ways.

12 13
12. LAYER STYLING 13. RASTER IMAGES

Rasters can also be visualized with different colors > Select Min/
Symbolize data
Max value settings > you’ll find different ways to represent this
Simple symbol You can edit the color, line weights and all features
from min-max to mean/standard deviation > Select your preferred
of your polygons, lines, points and rasters. For example, for points
color ramp and edit your map.
you can change the color, select the type of marker or size.

14. CREATE A LAYOUT


Labels
You can also add a label to display the layer’s information. For To export a map you click on create a layout. Right click on Project
example, city names. Or any other attribute that you want to > Layout Manager > Create a layout > Add a name, for example:
display. Right click on labels > Single labels > Value > Select the Map 1. When you see your layout you can right click on Item
preferred layer. Modify font, size, color, etc. Properties to select the paper size A4, A3, etc.

14 15
Define the scale
When exporting it is important to define the scale in which you
want to export your map. To do so click on edit and click on Move
Content. Go to Item properties on the right side and select your
preferred scale. You can adjust with your mouse the view that you
want to visualize.

Add map
Click on add map and move your mouse to add the map to the
page extent. You will visualize what you are seeing on your screen.
The scale, layers, etc. If you want to export only a few layers you
need to go to your screen and visualize what you want to export.

Lock Layers
Click on Item Properties > Lock Layers and Lock styles for layers to
freeze the content of your map. In this way, any changes you make
won’t be seen in your layout.

Add pages
Like in indesign or a PDF you can add more pages to your layout.
Click on layout > Add pages > Select the number of pages that you
need.

When exporting it is important to define the scale in which you


want to export your map. To do so click on edit and click on Move
Content. Go to Item properties on the right side and select your
preferred scale. You can adjust with your mouse the view that you
want to visualize.

16 17
Add Maps Add Scale and North Arrow
On every page you can add a map and lock layers and styling to Below from the add layer, you’ll find a tool for adding a scale bar
preserve your visualizations. Here it is useful to create a bookmark and north arrow. Select your preferred scale and north and edit
to guarantee that you’ll be exporting data on the same frame. It’s them according to your graphic preferences. In the scale you can
also useful if you are exporting data with different scales. select the units that you want to display. In the north you can also
select your preferred arrow style.

Add Legend 14. EXPORT


Add the legend or the symbology of your map. Click on add legend
and you will see a box where you can add or delete the layers that Export as image. To export your map click on layout and Export as
you want to show. This will be important so that people know how image > Select your preferred mode .jpg, .png, etc. > Select the
to read your map. You can edit the font type, size, etc. > Add only resolution that you want.
show items inside linked map.

18 19
Export as PDF
Similar to exporting an image you can export your maps on a PDF.
It will export all the pages that you have on your layout. See this
link to look at an example. Export > PDF > Export points, lines and
polygons separately. Also, export raster separately. Click in always
export as vectors.

20 21
CLASS 2

22 23
1. START A NEW FILE IN GIS • CSV or spreadsheets: “Many times the GIS data comes in a
table or an Excel spreadsheet. Also, if you have a list of lat/long
coordinates, you can easily import this data in your GIS project.”
• Set up your projection. We will be working with NYC
Source: https://www.qgistutorials.com/en/docs/importing_
Data. Choose: NAD_1983_StatePlane_New_York_Long_
spreadsheets_csv.html
Island+FIPS+3104_Feet
Note: You can find the reference in the metadata file. Always check Add a GDB
in which coordinate the layer was created. Add a layer > Click on Directory > OpenFileGDB > Select the Vector
Database > Add > Create a Group to add all layers.

• Add data from the folder


https://drive.google.com/drive/
folders/1ST9A6SZxO8dchJzboBi7qRhL2v75DJRp?usp=sharing
• Add additional data if you’re interested in any other specific
subject from NYC Open Data portal

2. ADD OTHER FILE FORMATS (GDB - CVS)

Beside shapefiles(.shp) and rasters (.tiff), you can also find other
formats such as a GeodataBase (GDB) or CSV or spreadsheets
(excel).
• GDB: “The file geodatabase format has emerged as a
very common format for storing and exchanging spatial data,
particularly considering that it allows for the storage of multiple
data layers, and that it allows for the storage of data layers that
exceed the limits of other specifications. Users of ArcGIS regularly
use file geodatabases when attribute tables exceed the storage
If you have any question watch this tutorial:
capacity of a shapefile attribute table (an individual DBF file is
https://www.youtube.com/watch?v=cfDzukvpOp8
limited to ~2GB in size).”
Source: https://gis.ucla.edu/node/53

24 25
Add a CVS Layer Styling
Data Source Manager > Click on Delimited Text Option > File Go to Layer Styling panel > Select the trees layer > Edit single
format CSV > Find your csv file Go to Geometry Definition > Select symbol > Edit color, stroke, etc.
Point coordinates > Go to Geometry CRS and select the CRS (Use
the one from NYC) > Add layer. Do the same with “nybb” new york borough boundaries > Edit
Voila! You should see the dots in the map. lines > Fill color, etc.

Note: * Don’t drag the CSV, you won’t see anything.* I also suggest creating a Bookmark to freeze the view.
If you have any question watch this tutorial:
https://www.youtube.com/watch?v=eoZUZuivfMk

26 27
VISUALIZING DATA (POLYGONS) 2. NUMERICAL DATA

1. CATEGORICAL DATA Graduated is another way to visualize the attribute’s table data. It
serves to visualize differences in numeric data.
Categorized serves to visualize data broken into categories for
example, male, female, age, etc. This is not numerical data but
categories as its name says. You can visualize the different
attributes of your layer on a color ramp.
Example 1. Select layer NYC Stormwater Flood Map > Layer Styling
> Categorized > Value: Flooding category > Color ramp > Click
on Classify, if not you won;t be able to see the data .You’ll see a
gradient of colors depending on the attribute table’s data. Choose
your preferred gradient or edit the colors and create your own
style.

NYC Stormwater Flood Map

10 classes 05 classes

Data classification
QGIS has 6 different methods in which you can visualize vector
map data statistically. These methods use different statistical
algorithms to break down the data into separate classes. This
affects the interpretation of the map.

Age in Manhattan and Brooklyn IMPORTANT! You need to analyze


your data and what you want to show
to select your classification method.

1. Equal count (quantile): the range is then divided by the number


of classes. It adds the same number of records in each class. For
example, if you have 30 counties and 6 data classes, you’ll have
5 counties in each class. This is typically used by staticians or
cartographers to visualize “quintiles”.

28 29
2. Equal interval: divides the classes into equal groups. This
method will create classes which are at the same size.

30 31
3. Logarithmic scale: “Is a way of displaying numerical data over a
very wide range of values in a compact way—typically the largest
numbers in the data are hundreds or even thousands of times
larger than the smallest numbers.” The method is designed to
optimize the arrangement of a set of values into ‘natural’ classes.

See examples in the following images:

5. Pretty breaks: ​​This is complex, but in synthesis: it is based on


the statistical package R’s pretty algorithm. The pretty in the name
means it creates class boundaries that are round numbers.

4. Natural breaks (jenks): “This is designed to optimize the


arrangement of a set of values into “natural” classes. A Natural
class is the most optimal class range found “naturally” in a data
set. It minimizes differences between data values in the same
class and maximizes the differences between classes.”
In other words, it divides the data into classes where it looks like
it’s a natural break.

6. Standard deviations: This method will calculate the mean of


the data, and create classes based on standard deviation from the
mean. Gives an indication of how closely the values are clustered
around the mean. The smaller the standard deviation, the closer
values tend to be to the mean.

32 33
For visualizing points you can apply two visualization techniques:
Right click on method and you’ll see:
• Color: with a gradient of color
• Size: will categorize the symbols according to their size

VISUALIZING DATA (POINTS)

Categorized
Categorizing points work very similar to shapefiles. Add layer
Manhattan trees > Click on Categorized > Value NTA Name > Color
ramp > And you’ll see the points in different colors depending on
their neighborhood.

34 35
Heatmap
Visualize a point dataset as a heatmap image. You can visualize the
concentration of points in your map.
Layer styling > Heatmap > Select your preferred color ramp >
Modify the radius according to your layer. You can also adjust
the rendering quality. You can also modify the layer rendering
parameters by selecting blending mode: multiply, overlay, etc. Just
Save a layer with the right projection
like in photoshop.
It’s important to save our laters with the right projection. This will
avoid having future problems performing any process from the
Toolbox. It’s very easy, you only need to right click on your layer >
Export > Save features as > Select the name of the file name and
it’s location > Select the CRS projection you want to > Click OK >
You’ll have a new layer that has already the desired projection.

Select by location
Go to Vector > Research tools > Select by location > Select layer
you want to select from (trees) > Where the features “are within”
> Select layer from > Manhattan > Run > After the selection pops
up go to right click > Export > Save selected features as > and save
your file. You can edit the layers of your selection as you want.
Count points in polygons
Similarly, you can select all trees that are within parks. This can Now we’re going to create a map from two layers “trees” and
give you a ratio of all trees in NYC streets vs trees in parks. NTA’s. We’re going to use the Processing Toolbox > Type “count
A common use for selection is with buffers. For example, if you points” > Select count points in polygon > Select your Polygons
are interested in identifying the areas within 10 minutes walking (NTA layer) > Then select the points (Trees) > Click run (It will take
distance from a hospital. You can create a buffer of 800 meters a while) >
around hospitals. Then select all buildings that intersect/or are
within that buffer.

36 37
Extra tutorial: Georeferencing Census Data

Download data from the US Census Bureau


Go to www.data.census.gov > Explore Census Data > Advanced
Search >

Note: See this link to learn more about the Margin of Error Column.

Identify the GEO_ID


The GEO_ID is the most important part of this, because we need it
in order to geographically locate it.
If you see an ID but with more numbers, you just need to trim it.

Trim the GEO ID


To trim the GEOID from the other table type: right(select cell, 11)
eleven is the amount of numbers which you want to get rid of >
Double click on it and then expand it to all cells. > Save file > This
cell GEO_ID will be used to join it with the .shp

• Geography > Select the geography you want. It can be tract,


county, blocks > Select your preferred geographies.
• Surveys > American Community Survey (5 year estimates) or
Decennial Census (every 10 years), etc
• Topics > Select your preferred topic > Race and Ethnicity,
Populations and People, Housing, etc. Add a numeric value to the cells
Click on search > Download the preferred data set. You need to verify that you have a numeric value on the cells so
that QGIS will graphically show this. The easiest way is to use
Microsoft Access and change it here.

38 39
Under Fields > Format you should find a short list to modify the Here’s another tutorial on how to do this: https://www.
column attribute. qgistutorials.com/en/docs/performing_table_joins.html
Another work-around is to specify the field types while in Excel,
and then save as an xlsx file. When you import the .xlsx file to This is another one: https://www.youtube.com/
QGIS, your field types will be maintained. This does not work if you watch?v=e6XWIDKWHMM
specify the field types in Excel and then save as CSV.

https://gis.stackexchange.com/questions/298777/qgis-3-2-
forcing-column-type-when-importing-csv

Another workaround using csvt:


https://bnhr.xyz/2018/08/07/specifying-csv-data-types-using-a-
csvt-file.html

Join a CSV to a .SHP


Sometimes .csv files are not geolocated. But you could add a
spatial reference to .csv and have that data georeferenced on a
map. This is especially useful for census data or any type of data
which you can add a spatial reference to.

QGIS
Add the layer nyct2020.shp > Open attribute table > Look at the
GEOID file > This is your geolocation.
Now add your .csv file to layers > Locate it right below the file you
want to join it with.
Go to your layer > Right click on properties > Join > Click on + >
Select the file which you want to join > Join fields Geo ID with Geo
ID > ready!

Save this as a shapefile so that the attribute table is part of the


shapefile. If you don’t save you won’t be able to see this.

40 41
CLASS 3

42 43
Digital Elevation Models Source: JBA Risk Management
• What is a Digital Elevation Model or DEM? Learn more about DEM resolution in this link

“A Digital Elevation Model (DEM) is a representation of the bare LIDAR


ground (bare earth) topographic surface of the Earth excluding • What is a lidar?
trees, buildings, and any other surface objects. “Light Detection and Ranging (lidar) is a technology used to
DEMs are created from a variety of sources. USGS DEMs used to be create high-resolution models of ground elevation with a vertical
derived primarily from topographic maps.” Source: USGS accuracy of 10 centimeters (4 inches). Lidar equipment, which
includes a laser scanner, a Global Positioning System (GPS), and
Spatial Resolution an Inertial Navigation System (INS), is typically mounted on a
“The spatial resolution of a DEM refers to the area of land being small aircraft. The laser scanner transmits brief pulses of light to
represented by a single grid cell. So, a spatial resolution of 10 the ground surface. Those pulses are reflected or scattered back
meters means one grid cell is representing a 10 x 10 meter area and their travel time is used to calculate the distance between the
of physical land. Low (or coarse) resolution and high (or fine) laser scanner and the ground.
resolution are relative terms.” Lidar data is initially collected as a “point cloud” of
individual points reflected from everything on the surface,
Figure 1: Example of higher (left) to lower (right) spatial resolution including structures and vegetation. To produce a “bare earth”
representing the same land area polygon. Digital Elevation Model (DEM), structures and vegetation
are stripped away. ”
Source: USGS

• What is the difference between lidar data and a digital elevation


model (DEM)?

• Light detection and ranging (lidar) data are collected from


aircraft using sensors that detect the reflections of a pulsed laser
beam. The reflections are recorded as millions of individual points,
collectively called a “point cloud,” that represent the 3D positions
of objects on the surface including buildings, vegetation, and the
ground. Source: USGS

Figure 3. Lidar point clouds (left) - DEM (right)

44 45
Here are some data sources to download DEM’s 2. ADD LAYER
NYC: a. Folder NYC_DEM_1ft_Int
• https://gis.ny.gov/elevation/NYS-High-Res-DEM.html b. Add .tif file (Raster)
• https://apps.nationalmap.gov/downloader/ c. Add the NYC Boroughs for reference (Shapefile)
• https://data.cityofnewyork.us/City-Government/1-foot-Digital-
Elevation-Model-DEM-/dpc8-z3jc

Global data:
• https://www.eorc.jaxa.jp/ALOS/en/index_e.htm

Tutorial

1. START A NEW FILE IN GIS

Set up your projection. We will be working with NYC Data.


Choose: NAD_1983_2011_StatePlane_New_York_Long_Island_
FIPS_3104: ESRI 103116
Note: Better to use this one, as the one that says “feet” last class
gave us problems with some layers.
Layer properties
You can look at the properties of the file if you right click and go to
information.
If you go to Layer > Properties > Information > Coordinate
Reference System (CRS) > You’ll see that it was created with
NAD83 projection and feet units.

46 47
3. RENDER Singlebband pseudocolor (Colors)
a. Continuous
To visualize or renderize a DEM you can do the following options:

Singlebband Gray (Black and white)

If you click on Mode: Equal Interval or Quantile you can add


classes. Remember you’re visualizing altitude 0: black would be
the lowest point, meanwhile 411 would be the highest. Note: If
you want to remember what’s Equal Interval or Quantile go to
1. For contrast enhancement the default is “Stretch to MinMax” Tutorial 2.
which means that the grayscale will run from the minimum
and maximum values. If you don’t want to use the default b. Equal Interval Visualization (5 Classes: You can use your
contrast you can click on Min/Max Value Settings and you’ll preferred number of classes)
find the following options:
2. User defined: it’s a manual selection of values.
3. Cumulative count cut: “this is useful when you have few
extreme low or high values. It cuts the 2% (or the value you
choose) of these values” .
4. Min/max: the real minimum and maximum values of the raster.
5. Mean +/- standard deviation: values will be calculated
according to the mean value and the standard deviation.

Try the different settings and see how the DEM changes.

48 49
c. Quantile Visualization (5 classes: you can use your preferred Preset Shading Parameters (Altitude 30, Azimuth 45, Z Factor 2
number of classes)

Hillshade Preset Shading Parameters (Altitude 30, Azimuth 45, Z Factor 2


“Hillshading is a technique for visualizing terrain determined by a
light source and the slope and aspect of the elevation surface. It is
a qualitative method for visualizing topography and does not give
absolute elevation values.’ Source: ArcGIS Pro

Options
You can set the parameters as you prefer. See below.
Band: The raster band to use
Altitude: The elevation angle of the light source (default is 45°)
Azimuth: The azimuth of the light source (default is 315°)
Z Factor: Scaling factor for the values of the raster band (default is
1)
Multidirectional: Specify if multidirectional hill shadinghillshading
is to be used (default is off)

Preset Shading Parameters (Altitude 45, Azimuth 315, Z Factor


1)

50 51
CONTOURS 4. CLIPPING A RASTER
It will draw contours using the raster’s altitude data.
Sometimes rasters are huge and you’ll need to crop them. For
Options: doing this you will need to:
Input band: raster band to use a. Select polygon to crop from > Go to Select Features (Arrow)
Contour interval: distance between two consecutive lines (10 and select Manhattan and the Bronx. If you click on shift you can
feet, 50 feet, etc) select more than 1 feature.
Contour symbol: the symbol to apply to the common contour lines b. Right click on the layer > Export > Save selected features as >
(You can change symbols and colors here) Remember to:
Index contour interval: the distance between two consecutive • Format (ESRI Shapefile)
index contours, that is the lines shown in a distinctive manner for • File name (select the name of your file and its location)
ease of identification, being commonly printed more heavily than • CRS: (select defined projection)
other contour lines and generally labeled with a value along its c. A new Shapefile was created from your previous selection.
course.
Index contour symbol: the symbol to apply to the index contour
lines (You can change symbols and colors here)
Input downscaling: Indicates by how much the renderer will scale
down the request to the data provider (default is 4.0).

Resampling: cubic
To better visualize the raster either in hillshade or in contours it is
recommended to add specify cubic into the resampling options.

At the end remember to click on deselect features from all layers.

Now that you have exported this layer, we’ll use it to create a clip.

CLIP RASTER
Click on raster > Extraction > There are two options to do this
1. Clip raster by extent: give us a rectangular layout

For more information about rasters look at this source: QGIS

52 53
Within the parameters you’ll find: Save your temporary file!
Input layer: Select the raster to crop Remember to save your temporary file by right click on your layer
Clipping extent: there are few options to do this: > Export > Save layer as >
Within the parameters you will find:
1. Calculate from layer: you can choose a layer and use it as a
reference for clipping. Format: GeoTIFF (format in which you want to save your file)
2. Calculate from layout map: use a layout as reference. File name: Select the folder and name of your file
3. Calculate from bookmart: use a bookmark as reference. CRS: Very important to select the projection you want to use
4. Use current map canvas extent: Zoom into your window and and
click in the area you want to clip.
5. Draw on map canvas: draw a rectangle from the area you want
to clip.

Advanced parameters
Clipped (extent) Note: You can also look at this tutorial if you have any questions
1. Save as temporary file: I suggest doing this, because it runs about the different ways to clip a raster.
faster, but you need to be sure to save your file later.
2. Select the location and name of the file you want to save. Clip raster by mask layer
After running this you should see a square clipped out of the Second option is to clip the raster by mask layer.
original raster, like the following image: Click on raster > Extraction > Clip Raster by Mask Layer

Clip> Use current map canvas extent

Within the parameters you’ll find:

Input layer: choose your raster


Mask layer: the previous selected layer or the layer you want to
use for clipping
Source CRS: select the projection you want to use
Target CRS: select the projection you want to use

54 55
Clip with rectangle

Assign a specified no data value to output bands (optional) >


Sometimes you need to add this to avoid an error.
-999999.0000

Notes:
• The previous step (assign a specified no data value to output
bands) is useful because clips are rectangular and when you have
different shapes, the QGIS could give you an error. Verify your coordinates
• If there’s an error the most common mistake is the coordinate Once your layer is exported it is important to verify the coordinate
system. Always check it out first. system and the units. This is important as you will need a raster
• If there’s an error you can try to click on create an output alpha with the right coordinates and also the right units. Right click on
band. Sometimes it works. your layer > Properties > Information > CRS.
• Your computer could take a while to process, so be patient! If your layer is not in the right CRS or units, you’ll need to
• Once the file was created remember to save your shapefile > reproject your raster. See below if you need to do so.
Click on layer > Export > Save as.

Clip with Manhattan and Bronx

See this tutorial if you have questions


If you want to learn more In this link you can find more information
and options on how to clip data

56 57
5. CREATING CONTOURS Contours every 25 m (3D)

Extract contours
To extract contours from the DEM you click on Raster > Extraction
> Contour > Within the parameters you’ll find:

Input layer: select the dem that you want to work with Visualize color ramp in contours
Band number: Band 1 (use default) The new contour file that is created from the DEM will give you a
Interval between contour lines: 10, 20, etc (This is the value layer you can visualize the contour lines by color. This could be a
that you want to use. Note that the units of the DEM are in feet, so nice way to visualize your contour lines or topolines.
you’ll get contours every 10 feet, 20 feet, etc.)
Note: You can visualize this with Graduated Colors (creating
Advanced parameters: Contours > Save to temporary file (Save classes) or just with Categorized. Select ELEV for value in order to
your file name and location) do this.

Contours in 3D
If you want your contours to be 3D, be sure that when you Contours every 5 ft using graduated colors with 5 classes
exported your contours you clicked on Advanced Parameters >
Produce 3D vector

58 59
DUPLICATE LAYER Overlay effect on google earth + previous multiply effects

You can duplicate the layer to create a cool representation style.


Right click on your layer > Duplicate layer

6. MULTIPLY AND OVERLAY


Overlay effect on google earth + hillshade
MULTIPLY EFFECT
Just like in photoshop with rasters and shapes you can use the
multiply effect. This will give more texture to your hillshade and
you can combine this with the contour styles. Click on the layer >
Layer styling panel > See options for Layer Rendering and select
Blending Mode > Multiply.
You will find other options which you can also try and see how the
visualization changes.

Multiply effects on DEM + Hillsshade on the background +


grayscale graduated colors on the contours

Note: This one will give some topo texture to your map.

60 61
7. SIMPLE AND MULTIPLE RING BUFFERS 500 meter from subway stations without dissolve

Buffers
“Buffers are a tool used to define areas at specified distances from
an object or set of objects in an environment. In GIS, buffers are
ideal for analyses that involve distance constraints.” Source

To do a buffer select the layer (points of polygons) > Vector >


Geoprocessing toolbox > Buffer

In the parameter you’ll see:


Input layer: the layer you want to use for the buffer
500 meter from subway stations with dissolve
Distance: the distance you want to use. Let’s say 500 meters. Here
it is very important that you see the units that you’re using. Feet,
km, etc. If you have a different unit system such as degrees, you’ll
need to reproject the layer in a feet or meters CRS.
Dissolve result: If you click here the buffers will be merged,
whereas if you don’t dissolve them your buffer circles will be
separated. See examples below.

62 63
MULTI RING BUFFER Layer to be buffered: select the layer you want
Dissolve features before buffering: click on dissolve if you want
You can create multiple buffers, but before you’ll probably need to to merge the rings
install a plug in. Buffer distance: select the distance (for example 500)
Got to Plugins > Manage and install plugins > Search for multi ring Number of rings: the desired number of rings (for example 3)
buffer > Click on install plug in.
Multi ring buffer from subway stations represented in categories

Remember to save this layer > Export > Save feature as > Save
your file.
See this tutorial for more information.
For more Geoprocessing tools see this link

8. HYDROLOGY
Now you go to Vector > Multi Ring Buffer
A. Fill sink
Before running a hydrological analysis you need to clean up your
DEM, to remove depressions or “sinks” from the DEM. This will
avoid further problems. See image below.

More information in this link

64 65
Click on the Toolbox > Search SAGA > Terrain Analysis > Fill sinks 1. Fillsinks (Wang & Liu) - NY LIDAR 1FT
(wang & liu) Looks like a regular DEM but actually it has already been
You can also just type: Fill sinks wang liu reprocessed

2. Watersheds (Wang & Liu) - NY LIDAR 1FT


In the parameters you will find:
DEM: Select the layer you want to analyze
Filled DEM: Save layer > Fill
Flow directions: Save layer > Flowdir
Watershed basins: Save layer > Watershed

Click on run > This will take a while > See below the results

Once the layers have been processed you’ll see the following 3
images and files:

a. Fillsinks
b. Flow direction
c. Watersheds 3. Flow direction (Wang & Liu) - NY LIDAR 1FT
You can visualize as Singleband pseudocolor it with 7 classes and
also set up MIN: 0 and MAX: 7
Each color represents a direction (North, Northeast, etc).

66 67
Watersheds - Upper NY

For more on fill sinks see this tutorial.

Fill sink - Upper NYC

Flow direction - Upper NY

68 69
B. Strahler order Strahler order - UPPER NY
After this you’ll run strahler order. You can just type “strahler
order” in the toolbox and you’ll find it.

In the parameters you’ll find:


Elevation: Add Fill sinks (This should always be the input)
Strahler order: Save as > Strahler
Run > It will take a while to process

For more information on Strahler see this tutorial

Strahler order - NY LIDAR 1FT C. Channel network and drainage basin

For this next step You can just type “channel network and drainage
basin ” in the toolbox and you’ll find it.
You can understand this as a vectorized file of the Strahler.

In the parameters you’ll find:

Elevation: Fill sinks


Threshold: 5 < This number depends on the terrain (This will clip
the values of your DEM)
Flow direction: Save > Flow directionTR5
Flow connectivity: Un check (no worries)
Strahler order: Un check (no worries)
Drainage basins: Save > Basins TR5
Channels: Save > ChannelsTR5
Drainage basins: Save > Basins TR5 (It appears twice, it’s ok)
Junctions: Save > Junctions TR5 (If your threshold is small it will
Select Singleband pseudocolor create many points and it will be a super heavy file)
Min: 1 and Max: 10
Select equal interval and specify 11 classes From here you’ll get the following files:
The darker line closer to 10 will be the most defined runoff

70 71
Flow direction - NY LIDAR 1FT Basin (Polygons) - NY LIDAR 1FT

Channel - NY LIDAR 1FT


You can visualize it with Graduated > Value > Order > Size > select
a range to see the difference > Equal quantile > 11 classes
Basin (Raster) - NY LIDAR 1FT

72 73
Junctions - NY LIDAR 1FT
Points are the intersections of streams Zoom in> Graduated > Size> 11 classes - NY LIDAR 1FT

If you combine them it’s easier to read. See image.

Graduated > Value: Order > Size > .1 TO .8 - NY LIDAR 1FT


Graduated > Method: Color - NY LIDAR 1FT

74 75
Contrast with aerial image - NY LIDAR 1FT Channel - Upper NY

Flow direction - Upper NY Basin (Polygons) - Upper NY

76 77
Basin (Raster) - Upper NY Combined - Upper NY (Basins and channels)

Junctions - Upper NY Combined- Upper NY (DEM AND channels)

78 79
Combined - Upper NY (Aerial and channels) Flow accumulation - UpperNY

For more information on Channel and Drainage Basins see this tutorial For more information on Hydrological Analysis see this link

D. Flow accumulation 9. ADDITIONAL TOOLS


A. Raster analysis: Aspect
You can just type “Flow Accumulation” in the toolbox and you’ll Aspect is useful to analyze a DEM and see the orientation of the
find it > Select Flow accumulation (qm of esp) slope: North, East, West, etc.
You can run this analysis by clicking on Raster > Analysis > Aspect
In the parameters you’ll find:

DEM: Fill sinks


Preprocessing: Fill sinks permanently
Fill increment: Default
Flow accumulation: Save file > Flowacc

Click on Run > It will take a while

Flow accumulation - NY LIDAR 1FT


Note: This image is missing because it’s too heavy for my
computer to process. Please try by your own with the NY DEM and
see what you get.

80 81
In the parameters you’ll find: Input layer: layer that you want to reproject
Input layer: Select the raster file DEM Source CRS: original projection that your layer have
Band number: Band 1 (Gray) Default Target CRS: the projection you want your layer to have
Aspect: Save file
C. Merge rasters
Visualization singleband pseudocolor
Sometimes your rasters come in separate files so you’ll need to
For visualizing this select Singleband pseudocolor > Equal interval
merge them into one. To do this go to:
> Classes 7
Raster > Miscellaneous > Merge
You’re choosing 7 classes because each of 7 cardinal points.
North(1), Northeast(2), East, Southeast(3), South(4),
Southwest(5), West(6), Northwest (7)
So by visualizing the colors you’ll see the orientation of your slope.

Slope orientation in 7 categories

Input layers: Click and select the rasters that you want to merge.
Output data type: Float 32 (This is usually a good parameter to
use)
Merged: Save your file > Run > the result will be your merged
raster

For more information on Hydrological Analysis see this link


B. Re-project raster
When working with rasters, some of the common errors are also
the projections. If you need to reproject a raster you can go to
Raster > Projections > Warp (Reproject). Within the parameters
you’ll find:

For more information look at this tutorial

82 83
D. Create a polygon E. Draw circles, rectangles, etc...
To draw circles, rectangles and more you do the same but you will
Draw a polygon (any shape you want) click on the Shape Digitizing Toolbar and draw the shape that you
You can also create or draw a polygon and use that for clipping or want.
use it for your project. To do this you will:
Click in layer > Create layer > New shapefile layer > Within the Go to your layer > Click on edit > And now you can add a new
parameters you’ll find: polygon > and draw your shape file > select a circle or square > Do
you want to save the changes to your layer: YES.
File name: name your file
File encoding: UTF-8 (use the default option) If you don’t see the Shape Digitizing Toolbar just do right click on
Geometry type: Polygon (you can select other features if you want edit and look for it at the menu. You can also turn on the Advanced
to draw a point or other type of geometry) Digitizing Panel to where you can also edit coordinates.

Click ok > A new layer will be created > Click on edit > And now
you can add a new polygon > and draw your shape file > remember
to click again on edit > Do you want to save the changes to your
layer: YES. When you draw you will be manually selecting the
shape of the polygon that you want.
Toggle Add polygon feature

See this tutorial if you have any questions

84 85
F. Dissolve Input layers: Select the layers you want to dissolve
When you use dissolve everything is merged by a common field Dissolve fields: Select the fields you want to dissolve. It can be
and it works on a single layer. For example: only one or all of them.
Dissolved: Save layer

You will also dissolve values in the attribute table, which is useful
to simplify large datasets.
See this link to learn more or also this one.

Find the geoprocessing toolbox. This toolbox can be found in two


ways:
1. Click on vector > Geoprocessing toolbox Basin (Polygons) - Upper NY

2. Click on View > Panels > Processing Toolbox

G. Isochrones
You can also calculate isochrones by installing a plugin called
QNEAT3.
Look at this tutorial to learn how to do it.

86 87
10. 3D MODELING Open Grasshopper
Open grasshopper and open the file TJOA_Terrain_Mesh.gh
Export to Rhino/Autocad
Select your layer > Export > Save features as > Autocad DXF > File
name > Save
Note: It is important to know the units of your CRS (feet or
meters).

In Grasshopper you go to Contour Curves > Right click > Set


multiple curves > Select the curves > Click enter

Rhino
Now you can open your file in Rhino or Autocad.
When you open your file it will ask you for the Model Units: Add
the units in which your DEM and contour lines were exported
(meters, feet, etc)

Now go to the Resulting Mesh Topography Box > Right Click on


Del > Click on Bake > Attributes > Select Layer > Mesh > Click ok >
Now you can close grasshopper

88 89
3D mesh Photoshop image edit
Export images from qgis as jpegs by creating a layout and
exporting them.
Then open the jpegs in photoshop and trim the clip (in this case
the red square) so that the proportion is the same. For example:
DEM Flow accumulation

3D mesh - Render

Google earth image Channels and basin

To make it easier you can save an action so that every image is


trimmed exactly the same way:

Exaggerate your mesh


Sometimes your mesh looks very flat and it could look better if
it’s exaggerated. To do this you can select your mesh > click the
command Scale 1D > Select a point > Add the number of times
that you want to exaggerate > 1.5, 2, 3, etc. > Go up > Click and
you’ll have an exaggerated model.

Note: If you exaggerate your model be aware how many times


you’re doing this and also just use this for representation
purposes. This terrain will only serve as a base diagram, it is not an
accurate expression of your real topography.

90 91
Now you’ll have your images fitted to the proportion of your clip. Select the DEM.jpeg >
For example:

Render Google Earth image as texture


Now you can use this image and render it as a texture.

Select the square and match the image proportions to the clip >
Enter

See this tutorial if you don’t know how to do texture mapping


Height field command Height field Properties
This is a super easy way to do a terrain mesh, but the resolution Number of sample points: (100 x 100, select the amount of points
can be very low. Perhaps is more useful for diagrams. > Import that you want your mesh to have. The more you add the better
your Clip to rhino > type heightfield > resolution it will have, but also your file will be heavier)
Height: 508 > Here you should insert the value specified on your
DEM in QGIS > Look at the values in Min and Max properties
Create object by: Mesh or surface, you can select to create a mesh
or a surface. Choose your preferred geometry.

92 93
Max value in QGIS is the height you’ll add in Rhino Exaggerated model > 10X
If needed you can exaggerate your mesh

Mesh from height field


Add texture and also import other layers from QGIS and project
them

94 95
96

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy