Desktop version
NSW & ACT specific bushwalking discussion.

Forum rules

NSW & ACT specific bushwalking discussion. Please avoid publishing details of access to sensitive areas with no tracks.
Post a reply

Re: make your own NSW topo maps [large images]

Mon 30 Sep, 2013 5:20 pm

You would need to have the latest update of the nswtopo code obviously. The code and instructions for use are are at https://github.com/mholling/nswtopo. If you are running it without error but getting a blank map back, unfortunately that means the map data is not available (any populated area, for example).

Re: make your own NSW topo maps [large images]

Tue 01 Oct, 2013 4:22 pm

mholling - When I execute the command "ruby nswtopo.rb" I get a response of:
nswtopo.rb:43:in `deep_merge': undefined method `inject' for false:FalseClass (NoMethodError)

from nswtopo.rb:1845:in `each'
from nswtopo.rb:1845:in `inject'
from nswtopo.rb:1845:in `run'
from nswtopo.rb:2272:in `<main>'


Any thoughts?

Re: make your own NSW topo maps [large images]

Sun 24 Nov, 2013 11:27 am

Has anyone had success using the v2 vegetation dataset with the new version of the nswtopo script on Windows (Win7 x64)?

If try and include the vegetation layer my map.svg file seems to have an invalid layer, which causes batik to crash out when generating the raster files.

I've tried using both the OSGeo4W gdal tools and the gisinternals version of the gdal tools and it doesn't seem to make any difference. Are there any tricks I should be aware of in getting the vegetation layer to work?

Any advice would be greatly appreciated.

I've attached my version of nswtopo.cfg, a sample of my map.svg file and a rasterised output file (generated by inkscape) in case this helps.
Attachments
nswtopo.zip
nswtopo.cfg and map.svg files
(373.25 KiB) Downloaded 768 times

Re: make your own NSW topo maps [large images]

Thu 12 Dec, 2013 11:01 am

I have had recent success with the latest version 0.6.4 and vegetation 2 running on Ubuntu.

Like others here have reported for a long while I was getting empty svg files, but it is now working well.

Re: make your own NSW topo maps [large images]

Fri 17 Jan, 2014 1:03 pm

Hi

My first post so please go easy on me.

I read this thread with great interest as I desparately want/need to create my own vector topo maps. I'm pretty sure I've followed all the directions but I can't get the script to work. Running the command prompt from OSGeo4W, ruby isn't recognised and running the command prompt normally won't find the gdal info.

While I'm pretty computer savvy, my scripting knowledge is pretty basic.

Cheers
Nathan

Re: make your own NSW topo maps [large images]

Wed 26 Feb, 2014 11:52 pm

Happy days! After nearly a year, I've finally managed to get this little gem working again under Windows 7 x64. There's a new version of nswtopo, and it seems to resolve whatever issues I was having with the server (no topographic.svg data returned). Who knows whether it will last, but I may as well enjoy it for a little while.

I did have to hack the script twice around the vegetation layer - once because it was crashing ImageMagick, and the second time because it was failing to embed the layer in the SVG. I don't know Ruby so I didn't try to fix the underlying problem, just enough to get it to work. Details (or hacked script) available on request.

One of the things I like most about nswtopo is the ability to define your own colours. I own Topoview Raster, and print out A4 or A3 sections to take on trips. The contours on the new maps are light pink, and are almost impossible to see when printed. Stupid design decision (for bushwalkers anyway). Love the brown contours ...

If anyone is interested in exchanging files offline to avoid hitting up the LPI server too much, PM me.

Nathan - you probably need to add the ruby directory to your path if you're on Windows. If you're on another OS then you're on your own.
Attachments
map.png
map.png (61.27 KiB) Viewed 37162 times

Re: make your own NSW topo maps [large images]

Mon 17 Mar, 2014 1:58 pm

Hey,

It seems that the image server is down (and will stay so) so that the geopdf maps can be sold instead.

Is there an alternative?

Re: make your own NSW topo maps [large images]

Tue 18 Mar, 2014 10:55 am

Which image server are you talking about?

Re: make your own NSW topo maps [large images]

Wed 19 Mar, 2014 11:55 am

Natvander wrote:Hi

My first post so please go easy on me.

I read this thread with great interest as I desparately want/need to create my own vector topo maps. I'm pretty sure I've followed all the directions but I can't get the script to work. Running the command prompt from OSGeo4W, ruby isn't recognised and running the command prompt normally won't find the gdal info.

While I'm pretty computer savvy, my scripting knowledge is pretty basic.

Cheers
Nathan


Confirming is this thread about vector or raster mapping. Ie does it create vector maps for a Garmin? Else there is always OSM.

Cheers

Re: make your own NSW topo maps [large images]

Wed 19 Mar, 2014 12:14 pm

Ent wrote:Confirming is this thread about vector or raster mapping. Ie does it create vector maps for a Garmin? Else there is always OSM.


The script produces svg format, which is a vector graphics format, but AFAIK the only way you could load it up to a Garmin is as a custom map. To do that you would have to render it as a rastor and georeference it as a kmz file.

Cheers

Re: make your own NSW topo maps [large images]

Sun 23 Mar, 2014 10:06 pm

andrewp wrote:
Ent wrote:Confirming is this thread about vector or raster mapping. Ie does it create vector maps for a Garmin? Else there is always OSM.


The script produces svg format, which is a vector graphics format, but AFAIK the only way you could load it up to a Garmin is as a custom map. To do that you would have to render it as a rastor and georeference it as a kmz file.

Cheers


Thanks for clearing this up for me, much appreciated.

A friend scans Tasmaps and references them for loading as custom maps. Sadly, the maximum number of pixels per map combined with the limit on the number of custom maps along with the screen resolution of my Rino 650 and 62s means, that while it is a start, but boy could it be so much better if Garmin upped their game. We use smart phones with geo referenced maps instead and that works due to the better screen resolution and size.

Re: make your own NSW topo maps [large images]

Tue 19 Aug, 2014 1:57 pm

Hi Mark. Please see my note at GitHub (https://github.com/mholling/nswtopo/issues/8) re still not getting NSW vegetation 2008 v2 to work...

Re: make your own NSW topo maps [large images]

Tue 19 Aug, 2014 11:55 pm

As a quick fix to the vegetation layer issue you can edit the svg file either directly or in inkscape.
Change
xlink:href="data:image/png;base64,iVBORwo= "
to
xlink:href="file:///Drive:/pathtoyourfilehere/nsw.vegetation-2008-v2.png"
You can then fiddle around in Inkscape if you want the file to be embedded rather than linked.

Re: make your own NSW topo maps [large images]

Sun 30 Nov, 2014 11:20 pm

Allchin09 wrote:mholling - When I execute the command "ruby nswtopo.rb" I get a response of:
nswtopo.rb:43:in `deep_merge': undefined method `inject' for false:FalseClass (NoMethodError)

from nswtopo.rb:1845:in `each'
from nswtopo.rb:1845:in `inject'
from nswtopo.rb:1845:in `run'
from nswtopo.rb:2272:in `<main>'


Any thoughts?


I'm still having this issue. Can anyone help me!?

Re: make your own NSW topo maps [large images]

Mon 01 Dec, 2014 9:24 am

Alex,
what version are you using?
I have it working with almost the current version (0.82).
I had a problem with the "reproject" function and swapped the current code out with a previous version of that function. Error was command line too long calling a GDAL program.
Apart from that there is also a bug crashing GDAL in generating an intermediate file for spot5 vegetation. It works fine on a Mac so I use that if I want Spot5.

What version of ruby? I am using ruby 2.0.0p481 (2014-05-08) [x64-mingw32] from >ruby --version

I'll send you a follow up email as will be difficult to track down your specific issue.

Re: make your own NSW topo maps [large images]

Fri 08 May, 2015 2:40 pm

Allchin09 wrote:
Allchin09 wrote:mholling - When I execute the command "ruby nswtopo.rb" I get a response of:
nswtopo.rb:43:in `deep_merge': undefined method `inject' for false:FalseClass (NoMethodError)

from nswtopo.rb:1845:in `each'
from nswtopo.rb:1845:in `inject'
from nswtopo.rb:1845:in `run'
from nswtopo.rb:2272:in `<main>'


Any thoughts?


I'm still having this issue. Can anyone help me!?


I was just helping someone else fix this. They had this error because they had a blank config file.
What's in your config file? If its blank add the following:

name: output

Also add some layers if you don't have any:

include:
- nsw/reference-topo-current
- grid


Cheers.

Re: make your own NSW topo maps [large images]

Fri 08 May, 2015 5:11 pm

I resolved that issue by reinstalling OSGeo4W with more libraries. I selectded "Express" then "GDAL"

I also fornd that ruby was not in the path in the OSGeo4W environment so I added that to the environment variables bat file.

Re: make your own NSW topo maps [large images]

Fri 08 May, 2015 5:13 pm

Im having 2 problems with this:

1. I am having java security issues (no write access) for the temp files during the raster creation phase. SVG is created ok.

2. I have downloaded the vegetation v2 dataset but I have no idea where/what to unzip or how to configure it. Ideas welcomed.

full error for point 1:
Code:
Exception in thread "main" java.security.AccessControlException: access denied (
"java.util.PropertyPermission" "java.security.policy" "write")
        at java.security.AccessControlContext.checkPermission(AccessControlConte
xt.java:372)
        at java.security.AccessController.checkPermission(AccessController.java:
559)
        at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
        at java.lang.System.setProperty(System.java:783)
        at org.apache.batik.util.ApplicationSecurityEnforcer.installSecurityMana
ger(Unknown Source)
        at org.apache.batik.util.ApplicationSecurityEnforcer.enforceSecurity(Unk
nown Source)
        at org.apache.batik.apps.rasterizer.Main.execute(Unknown Source)
        at org.apache.batik.apps.rasterizer.Main.main(Unknown Source)
mogrify.exe: unable to open image `C:/OSGEO4~1/temp/d20150508-9952-12nddyr/map.3
00.png': No such file or directory @ error/blob.c/OpenBlob/2692.
mogrify.exe: unable to open file `C:/OSGEO4~1/temp/d20150508-9952-12nddyr/map.30
0.png' @ error/png.c/ReadPNGImage/3912.
Generating map.png
C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1391:in `initialize': No such file or
directory @ rb_sysopen - C:/OSGEO4~1/temp/d20150508-9952-12nddyr/map.300.png (Er
rno::ENOENT)
        from C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1391:in `open'
        from C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1391:in `copy_file'
        from C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:485:in `copy_file'
        from C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:402:in `block in cp'
        from C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1570:in `block in fu_each
_src_dest'
        from C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1586:in `fu_each_src_dest
0'
        from C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:1568:in `fu_each_src_dest
'
        from C:/Ruby22-x64/lib/ruby/2.2.0/fileutils.rb:401:in `cp'
        from nswtopo.rb:3110:in `block (3 levels) in run'
        from nswtopo.rb:3104:in `each'
        from nswtopo.rb:3104:in `block (2 levels) in run'
        from nswtopo.rb:3097:in `each'
        from nswtopo.rb:3097:in `block in run'
        from nswtopo.rb:67:in `block in mktmppath'
        from C:/Ruby22-x64/lib/ruby/2.2.0/tmpdir.rb:88:in `mktmpdir'
        from nswtopo.rb:66:in `mktmppath'
        from nswtopo.rb:3094:in `run'
        from nswtopo.rb:3145:in `<main>'

Re: make your own NSW topo maps [large images]

Fri 08 May, 2015 8:36 pm

felixthecat wrote:
I was just helping someone else fix this. They had this error because they had a blank config file.
What's in your config file? If its blank add the following:

name: output

Also add some layers if you don't have any:

include:
- nsw/reference-topo-current
- grid


Cheers.


It works! Thanks for that pick up, much appreciated.

Re: make your own NSW topo maps [large images]

Fri 08 May, 2015 11:18 pm

Just incase you missed it, an update was released at the start of the year. The older version I was using didn't have the nsw/topographic vector layer which is the interesting one.

One thing I can't sort out is outputting to other raster formats. My nswtopo.cfg file is shown below. Any thoughts on what's going wrong?

Code:
name: output

zone: 56
easting: 246786
northing: 6260113
size: 297 x 420

scale: 25000

contour-interval: 10

include:
- nsw/vegetation-2008-v2
- nsw/topographic
- relief
- grid

rasterise: C:/nswtopo-master/phantomjs-2.0.0-windows/bin/phantomjs.exe

formats:
- kmz

nsw.vegetation-2008-v2:
  path: /nswtopo-

master/sources/nsw/NSWInterimNativeVegetationExtentV2_2008/Data/nswint

ext08/hdr.adf
  colour:
    woody: light green
    non-woody: white


Here is the output I get includes:

Code:
nswtopo.rb:2660:in ``': No such file or directory - 7z a -tzip -r "C:/Users/Owner/AppData/Local/Temp/d20150508-7340-1tpkhvy/output.kmz" * (Errno::ENOENT)
from nswtopo.rb:2660:in `block (2 levels) in build'
from nswtopo.rb:2660:in `chdir'
from nswtopo.rb:2660:in `block in build'
from nswtopo.rb:67:in `block in mktmppath'
from C:/Ruby193/lib/ruby/1.9.1/tmpdir.rb:83:in `mktmpdir'
from nswtopo.rb:66:in `mktmppath'
from nswtopo.rb:2555:in `build'
from nswtopo.rb:3118:in `block (3 levels) in run'
from nswtopo.rb:3104:in `each'
from nswtopo.rb:3104:in `block (2 levels) in run'
from nswtopo.rb:3095:in `each'
from nswtopo.rb:3095:in `block in run'
from nswtopo.rb:67:in `block in mktmppath'
from C:/Ruby193/lib/ruby/1.9.1/tmpdir.rb:83:in `mktmpdir'
from nswtopo.rb:66:in `mktmppath'
from nswtopo.rb:3094:in `run'
from nswtopo.rb:3145:in `<main>'

Re: make your own NSW topo maps [large images]

Sat 09 May, 2015 8:55 am

cnschulz wrote:Im having 2 problems with this:

1. I am having java security issues (no write access) for the temp files during the raster creation phase. SVG is created ok.

2. I have downloaded the vegetation v2 dataset but I have no idea where/what to unzip or how to configure it. Ideas welcomed.



1. I haven't had this error (or seen it). Also don't know much about Java. I guess you could try executing as sudo (linux/mac) or as admin on Windows... but I think you will need to add some lines to your java policy file (java.policy, client.policy, server.policy??). You'll prob have to do some reading here...

2. The vegetation data can be put anywhere I think, though I put it in the project's root directory. Then in your config file you tell the scrip where to find the data. Here is an example from the readme file:
Code:
    nsw.vegetation-2008-v2:
      path: /Users/username/Desktop/nswtopo/NSWInterimNativeVegetationExtentV2_2008/Data/nswintext08/hdr.adf


Cheers,
Felix

Re: make your own NSW topo maps [large images]

Sat 09 May, 2015 9:10 am

Allchin09 wrote:One thing I can't sort out is outputting to other raster formats. My nswtopo.cfg file is shown below. Any thoughts on what's going wrong?


Ok, I think there might be a problem with the structure of your config file...
The format of this file needs to be YAML. I believe this implies that you need to compartmentalise the code keeping all your layers together in the config file. Maybe try this:

Code:
name: output
zone: 56
easting: 246786
northing: 6260113
size: 297 x 420
scale: 25000
contour-interval: 10

#######################

include:
- nsw/vegetation-2008-v2
- nsw/topographic
- relief
- grid

nsw.vegetation-2008-v2:
  path: /nswtopo-master/sources/nsw/NSWInterimNativeVegetationExtentV2_2008/Data/nswintext08/hdr.adf

########################

rasterise: C:/nswtopo-master/phantomjs-2.0.0-windows/bin/phantomjs.exe

########################

formats:
- kmz


If this doesn't work I would recommend using a simple config file and then slowly add to it.

Hope this helps!

Cheers,
Felix

Re: make your own NSW topo maps [large images]

Sat 09 May, 2015 1:47 pm

felixthecat wrote:Ok, I think there might be a problem with the structure of your config file...


Unfortunately, that didn't seem to solve the issue. Everything work fine until I name a format. It then asks me to specify a program to use to rasterise, and when I specify that in the .cfg files I get the error messages...

Re: make your own NSW topo maps [large images]

Sat 09 May, 2015 2:02 pm

Try putting your slashes the other way around. Use back slashes for windows. Not sure if that will help.

Re: make your own NSW topo maps [large images]

Sat 09 May, 2015 2:08 pm

Hey thanks so much for all your help here guys. I've got nice SVG being produced with vegetation now. The java error is still there but I'll work on that one separately. The big issue is as follows...

The raster generated for the vegetation is tiny and when you zoom in it becomes very blurry. Any ideas as to why this is and/or how I can fix it?

Screenshot 2015-05-09 14.55.14.png

Re: make your own NSW topo maps [large images]

Sun 10 May, 2015 4:19 pm

Solved myself. Its correct for the scale that the map should be. I just assumed it would scale evenly because it was composed of distinct blocks. Anyway, I can live with it.

The java error goes away If I make the OSGeo4W temp directory the current directory im working in.

I can only get inkscape to render properly... ill keep working on that one.

Re: make your own NSW topo maps [large images]

Sun 10 May, 2015 11:37 pm

<how do I delete this??>
Last edited by felixthecat on Sun 10 May, 2015 11:38 pm, edited 1 time in total.

Re: make your own NSW topo maps [large images]

Sun 10 May, 2015 11:37 pm

Allchin09 wrote:Unfortunately, that didn't seem to solve the issue. Everything work fine until I name a format. It then asks me to specify a program to use to rasterise, and when I specify that in the .cfg files I get the error messages...


Maybe it would be worth trying Inkscape out? Perhaps it will solve the problem??

Re: make your own NSW topo maps [large images]

Sun 10 May, 2015 11:41 pm

Tried that, still no success! I think I may have to resort to uninstalling everything and having another go. Hopefully that will fix the problem.

Re: make your own NSW topo maps [large images]

Mon 11 May, 2015 1:00 pm

Alex - do you have 7zip installed and in your path?

No such file or directory - 7z a -tzip -r "C:/Users/Owner/AppData/Local/Temp/d20150508-7340-1tpkhvy/output.kmz" * (Errno::ENOENT)


It's trying to run 7zip (7z.exe) and not finding it. From the website
(If you want to create KMZ maps, install 7-Zip and add its location, C:\Program Files\7-Zip, to your PATH following these instructions, using a semicolon to separate your addition.)


Or change output to a format other than KMZ
Post a reply