Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QGIS Freestyle - 27 August 2021 #1

Open
timlinux opened this issue Aug 27, 2021 · 13 comments
Open

QGIS Freestyle - 27 August 2021 #1

timlinux opened this issue Aug 27, 2021 · 13 comments

Comments

@timlinux
Copy link
Owner

timlinux commented Aug 27, 2021

Welcome to our first QGIS Freestyle Session!

QGIS Freestyle

Watch the session YouTube recording by clicking the image above.

Here is the dataset we will be using for this Freesyle Session.

qod-dem.zip

To contribute, follow the rules on the README.

For this freestyle session, we used procedurally generated DEM using this module (python 3) or this module (python 2) using a command like this:

python3 dem_generator.py --width 2000 --height 2000 --waterratio 0.3 --island --preset mountainous_island qod-dem.tif
@lieti
Copy link

lieti commented Aug 27, 2021

QGIS_DEM

geotiff for download in JTSK (EPSG: 5514)

Recipie:
Relief Visualisation Toolbox standalone windows version or QGIS plugin

Layers (from top to bottom):

  • SVF R10 (singleband gray, min 0.7, max 1.0 - Multiply, transparency 40%)
  • SVF R10px (singleband gray, min 0.7, max 1.0 - Darken, transparency 40%)
  • Slope (Singleband pseudocolor, from 0 #b62700 to 50 #b62700, Multiply, 75% transparency)
  • Local Dominance 3-10px (Singleband pseudocolor, from 0.3 #009ea2, 0 #8a8a8a, to 1.7 #feffac, Multiply, 50% transparency)
  • SLRM 10 px (Singleband pseudocolor, from -1 #1f78b4, 0 #8a8a8a, to 1 #feffac, Normal)

@zacharlie
Copy link

For those wanting to use the script ☝️ to produce new dems, you'll need gdal/numpy in your python environment. On windows you can use conda:

conda config --add channels conda-forge
conda create --name demgenerator -c conda-forge gdal

Then activate the environment before you generate the dem

conda activate demgenerator
python dem_generator.py --width 2000 --height 2000 --waterratio 0.3 --island --preset mountainous_island qod-dem.tif

@spatialthoughts
Copy link

Here's my submission. A 3D visualization of Optimal Routes on the DEM between Random Points

The workflow used was

  • Create Hillshade
  • Style DEM using Paletted Raster renderer.
  • Use Multiply Blend Mode for blending the hillshade and dem
  • Scaled the DEM to 1-100 using Rescale raster algorithm
  • Extracted a mask with values >0 using Raster Calculator and converted to Vector using Polygonize algorithm.
  • Generated 1 random source point and 10 random points using Random Points in Polygon algorithms
  • Used Least Cost Path plugin to generate optimal paths
  • Used Qgis2ThreeJs plugin to create a 3D styled map and exported it.

freestyle

@luisalucchese
Copy link

Thank you to all the presenters for this great session!
This is the map I created during the session:
map_qgis_freestyle
Step by step:

  • Assigned an UTM projection to the DEM
  • Resampled the DEM to 10m
  • Filled sinks
  • Calculated Flow Accumulation using SAGA GIS in QGIS
  • Calculated the log of Flow Accumulation and styled it
  • Styled the DEM
  • Topped it with a DEM multidirectional hillshade
  • Used Blending Mode Multiply (thank you for showing this!)
  • Calculated Countour lines
  • Subtracted the contour polygon from the extent of the DEM and styled it in blue

@timlinux
Copy link
Owner Author

Mine is not so beautiful but I tried to show a number of different techniques in QGIS including:

  • symbol layers
  • drag and drop forms
  • default values
  • rule based renderer
  • inverted polygon renderer
  • shapeburst fill
  • a trick to make a low overhead hillshade by pre-rendering it
  • making curved labels for e.g. the ocean
  • and more!

I made the shade even smaller by turning it to a byte tiff and applying lots of compression:

gdal_translate -a_nodata 0.0 -ot Byte -of GTiff -co COMPRESS=DEFLATE -co PREDICTOR=2 -co ZLEVEL=9 /home/timlinux/gisdata/QGIS-Freestyle/qod-shade.tif qod-shade-byte.tif

image

I am attaching my project here (sorry the data organisation is a bit messy!)

QGIS-Freestyle.zip

@raymondnijssen
Copy link

image

@jvdkwast
Copy link

jvdkwast commented Aug 27, 2021

A map from the session created using PCRaster in QGIS:
strahler

Streams with Strahler order derived from the DEM. Workflow:

  1. Convert DEM to PCRaster format
  2. Create local drain direction with lddcreate tool
  3. Calculate Strahler orders using the streamorder tool
  4. Apply a threshold for rivers.

See also this video on hydrological analysis with PCRaster in QGIS
More about PCRaster in QGIS

@dusanzivkovic
Copy link

Just an imaginary map with dummy placenames. I also added a slope layer to add a bit of drama.

QGISFreestyle

@zacharlie
Copy link

image

Disclaimer: My PC crashed and I went and had dinner before rebuilding this map, so I cheated and likely wouldn't have finished within the time constraints of the session (my 3d view also crashed a few times tbh) 😝

Workflow
  • Change CRS to mollweide because geoprocessing 1500X1500 pixels in 4326 is just - no...
  • Reclassify raster to discrete values between <=0 and >=0 to get a "shoreline" raster
  • Polygonize to get shoreline as vector
  • Use "smooth" on the shoreline to get it less ugly
  • Use inverted polygon + shapeburst to make a nice looking coastline with shading
  • Digitize a big bounding area and use the difference tool to get an inverted "ocean area" to use as a backdrop
  • Then I styled the dem (2 layers - one with hilshade and one with pseudocolor. The hillshade had transparency, then the contrast moved to 50 and the blend mode set to burn to get more drama)
  • Next, I duplicated and used a layer filter on the main island to limit geoprocessing bounds
  • Clip the dem to the "island area" for analysis
  • Use the GRASS stream delineation, and r.to.v to generate some drainage lines
  • Convert the shoreline to lines, extend the stream lines for 15m to ensure they intersect the shoreline, then run line intersections to mark out estuaries. Then I manually selected one to be the port
  • next it's time to get trees: generate random points in polygons within the main AOI (I made 12000!)
  • Ran a kernel density (hotspot) analysis and got a raster with dense tree areas
  • Resampled the density raster to 0/1 where values were > 5 and polygonized for making "forest" polygons
  • The forests were from a density raster, so pretty round in shape. I changed the styling a bit using a geometry generator and the expression buffer(smooth(simplify($geometry,tolerance:=4),8,0.4),4) to get it more "boundary-ish-ish"
  • Make a pixel size attribute between 8 and 18 on the trees layer by using the field calculator and rand(12,18)
  • use a tree svg style (you can now search for svgs by name!) and set the symbol size by the pixels attribute
  • Add a style attribute with rand(1,3)
  • Use select * from trees limit 300 in a virtual layers to limit the amount of trees, because in hindsight, 12000 was a ridiculous amount, especially for 3d
  • I downloaded this tree model: https://www.thingiverse.com/thing:279864 it was in openscad so I exported an STL. Then I used a rule based render for 3d symbols and the realistic (phong) shader to give the trees different colours based on the style attribute

Bonus shot of how nicely QGIS cleaned up the geometries that were derived from raster data:

qgis_cleanups

@esnyder-rve
Copy link

Here's mine using contour polygons, visible sky, hillshade, 1m contours, all with blending modes galore. I did "move" the shoreline up a little for more bathymetric stuff.

Workflow:

  • Set projection to EPSG:3857, then export
  • Generate Hillshade
  • Generate Sky-View Factor (with SAGA Next Gen plugin, keeping all the outputs, but using the Visible Sky layer)
  • Generate 1m contours
  • Use Klas Karlsson's Ink Line style for the polygon contour edges

Layer Stack:

  • Contours (Multiply)
  • Hillshade [#727272 -> #ffffff] (Multiply)
  • Visible Sky [Black -> White] (Soft Light)
  • Polygon Contours

QGIS Freestyle

@raymondnijssen
Copy link

Screenshot from 2021-08-30 10-54-34

@raymondnijssen
Copy link

image

@timlinux
Copy link
Owner Author

Here's mine using contour polygons, visible sky, hillshade, 1m contours, all with blending modes galore. I did "move" the shoreline up a little for more bathymetric stuff.

Congratulations @esnyder-rve , looks like you are the winner! Please contact me offline at [email protected] with your postal address and I will send you your QGIS mug!

Regards

Tim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants