Published by breki on 18 Jan 2010 at 09:31 pm
GroundTruth: bugfix
I’ve just released a new version of GroundTruth (dowload it from here) which contains fixes for bugs kindly reported by users in the last couple of months. I’m sorry you had to wait so long for this, but I’m dedicating most of my spare time working on the new Kosmos stuff. Anyway, here’s a list of changes for this release:
- BUGFIX: lat/lon were switched for generated OSM files…. ooops
- BUGFIX: the app. will now not fall apart if the user specifies an area which is not covered by (SRTM) DEM data
- the application now uses "neutral" (U.S.) culture for displaying console messages (no more decimal commas)
- Flee library is no longer used.


Mathieu on 20 Jan 2010 at 17:49 #
Hi,
I’m using this latest version, but I keep getting this error (below) when generating contours. I also had it with 1.5.* that’s why I upgraded.
I’m on Linux (CentOS 5.4, with a recent version of mono compiled locally).
Any idea on how I can work around it?
Thanks for the hard work!
Mathieu
The command:
AREA_URL=http://www.openstreetmap.org/?lat=46.6&lon=18.6&zoom=4&layers=B000FTF
./GroundTruth.sh contours -interval=50 -bu=$AREA_URL
The error: … Generating contours for area (34.5, 60.25, 34.75, 60.5) Merging DEM data… Analyzing elevation 100 m Analyzing elevation 150 m Analyzing elevation 200 m Analyzing elevation 250 m Generating contours for area (34.5, 60.5, 34.75, 60.75) Merging DEM data… Generating contours for area (34.5, 60.75, 34.75, 61) Downloading SRTM3 tile ‘N61E034.hgt’… Merging DEM data… Generating contours for area (34.5, 61, 34.75, 61.25) Downloading SRTM3 tile ‘N61E034.hgt’… Merging DEM data… Generating contours for area (34.5, 61.25, 34.75, 61.5) Generating contours for area (34.5, 61.5, 34.75, 61.75) Generating contours for area (34.5, 61.75, 34.75, 62) Generating contours for area (34.5, 62, 34.75, 62.25) Generating contours for area (34.5, 62.25, 34.75, 62.5) Generating contours for area (34.5, 62.5, 34.75, 62.75) Generating contours for area (34.5, 62.75, 34.75, 63) Generating contours for area (34.5, 63, 34.75, 63.25) Generating contours for area (34.5, 63.25, 34.75, 63.5) Generating contours for area (34.5, 63.5, 34.75, 63.75) Generating contours for area (34.5, 63.75, 34.75, 64) Generating contours for area (34.5, 64, 34.75, 64.25) Generating contours for area (34.5, 64.25, 34.75, 64.5) Generating contours for area (34.5, 64.5, 34.75, 64.75) Generating contours for area (34.5, 64.75, 34.75, 65) Generating contours for area (34.5, 65, 34.75, 65.2184177637536) Generating contours for area (34.75, 27.3815822362464, 35, 27.5) Merging DEM data… ERROR: System.IndexOutOfRangeException: Array index is out of range. at Brejc.DemLibrary.Srtm.SrtmCell.GetElevation (Int32 x, Int32 y) [0x00000] at Brejc.DemLibrary.RasterDemBase.CopyElevationPointsFrom (IRasterDem dem) [0x00000] at Brejc.DemLibrary.Srtm.SrtmSourceBase.LoadDemForArea (Brejc.Geometry.Bounds2 bounds) [0x00000] at Brejc.DemLibrary.IntelligentDemProvider.LoadDem (Brejc.Geometry.Bounds2 bounds) [0x00000] at Brejc.DemLibrary.Ibf.IbfUtilities.GenerateAreaDefinitions (Brejc.DemLibrary.Ibf.IbfFile ibfFile, IRasterDemProvider rasterDemProvider, Brejc.DemLibrary.Ibf.GenerateIbfAreaDefinitionsParameters parameters) [0x00000] at GroundTruth.Engine.Ibf.DefaultIbfGenerator.Run (GroundTruth.Engine.Ibf.IbfGenerationParameters parameters) [0x00000] at GroundTruth.GenerateContoursCommand.Execute (IEnumerable`1 args) [0x00000] at GroundTruth.ConsoleApp.Process () [0x00000]
breki on 20 Jan 2010 at 18:21 #
@Matthieu,
That’s quite a large area you’re trying to cover. To tell you the truth I haven’t tried testing GT with such a large areas. Does this error happen on smaller areas too?
Mathieu on 20 Jan 2010 at 18:27 #
Hi,
In between I actually tried on smaller areas:
Balkans (where I’m heading the day after tomorrow
http://www.openstreetmap.org/?lat=44.28&lon=23.13&zoom=6&layers=B000FTF
Europe (but smaller) http://www.openstreetmap.org/?lat=47.3&lon=11.2&zoom=5&layers=B000FTF
And both worked!
I don’t think that this is so much a matter of size (your program scales remarkably well I found!), but that there is some pb with a particular area. I’m under the impression this is somewhere on the Arabic peninsula ((34.75, 27.3815822362464, 35, 27.5) ??) Could it be that there are some weird geographical features overthere? (like dperessions or something) which make your algroithm having a problem?
Cheers,
Mathieu
breki on 20 Jan 2010 at 18:34 #
@Mathieu,
It could be the size, it could be geo. features (although I doubt it) or it could be the fact that your large area extends over parts of the world without SRTM coverage (N. Scandinavia) and there’s some bug in GT regarding this.
I’ll try it out on Arabia, if you happen to get this exception on some smaller area that can be debugged more easily, please let me know!
And have a nice trip
Mathieu on 20 Jan 2010 at 20:24 #
I’ll be happy to test (esp. now that I have all the files in cache)
I’d like to check whether this is indeed a particular area. How can I interpret this in term of geographical coordinates?:
Should I assume that hte issue is around 61° north 34° east? (the file name) Actually I though of Arabia because of the last line, but actually it may simply the lower-right corner of the are I wanted to cover.
Or shoudl I understand that the failure comes at the last “big” merge? (because N61 E034 is in Russia, so the upper right corner). In that case I see why the size could play a role.
Downloading SRTM3 tile ‘N61E034.hgt’… Merging DEM data… Generating contours for area (34.5, 61.25, 34.75, 61.5) Generating contours for area (34.5, 61.5, 34.75, 61.75) Generating contours for area (34.5, 61.75, 34.75, 62) Generating contours for area (34.5, 62, 34.75, 62.25) Generating contours for area (34.5, 62.25, 34.75, 62.5) Generating contours for area (34.5, 62.5, 34.75, 62.75) Generating contours for area (34.5, 62.75, 34.75, 63) Generating contours for area (34.5, 63, 34.75, 63.25) Generating contours for area (34.5, 63.25, 34.75, 63.5) Generating contours for area (34.5, 63.5, 34.75, 63.75) Generating contours for area (34.5, 63.75, 34.75, 64) Generating contours for area (34.5, 64, 34.75, 64.25) Generating contours for area (34.5, 64.25, 34.75, 64.5) Generating contours for area (34.5, 64.5, 34.75, 64.75) Generating contours for area (34.5, 64.75, 34.75, 65) Generating contours for area (34.5, 65, 34.75, 65.2184177637536) Generating contours for area (34.75, 27.3815822362464, 35, 27.5) Merging DEM data…
Mathieu on 20 Jan 2010 at 21:14 #
On this smaller area:
Arabia
AREA_URL=”http://www.openstreetmap.org/?lat=33.44&lon=38.5&zoom=6&layers=B000FTF” ./GroundTruth.sh contours -interval=50 -bu=$AREA_URL
I get another issue (see below): some downloaded files have their name not properly formatted. I got it once before on the big run, and renamed the file in the cache and could thus continue.
Interestingly it means that the process went further than before, which would seem to point to a size problem indeed for the previous error.
Hope it helps.
Other error:
Analyzing elevation 1450 m Analyzing elevation 1500 m Analyzing elevation 1550 m Analyzing elevation 1600 m Generating contours for area (34.75, 28.75, 35, 29) ERROR: System.ArgumentException: Invalid filename ‘._N28E035.hgt’ Parameter name: cellFileName at Brejc.DemLibrary.Srtm.SrtmCell.FromFileName (System.String cellFileName, Int32 resolution) [0x00000] at Brejc.DemLibrary.Srtm.SrtmSourceBase.FetchCachedCellsList () [0x00000] at Brejc.DemLibrary.Srtm.SrtmSourceBase.LoadDemForArea (Brejc.Geometry.Bounds2 bounds) [0x00000] at Brejc.DemLibrary.IntelligentDemProvider.LoadDem (Brejc.Geometry.Bounds2 bounds) [0x00000] at Brejc.DemLibrary.Ibf.IbfUtilities.GenerateAreaDefinitions (Brejc.DemLibrary.Ibf.IbfFile ibfFile, IRasterDemProvider rasterDemProvider, Brejc.DemLibrary.Ibf.GenerateIbfAreaDefinitionsParameters parameters) [0x00000] at GroundTruth.Engine.Ibf.DefaultIbfGenerator.Run (GroundTruth.Engine.Ibf.IbfGenerationParameters parameters) [0x00000] at GroundTruth.GenerateContoursCommand.Execute (IEnumerable`1 args) [0x00000] at GroundTruth.ConsoleApp.Process () [0x00000]
breki on 21 Jan 2010 at 13:34 #
@Matthieu,
I noticed these filenames too… very weird, sometimes it works and sometimes it doesn’t. I’ll have to do a bit of investigation.
Rene on 03 Apr 2010 at 20:21 #
GroundTruth 1.8.740.17 has a small problem on Windows 7 x64: option makemap generates .reg-files. the registry-path in this files “HKEY_LOCAL_MACHINE\SOFTWARE\Garmin\MapSource\Families\GroundTruth Maps”. This path is not correct. It must be at Windows 7 x64 “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Garmin\MapSource\Families\GroundTruth Maps”. The part “Wow6432Node\” is necessary.
Best Regards!
Rene
breki on 05 Apr 2010 at 8:17 #
@Rene,
You’re right – it will be fixed. Thanks for reporting.
wshamasneh on 06 Jun 2010 at 13:57 #
Hi All:
How to pass the proxy server, port, username and password to use the following commad “groundtruth getdata –bu “url from clipboard”"? Since I am working in a company with a proxy server with user name and password.
Thank for all.
breki on 09 Jun 2010 at 15:31 #
Unfortunately you can’t, I’ll add this to the “to do” list for a future release.
elmax on 14 Jan 2011 at 10:41 #
Hi Breki
I see that you were planning to include support for SRTM1 in Groundtruth but there has not been any new release in a while. I’m very interested in this feature, is this still planned to include it in a further release ? Thanks for the great work !
breki on 18 Jan 2011 at 14:26 #
@elmax,
I haven’t done any work on GroundTruth for a year now. I’ll try to produce something in the next few weeks.
elmax on 03 Feb 2011 at 9:43 #
Hi Breki, Thanks for your reply. Another problem that I noticed is that landuse build with multipolygons is not rendered in groundtruth. For instance this object http://www.openstreetmap.org/browse/relation/288179 does not appear on the Garmin map. I tried to fix the rule by adding “or relation:{{tag|landuse|forest}}” to the Forest area, but that didn’t help. Any advice ?
breki on 03 Feb 2011 at 10:30 #
@elmax,
GroundTruth’s multipolygon handling code is pretty old, I’ll try to upgrade it with the one from Maperitive.
Flint Eastwood on 10 Sep 2011 at 23:07 #
Hi breki,
I got a problem with groundtruth. It is very slow on my pc. It takes only 12% CPU-usage and around 20-30MB RAM.
I tried to generate contour-lines for south and middle of europe – nearly 4500 tiles (1 x 0.5 grid – first pass contours – second pass ibf2osm). The prog was running 7 hours and produced 2200 tiles when I stopped it frustrated.
Then I splitted the map bounds into 8 instances of GroundTruth – running simultaneously. Now CPU-Usage was at 100% and the full job was done in 1h 45 min. The only problem is, that the 8 instances try to write into the same Logfile – so I got a lot errors logfile’s beeing used by another process.
Maybe you could add commandline-options for logfilename and temp-dir (I had an tempfile-error when I first tried that “multithreading” – but later I never got that again). An internal multithreading would be fine too (as it is in mkgmap (max-jobs) ).
And is there a way to change the filename-counter? The osm-tiles are named 1,2,…,10,11,…,100,101,… For use in mkgmap I have to rename them all. Why not change the counter to this: 0001,0002,…,0010,0011,…,0100,0101,… ?
By the way: Is there an easier way to include viewfinder dem? An option to enter a Dir with additionally DEM? I had to run groundtruth first for downloading NASA DEM and then I was able to copy the Viewfinder data into the Cache-Dir and run GT again. My first try copying Viewfinder DEM to the cache-dir without having a Tile-Index was stopped by an error.
My Specs: Intel Core I7 870 (4×2,8Ghz + Turbo + HT) 4GB-DDR3-1333 Asus Sabertooth55i 2x 500GB 7200UPM HDDs in RAID0 Win7 HomePremium 64bit
Flint Eastwood on 11 Sep 2011 at 8:58 #
Sorry, I allready have another question:
How can I make contour-lines for Scandinavia or Island? I can’t copy Viewfinder data to the cache because GT seems not even to try downloading data above N60 . So the parts are not in the Tile-Index and when I start GT with copied Viewfinder-Data, I get this error: Generating contours for area (-32, 61, -31, 61.5) ERROR: System.ArgumentException: An item with the same key has already been adde d. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.Dictionary
2.Insert(TKey key, TValue value, Boo lean add) at Brejc.DemLibrary.Srtm.SrtmSourceBase.FetchCachedCellsList() at Brejc.DemLibrary.Srtm.SrtmSourceBase.LoadDemForArea(Bounds2 bounds) at Brejc.DemLibrary.IntelligentDemProvider.LoadDem(Bounds2 bounds) at Brejc.DemLibrary.Ibf.IbfUtilities.GenerateAreaDefinitions(IbfFile ibfFile, IRasterDemProvider rasterDemProvider, GenerateIbfAreaDefinitionsParameters para meters) at GroundTruth.Engine.Ibf.DefaultIbfGenerator.Run(IbfGenerationParameters par ameters) at GroundTruth.GenerateContoursCommand.Execute(IEnumerable1 args) at GroundTruth.ConsoleApp.Process()breki on 13 Sep 2011 at 6:58 #
@Flint,
I haven’t done any new work on GroundTruth for a long time. Any new functionality will probably be added in Maperitive, which already supports custom DEMs like ViewFinder: http://maperitive.net/docs/manual/Commands/SetDemProvider.html
Henk van der Schee on 16 Jan 2012 at 13:27 #
Dear Igor, Breki,
The groundtruth program seems ideal to add contourmaps. However, running the groundtruth for dummies example give a connection error to the server. I presume it is not a firewall problem ast the contour map (.ibf) gets through. I reloaded net3.5, but that did not help.
C:\Program Files\GPS\GroundTruth-1.8.740.17>groundtruth getdata –bu “http://www.openstreetmap.org/?lat=46.4951&lon=15.5395&zo om=12&layers=B000FTF”
GroundTruth v1.8.740.17 by Igor Brejc Generates Garmin maps from OpenStreetMap data Licensed under GPL v3 license Visit http://wiki.openstreetmap.org/wiki/GroundTruth for more info
Read 0.0 B so far… ERROR: System.Net.WebException: Unable to connect to the remote server —> System.Net.Sockets.S ocketException: Een verbindingspoging is mislukt omdat de verbonden party niet correct heeft geantwoord na een bepaalde tijd, of de gemaakte verbinding is mislukt omdat de verbonden host niet heeft geantwoord 128.40.168.97:80 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& a ddress, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) — End of inner exception stack trace — at System.Net.HttpWebRequest.GetResponse() at Brejc.OsmLibrary.Osmxapi.OsmxapiClient.DownloadData(Stream outputStream) at GroundTruth.DownloadOsmDataCommand.Execute(IEnumerable`1 args) at GroundTruth.ConsoleApp.Process()
Regards, Henk
breki on 17 Jan 2012 at 16:37 #
@Henk,
I’ve noticed these kinds of errors myself. I will have to take day or two to get back to GroundTruth code and try to fix this.
Pprik on 02 Feb 2012 at 22:06 #
I’m having the same problem. Is there a workaround?
Regards, Prik
breki on 03 Feb 2012 at 9:30 #
Pprik,
No, but the good news is that I’ve finally started to work on GT code.
Pprik on 03 Feb 2012 at 19:14 #
breki,
Great thanks for making the time.