Accurate elevation contours for Oruxmaps and other uses.

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.

Accurate elevation contours for Oruxmaps and other uses.

Postby ken333 » Tue 20 Aug, 2019 4:38 pm

The government has a webite named ELVIS (ELeVation Information System) that contains free high accuracy elevation data that can be converted into contours and shown on Oruxmaps as an overlay.
https://elevation.fsdf.org.au/
The metadata for the 5 metre Geosciences Australia DEM files (Digital Elevation Model) says the vertical accuracy is < 0.3 metre. These DEM files provide elevation data on a 5 metre grid, and covers selected areas of Australia, usually coastal and built up areas. There are probably many ways this information can be used, but here is one example, using a Windows PC and Android device with Oruxmaps installed. This requires GDAL and GpsMapEdit free software to be installed on the Windows PC.

In ELVIS, type a location name or zoom to the required location. Move the slider to the left to see the map better.
Click the pencil-in-a-square symbol at right, and draw a box around the area of interest. Selecting large areas will result in large files.
Scroll down the data available list at right, and look for 'Geosciences Australia 5 metre'. Click 'Show List'. Click the small box to the left of the name '5 Metre Digital Elevation Model (DEM) of Australia derived from LiDAR'. A blue box opens at the bottom. Click the box.
Another box opens. Select 'Map Grid of Australia' and note the Zone number. (required later). Select 'ESRI ASCII Grid'. Enter your email address, and something in Industry (eg Private). Click the 'I am not a robot' box. Click Start. (You may need to register on ELVIS before you can use it).
Wait a minute then check your email. The email will contain a link to a ZIP file that has been generated. It also will show the file size. Save the ZIP file on your computer. Rename it to something useful. Extract it to some folder. It will contain a file named CLIP_0_0.asc. Change the name to something useful. This is the 5 metre grid DEM elevation data. You can open it with a text editor, like Notepad++. You can see the file layout for 'ESRI ASCII Grid' files in Wikipedia.

To convert the DEM data to contours, use GDAL. This can be downloaded and installed from https://gdal.org/download.html
This is a set of command line programs that run in the cmd.exe window. Type cmd.exe into the Windows Search box and click the app. Change Directory (CD) to the folder where the GDAL .exe files are located. To convert the .asc file to a contour file, use the gdal_contour command Eg
gdal_contour -i 5 InPathFilename.asc OutPathShapeFiles
-i 5 sets the contour interval to 5 metre. Other values can be used as well. A folder named OutPathShapeFiles is created containing the files including contour.shp. This is a shape file and can be used directly by some programs, but Oruxmaps didnt like it when I tried to use it.

Convert the contour.shp file to a Google Earth .kmz file, using GpsMapEdit. This can be downloaded and installed from https://www.geopainting.com/
Or use an online file converter to convert the shape file to a kmz file.

Start GpsMapEdit and browse to the contour.shp file (select All Files (*.*) in the File Type box to see it) and open it. Select 'Road' for a thin black line, or 'Interm land contour' for a thin brown line. Next. Next. Next. In box '4. Select Source Coords', choose 'Map Grid of Australia 94' and choose the Zone number as noted from the ELVIS download, above. Next. Finish.
GpsMapEdit shows the contours. Click File - Export - Google Earth .kmz. Save the .kmz file with a useful filename.

Connect the Android to the PC by USB cable, and copy - paste the .kmz file to the oruxmaps/overlay folder on the Android. Disconnect and start Oruxmaps on the Android, with a data or wifi connection. In Oruxmaps, set Maps to Online and select a map. Eg OpenTopoMap or OpenStreetMap etc. Drag and zoom to the area covered by the contours. In Oruxmaps, tap the Map symbol - Overlay Options - Load KML/SHP. Select the .kmz file. The contours are overlayed on the map.
Note that there are no numbers on the contours. Overlaying using OpenTopoMap base map can provide an indication of the actual elevation values.
If you choose an area where there are no GA 5 metre DEM files, there will be a 'SRTM 1 second DEM' file. I think this is a 30 metre grid, and is the same data that Goggle Maps Terrain and OpenTopoMaps use, so is not particularly useful. There are also various other DEM files in the list. Some of these may be useful.

The .kmz file can be imported into Google Earth (File - Import - All Files (*.*) and will show the contours overlayed on the 3d images.
It would be good if this 5 metre DEM data could be used to provide 3d views of satellite imagery, the same way that Google Earth does, with the 30 metre or 90 metre SRTM data now. I dont know if this can be done.
GpsMapEdit can also export to a Garmin img file, and OziExplorer .bmp and .map files.
It can also import a gps gpx track or waypoint file. I dont know if it can open OpenStreetMap or other map files.
Having 5 metre or 2 metre contours on a map is probably not useful in many bushwalks, but if you are offtrack in rough conuntry, it may help to avoid cliffs and other obstacles.
Here are 2 screenshots of Oruxmaps with 5 metre contours overlayed on OpenTopoMap and QTopo
https://drive.google.com/open?id=1VfO3A ... xMrQBxYaVL
https://drive.google.com/open?id=1djTZJ ... trOMHN_a7T
Last edited by ken333 on Wed 21 Aug, 2019 1:08 pm, edited 5 times in total.
ken333
Atherosperma moschatum
Atherosperma moschatum
 
Posts: 54
Joined: Mon 07 Dec, 2015 2:17 pm
Region: Australia

Re: Accurate elevation contours for Oruxmaps and other uses.

Postby Mark F » Tue 20 Aug, 2019 4:46 pm

There was a file of 5m contours for Australia available in 2009 suitable for Garmin. I expect the new data may be a bit more accurate but the 2009 version seemed to work for most people. The file seems to have disappeared but I am sure several of have a copy - I do.
"Perfection is attained not when there is nothing more to add, but when there is nothing more to remove".
User avatar
Mark F
Lagarostrobos franklinii
Lagarostrobos franklinii
 
Posts: 2332
Joined: Mon 19 Sep, 2011 8:14 pm
Region: Australian Capital Territory
Gender: Male

Re: Accurate elevation contours for Oruxmaps and other uses.

Postby tom_brennan » Thu 22 Aug, 2019 2:16 pm

NSW has 1m, 2m or 5m DEMs across the whole of the state. Due to the size of the dataset, I have no idea how you would go about processing the data to generate state-wide contours, but it would be great. Note that the NSW DEMs do not have enforced drainage, so need to have sinks filled to avoid getting depressions in watercourses.
Bushwalking NSW - http://bushwalkingnsw.com
User avatar
tom_brennan
Athrotaxis selaginoides
Athrotaxis selaginoides
 
Posts: 1350
Joined: Wed 29 Sep, 2010 9:21 am
Location: Sydney
Region: New South Wales
Gender: Male

Re: Accurate elevation contours for Oruxmaps and other uses.

Postby ken333 » Mon 06 Feb, 2023 3:43 pm

How to make an overlay file of 2m or 5m contours for Oruxmaps, from multiple .asc DEM files from ELVIS, with a Windows PC.
Oruxmaps will show these contours as an overlay on other maps eg OSM or Nsw SIX maps.
Gdal can be used to make a kml file from the Elvis asc files. A full install of Gdal on Windows is complcated. However only 2 Gdal programs are needed here, and they can be obtained by installing only the core gdal programs from the file:
'gdal-3.6.2-1930-x64-core.msi' (34MB) from 'https://www.gisinternals.com/query.html?content=filelist&file=release-1930-x64-gdal-3-6-2-mapserver-8-0-0.zip'
This allows execution of non-Python gdal programs, including gdalbuildvrt and gdal_contour.

Open the Elvis site https://elevation.fsdf.org.au/ Click Layers (top left). Select OpenStreetMap.
Scroll down to Digital Elevation Model. Move Opacity slider to left to see OSM map better. Drag and zoom map to required location. Hide the left pane.
Click 'Order Data' (top right). Check Draw and Box are ticked. Click Draw. Click (and release) at lower right corner of required area. Click at top left corner of required area. A box of the area is shown. Selecting a large area will give very large files and slow operation. Click Search.
A list of DEM files for selected area is shown. Click Select All. Choose Industry eg Private. Enter email address. Click Order etc. Wait for email. Click link in email. Save .zip file.
Extract all zipped files to a folder eg C:\Maps\Temp. Tip: If the files are in different folders, use File Explorer search *.asc and *.prj then copy-paste or cut-paste these files into C:\Maps\Temp.

1. Open a cmd.exe window and type: chdir "C:\Program Files\GDAL". Check the gdal installation is ok by typing 'gdalinfo --version'.

2. Make a gdal .vrt file of all the .asc file names: type
gdalbuildvrt "C:\Maps\Temp\All_ASC_Files.vrt" "C:\Maps\Temp\*.asc"

3. Make a KML contour file, eg with 5m interval: type
gdal_contour -a elev -i 5 -f KML "C:\Maps\Temp\All_ASC_Files.vrt" "C:\Maps\Temp\Contours_5m.kml"

4. Copy this kml file into the overlays folder in the oruxmaps folder on the Android (12) phone at.
Internal storage\Android\data\com.orux.oruxmapsDonate\files\oruxmaps\overlay

View the kml file in Google Earth. (File - Open). It is a text file and can viewed and edited in Notepad. Eg the line colour and width can be changed.
Open Oruxmaps. Tap Map icon at top right. Select a suitable map, eg Open Street Map or OpenAndroMap etc. Then Tap Map icon again. Overlay options - Load kml file. Tap kml file. It opens as a transparent overlay of the 5m contours.
This also worked with Elvis .tif files. But the files "C:\Program Files\GDAL\projlib\proj.db" and 2 other proj files had to be copied into the GDAL folder.

Tom Brennan and others have shown how do this and lots more with Qgis. Qgis has a steep learning curve, and is a 1+ GB download, and 2.4+ GB disk space.
ken333
Atherosperma moschatum
Atherosperma moschatum
 
Posts: 54
Joined: Mon 07 Dec, 2015 2:17 pm
Region: Australia

Re: Accurate elevation contours for Oruxmaps and other uses.

Postby wildwanderer » Thu 09 Feb, 2023 7:52 am

Does using contours as an overlay prevent using the measurement tool to calculate vertical elevation for a given distance?

There used to be an app that provided a way to download high 'res' dem files but it's gone. Anyone know of a good source for Australia wide dems that are easy to import eg just a hgt file?
User avatar
wildwanderer
Athrotaxis selaginoides
Athrotaxis selaginoides
 
Posts: 1640
Joined: Tue 02 May, 2017 8:42 am
Location: Out of lockdown \o/
Region: New South Wales
Gender: Male

Re: Accurate elevation contours for Oruxmaps and other uses.

Postby ken333 » Thu 09 Feb, 2023 12:24 pm

This website allows downloads of the SRTM 3 arcsecond (90m) DEM .hgt files.
http://viewfinderpanoramas.org/Coverage ... s_org3.htm

The ELVIS site allows downloads of 1 arcsecond (30m) SRTM DEM files, but they are not in .hgt format.
ken333
Atherosperma moschatum
Atherosperma moschatum
 
Posts: 54
Joined: Mon 07 Dec, 2015 2:17 pm
Region: Australia


Return to Techno-Babble

Who is online

Users browsing this forum: No registered users and 13 guests