Topographic maps from DEMs in QGIS

For all high tech electronic equipment including GPS, PLB, chargers, phones, computers, software. Discussion of simple electrical devices such as torches, belongs in the main 'Equipment' forum.

Topographic maps from DEMs in QGIS

Postby tom_brennan » Wed 17 Feb, 2021 7:50 pm

This is a fork of the thread Route-planning principles for off-track routes off ridges, which got into a technical discussion of how to use and process DEMs (digital elevation models) in the open source GIS application QGIS. It seemed more sensible to have that discussion in the Techno-Babble

mandragara wrote:I'm able to merge the areas of interest into a virtual raster and then process that as a big chunk in QGIS, but there's a file limit so I can't process a ton. I can use a command to merge them all as a TIFF but the output is much larger than the .asc files that go into making it. A TIFF that covers all of the Greater Blue Mountains would be 11 terabytes or so. I'm investigating if there's a way of merging the raw .asc files.


Go the other way. I have hierarchies of virtual rasters, and then I just process the area of interest.

I have a virtual raster (of virtual rasters, of 2x2km GeoTIFFs) which stretches from south of Ulladulla to north of Maitland, and west to the edge of the Blue Mountains. All up there are around 10000 files and 90GB.

I will progressively write up how to put one of these together and how to use it - but the core information is already up:
https://maps.ozultimate.com/wiki/nsw_dems

You can then use PyQGIS to clip and load an area of interest, as long as it's not too large (not sure what size that is!). Download a GeoJSON of the area (using say the polygon tool in https://maps.ozultimate.com/), and then run the following at the Python Console (replacing any file paths with your own):
Code: Select all
resultClip = processing.runAndLoadResults("gdal:cliprasterbymasklayer", { 'ALPHA_BAND' : False, 'CROP_TO_CUTLINE' : True, 'DATA_TYPE' : 0, 'EXTRA' : '', 'INPUT' : 'E:/geodata/nsw100k.vrt', 'KEEP_RESOLUTION' : False, 'MASK' : 'C:/Users/brennant/Downloads/data.geojson', 'MULTITHREADING' : False, 'NODATA' : None, 'OPTIONS' : '', 'OUTPUT' : 'TEMPORARY_OUTPUT', 'SET_RESOLUTION' : False, 'SOURCE_CRS' : None, 'TARGET_CRS' : None, 'X_RESOLUTION' : None, 'Y_RESOLUTION' : None })
Last edited by tom_brennan on Thu 18 Feb, 2021 7:09 am, edited 2 times in total.
Bushwalking NSW - http://bushwalkingnsw.com
User avatar
tom_brennan
Athrotaxis selaginoides
Athrotaxis selaginoides
 
Posts: 1262
Joined: Wed 29 Sep, 2010 9:21 am
Location: Sydney
Region: New South Wales
Gender: Male

Re: Topographic maps from DEMs in QGIS

Postby mandragara » Wed 17 Feb, 2021 10:22 pm

Many thanks for this Tom, I will try and implement this stuff! I'm a total convert.
User avatar
mandragara
Athrotaxis cupressoides
Athrotaxis cupressoides
 
Posts: 126
Joined: Fri 22 Dec, 2017 5:04 pm
Location: Sydney
Region: New South Wales
Gender: Male

Re: Topographic maps from DEMs in QGIS

Postby potato » Thu 18 Feb, 2021 7:24 am

Nice - thanks for this.
potato
Athrotaxis cupressoides
Athrotaxis cupressoides
 
Posts: 316
Joined: Thu 28 Jan, 2016 1:06 pm
Region: Tasmania
Gender: Male

Re: Topographic maps from DEMs in QGIS

Postby tom_brennan » Fri 19 Feb, 2021 5:55 pm

And I'd encourage anyone that has any useful learnings from QGIS and creating maps for bushwalking to add to/update the wiki.

Message me and I can give you access.(I disabled the ability to join directly as it was being attacked by spam bots).
Bushwalking NSW - http://bushwalkingnsw.com
User avatar
tom_brennan
Athrotaxis selaginoides
Athrotaxis selaginoides
 
Posts: 1262
Joined: Wed 29 Sep, 2010 9:21 am
Location: Sydney
Region: New South Wales
Gender: Male

Re: Topographic maps from DEMs in QGIS

Postby tom_brennan » Sun 21 Feb, 2021 8:37 pm

For those who are interested, I've put up about 10 pages of information on end to end processing of NSW DEMs.

Most of this is applicable to DEMs in general, but apart from Tassie, there is limited DEM information available for other states!

https://maps.ozultimate.com/wiki/nsw_lidar
Bushwalking NSW - http://bushwalkingnsw.com
User avatar
tom_brennan
Athrotaxis selaginoides
Athrotaxis selaginoides
 
Posts: 1262
Joined: Wed 29 Sep, 2010 9:21 am
Location: Sydney
Region: New South Wales
Gender: Male

Re: Topographic maps from DEMs in QGIS

Postby tastrax » Sun 21 Feb, 2021 9:19 pm

Great work Tom! Love the style files for QGIS. For IOS, there is also Inputapp that takes QGIS project files.

https://help.inputapp.io/
Cheers - Phil

OSM Mapper
User avatar
tastrax
Athrotaxis selaginoides
Athrotaxis selaginoides
 
Posts: 1937
Joined: Fri 28 Mar, 2008 6:25 pm
Location: What3words - epic.constable.downplayed
ASSOCIATED ORGANISATIONS: RETIRED! - Parks and Wildlife Service
Region: Tasmania

Re: Topographic maps from DEMs in QGIS

Postby tastrax » Sun 21 Feb, 2021 9:34 pm

Re your notes on the RFS feeds - there is an issue in QGIS in that it doesnt handle geometry collections (ie object with point and polygon features)

https://github.com/qgis/QGIS/issues/32747
Cheers - Phil

OSM Mapper
User avatar
tastrax
Athrotaxis selaginoides
Athrotaxis selaginoides
 
Posts: 1937
Joined: Fri 28 Mar, 2008 6:25 pm
Location: What3words - epic.constable.downplayed
ASSOCIATED ORGANISATIONS: RETIRED! - Parks and Wildlife Service
Region: Tasmania

Re: Topographic maps from DEMs in QGIS

Postby michael_p » Thu 25 Feb, 2021 2:16 pm

Thanks for the info Tom. I have not played with QGIS before but now I will use it more, what a great tool.

I was able to get the DEM data imported without any pre-processing. (Note that I am using Linux so I am not sure how differently QGIS works under Linux compared to Windows.) The DEM data comes in a zip file. In the zip file is a file with a .asc file extension. I was able to import the asc file as a layer and it worked. Not sure if this will help anyone but I thought I would add it to the pot.
One foot in front of the other.
User avatar
michael_p
Athrotaxis selaginoides
Athrotaxis selaginoides
 
Posts: 1274
Joined: Sun 15 Nov, 2009 6:58 pm
Location: Macarthur Region of Sydney.
Region: New South Wales
Gender: Male

Re: Topographic maps from DEMs in QGIS

Postby tom_brennan » Thu 04 Mar, 2021 9:09 pm

tastrax wrote:For IOS, there is also Inputapp that takes QGIS project files. https://help.inputapp.io/


Have added a link to it.

tastrax wrote:Re your notes on the RFS feeds - there is an issue in QGIS in that it doesnt handle geometry collections (ie object with point and polygon features)


Thanks, will pass on to Alex (Allchin09) - that one is his project!

michael_p wrote:I was able to get the DEM data imported without any pre-processing. (Note that I am using Linux so I am not sure how differently QGIS works under Linux compared to Windows.) The DEM data comes in a zip file. In the zip file is a file with a .asc file extension. I was able to import the asc file as a layer and it worked. Not sure if this will help anyone but I thought I would add it to the pot.


I had a broken link, but that should now be captured under https://maps.ozultimate.com/wiki/nsw_merge_dems (I think it's the same for Windows/Linux)
Bushwalking NSW - http://bushwalkingnsw.com
User avatar
tom_brennan
Athrotaxis selaginoides
Athrotaxis selaginoides
 
Posts: 1262
Joined: Wed 29 Sep, 2010 9:21 am
Location: Sydney
Region: New South Wales
Gender: Male

Re: Topographic maps from DEMs in QGIS

Postby Baeng72 » Tue 09 Mar, 2021 6:51 am

Hi,
This thread and its parent sparked my interestest in QGIS & DEM files.
I have DEM files for parts of Victoria I downloaded from ELVIS.
I am playing around with the Route plugin, but it gives a meaningless (to me) x-axis.
Reading through a lot of posts/threads on stack exchange I arrived at the conclusion I'd need to reproject the DEM to get units in meters.
I have tried reprojecting from the EPSG:4283 - GDA94 CRS (unit degrees) to WGS 84/ UTM zone 55S, which seemed to work.
However, when overalay a topo file and measure 1km using the topo grid, the x-axis is 1200m.
So, something is wrong.
Any suggestions?
Baeng72
Phyllocladus aspleniifolius
Phyllocladus aspleniifolius
 
Posts: 553
Joined: Wed 07 Aug, 2019 2:29 pm
Region: Victoria
Gender: Male

Re: Topographic maps from DEMs in QGIS

Postby tom_brennan » Tue 09 Mar, 2021 10:19 am

Baeng72 wrote:I have DEM files for parts of Victoria I downloaded from ELVIS.

There are different types of DEM files for Vic - not all of them use the same projection
elvis.png
elvis.png (22.43 KiB) Viewed 5226 times

Some of them are in geographic units (degrees)
qgis_layer_properties_degrees.png
qgis_layer_properties_degrees.png (7.59 KiB) Viewed 5226 times

Others are in projected units (metres)
qgis_layer_properties_metres.png
qgis_layer_properties_metres.png (9.13 KiB) Viewed 5226 times

Perhaps provide a screen shot of what you are seeing?

Baeng72 wrote:I am playing around with the Route plugin, but it gives a meaningless (to me) x-axis.

Not sure which plugin you are referring to? There doesn't seem to be a Route plugin in the QGIS repository.
Bushwalking NSW - http://bushwalkingnsw.com
User avatar
tom_brennan
Athrotaxis selaginoides
Athrotaxis selaginoides
 
Posts: 1262
Joined: Wed 29 Sep, 2010 9:21 am
Location: Sydney
Region: New South Wales
Gender: Male

Re: Topographic maps from DEMs in QGIS

Postby Baeng72 » Tue 09 Mar, 2021 11:58 am

Thanks for the response.
I meant Profile plugin, not sure why I wrote Route - maybe I was thinking that I'm using it for possible Routes on a hike?

The original DEM was geographic.
DEM.JPG
DEM for Bogong High Plains region
DEM.JPG (45.63 KiB) Viewed 5218 times

The projection to WGS 84 / UTM 55S
DEM2.JPG
WGS 84 / UTM 55 S Projection of DEM
DEM2.JPG (47.29 KiB) Viewed 5218 times

But now 1km on the overlain TIF is 1km in the profile tool (it's working), not 1200m
DEM3.JPG
UTM 55S DEM OVERLAIN WITH TOPO TIF & Profile Plugin
Attachments
DEM4.JPG
Profile Plugin
Baeng72
Phyllocladus aspleniifolius
Phyllocladus aspleniifolius
 
Posts: 553
Joined: Wed 07 Aug, 2019 2:29 pm
Region: Victoria
Gender: Male

Re: Topographic maps from DEMs in QGIS

Postby tom_brennan » Tue 09 Mar, 2021 7:44 pm

Sounds like a CRS issue - the UTM x (vertical) gridlines diverge when projected into degrees. And at -36 degrees south, it's about 1.2x what it is at the equator.
Bushwalking NSW - http://bushwalkingnsw.com
User avatar
tom_brennan
Athrotaxis selaginoides
Athrotaxis selaginoides
 
Posts: 1262
Joined: Wed 29 Sep, 2010 9:21 am
Location: Sydney
Region: New South Wales
Gender: Male


Return to Techno-Babble

Who is online

Users browsing this forum: No registered users and 7 guests