Here are some links to the mapping project I was talking about:
First a link to the github project: https://github.com/mholling/nswtopo
and here is a link to the thread on Bushwalk Australia that discusses the program: http://bushwalk.com/forum/viewtopic.php?f=36&t=9028
Felix’s Disclaimer: this program will take some mucking around to get working. It is not a simple install and run, you will need to create a configuration file after reading the project documentation.
There are some teaser maps on the Bushwalk Australia site, but here is the one I generated for Donkey Mountain:
First you will need to install all the prerequisites…
- ImageMagick and GDAL can obtained for Mac OS by first setting up MacPorts, a package manager for Mac OS; follow these instructions on the MacPorts site. After MacPorts is installed, use it to install the packages with
sudo port install gdaland
sudo port install imagemagick +q8
- Alternatively, you can download and install pre-built binaries; try here for GDAL, and the instructions here for ImageMagick. (This may or may not be quicker/easier than installing XCode and MacPorts!)
ruby -vin a terminal window to see whether a version 1.9.3 or greater Ruby already exists. If not, you can install Ruby 1.9.3 a number of ways, as explained here. (If you are using MacPorts,
sudo port install ruby19 +nosuffixshould also work.)
- Download and install Inkscape here, or install it using MacPorts:
sudo port install inkscape
ok, so you downloaded the nswtopo-1.0.1 file. I think it is a zip(?).
You need to extract the contents into a folder – I put mine on the desktop (The Unarchiver is a good program on mac to extract archives, but being a zip you can just double click I think)
You should now have a single folder on the desktop with a bunch of files and folders. The file that is important is one called “nswtopo.rb” this is the script that will create our map.
You need to run this through the terminal. You can get to the terminal by using the Command+Space shortcut and then entering in ‘terminal’, or you might have a shortcut on the side bar thingy already:
When you open up terminal you will get something like this:
It can be a little intimidating at first but there aren’t many commands you will need.
first we need to go to the directory on the desktop that you created. You can do this using the cd (change directory) command (replace the last bit with your folder name – you can use the tab button to auto complete):
Felix:Desktop administrator$ cd ~/Desktop/nswtopo-master/
Not that the prompt will change to reflect the new directory:
You can now use the ‘ls’ command to list the files
Felix:nswtopo-master administrator$ ls
You should see all the files that you normally see from the file browser.
Of note is the nswtopo.rb file
I can’t remember if it is necessary but just in case we will make sure that it can be executed. Do this with the following command:
Felix:nswtopo-master administrator$ chmod +x nswtopo.rb
to execute the script, we can use the following:
Felix:nswtopo-master administrator$ ./nswtopo.rb
If the script runs, you should get the following error:
Error: could not find any configuration file (nswtopo.cfg) or bounds file (bounds.kml).
This is a good sign! if you can another error about ruby (the scripting language ;), etc this will be harder to trouble should.
The above error, just means you need to create a file in the folder called nswtopo.cfg.
to do this you can just create it using a simple text editor such as notepad:
or you could use this command: touch nswtopo.cfg – but the notepad program will prob be easier.
You will also want a bounds file (bounds.kml) – though you use other methods. I think the easiest way to create this file is using Google Earth – so install that if you don’t have it on your computer.
Then use the polgon tool to select the area you are interested – doesn’t have to be neat – the map will still be square!
Then in the tree on the left, right-click and save as poly.kml:
If that works, you should be able to re-run the script to get the default map.
The readme file has a lot of info on how you can customise this.
You will also need to follow the instructions on getting the vegetation layer data, as this does not work out of the box.
If you execute the ruby script again you’ll probably get the following error:
Shiny:nswtopo rubystephens$ ./nswtopo.rb
./nswtopo.rb:46:in `deep_merge’: undefined method `inject’ for false:FalseClass (NoMethodError)
from ./nswtopo.rb:2800:in `each’
from ./nswtopo.rb:2800:in `inject’
from ./nswtopo.rb:2800:in `run’
from ./nswtopo.rb:3145:in `’
This error is occurring because you have a blank config file.
Add the following to your config file:
That should create a file called output.svg which you can open with inkscape or a web browser.
To make this look nice you will need to fix the vegetation – requires you to download the data. I think you needed to register so you can use this link instead if you want: https://www.dropbox.com/s/6iiht95a3j4p7el/Vegetation_NSWInterimNativeVegetationExtentV2_2008.zip?dl=0
Another really awesome layer to add is the current LPI topo map. You can do that by appending the following to your config file… here is the complete config thus far:
To fix vegetation you need to download the above file, uncompress in the nswtopo directory and add some lines to your config… can’t remember the lines – just check the readme.
add a few more layers:
# – ETC!!!!
You can turn these on and off in inkscape to customise your map.