From OpenStreetMap Wiki
Jump to navigation Jump to search


Conditional text for labels (1)

I would like to write a rule which says: if this feature has a name, use it for the label; otherwise use some fixed text. This could be useful e.g. for churches, hospital, chemistry etc. The syntax could be something like this:


Which means: if name is set, use it; otherwise use the fixed string "Hospital". Ideally this rule can be used in conjunction with +++ operator.

I will try to incorporate something like this. --Breki 18:02, 13 March 2009 (UTC)

Conditional text for labels (2)

Instead of the previous wish you could satisfy this wish instead: every rule should have two label columns. The first one should read "label" and the second one "default label" (or similar texts). The first column ("label") should behave exactly as it behaves now: it should add the feature label in the MP file. The second column ("default label") should be a static text (no variable substitution, just a plain static string) which gets added as "string1" in the TYP file: this string is used for default labels when the feature does not have a label. As an added bonus, support "string2", "string3" and "string4" to support up to 4 different languages (see cGPSmapper manual, section 12.3.4). This wish should be simpler than the previous one, but could make old rules incompatible with a new version.

Arithmetic for selectors

Currently we can check whether a key exists and has some values. I would like to test for inequality with number constants, e.g.

population<100000 and population>=10000

This could be useful e.g. for cities where the one could write different rules with respect to population, or for roads with respect to maxspeed.

I've been looking for a good (and quick) expression parsing .NET library ever since I started working on Kosmos. When I find one, I'll include this and the feature you describe below --Breki 18:02, 13 March 2009 (UTC)
I have never played with them, but you could check either [1] or [2]. They both look promising.

Geographic-computable selectors

I would like to introduce a new namespace for selectors, similar to relation:, which could be named geo:. New selectors within this namespace could be geo:length, geo:area and so on. These selectors should be computed at run-time from the feature itself using some algorithms: e.g. geo:length could compute the way's length. This could be useful combined with arithmetic to write a selector like this:


One could write different rules for landuse, lakes, rivers, etc.

Improved handling of TYP files

Currently GroundTruth requires at least a color for each area rule. This is not strictly needed in TYP files: every section, except drawOrder, is optional; if a specific section is missing, the GPS unit / MapSource use the default style (first sentence of section 8.2 of cGPSmapper manual). Currently I am not able to use default Garmin area styles because GroundTruth requires a colour at least. I have not checked whether a similar problem currently applies to lines. I know that points work fine: GroundTruth (correctly) does not need a custom icon.

Downloading large map viewports

If the viewport is large, downloading is cancelled and the line "<error>Query limit of 1,000,000 elements reached</error>" ends the OSM file, which is corrupted and useless by this. It's surely not a problem of groundtruth but the server, but maybe there can be a workaraound? Unmapped 23:33, 8 November 2009 (UTC)

This error is reported by OSMXAPI since it limits how much data can be downloaded in one go - the idea is to prevent overloading of OSMXAPI servers. The only option I see it to split the download into smaller map areas and then merge them back, but I will leave this to users themselves, for several reasons:
  1. This workaround would effectively circumvent a protection mechanism that I think should not be circumvented, since it is in our common interest to have responsive OSMXAPI servers.
  2. There are other ways to get OSM data, for example using planet extracts (you can cut them to the needed area using osmosis)
  3. There are other better tools for splitting and merging of OSM data (again osmosis)

I realize this is not very user-friendly, but then again GroundTruth in itself is not a very user friendly tool - it requires a certain level of manual effort from users. --Breki 13:15, 11 November 2009 (UTC)

ok, I see. I will try to find a way. And maybe the server admins will think about a dynamic limit, as the zoom level I can download is 10, which is not really a large area. Unmapped 20:03, 11 November 2009 (UTC)


Could you please describe the license of GroundTruth? The license/ directory contains the Apache License, the MIT License, the GNU LGPL, some "Shared Source License", and the GNU GPL. If I understand correctly they apply to various parts used by the application. Are they compatible? What is the license of GroundTruth as a whole (GNU GPL, I guess)? --Lutz.horn 13:33, 12 March 2009 (UTC)

The licenses you mention are for 3rd party software used by GroundTruth. BTW: SharpZipLib's GPL has an exception which effectively means GroundTruth is not bound to GNU GPL under the terms of its usage. I haven't yet decided on the license (I know, it's silly), but it will probably be BSD/MIT. The next release of GroundTruth (which should be soon) will have the license and the source code available. --Breki 18:06, 12 March 2009 (UTC)

Publishing maps made by GroundTruth

Do I see this correctly that is a violation of copyright if one publishes a map created by Groundtruth? (except if one buys one of the expensive cgpsmapper licenses ?). Cgpsmapper Free forbids commercial use of the maps produced with it, on the other hand any map based on must be distributable also commercially! Or would it be enough to offer the used map data for the map as additional download ?--Extremecarver 16:12, 11 November 2009 (UTC)

The last time I checked cgpsmapper's license (for the free version), there was no restriction in publishing maps for non-commercial purposes. What do you mean by "any map based on must be distributable also commercially"? --Breki 22:21, 11 November 2009 (UTC)
cgpsmapper free has always only been for non-commercial purposes
"Download Free cGPSmapper version 0099a for Windows | Download exe only (version 0099a)
This is the basic version of the program which allows to create maps which are compatible with Garmin GPS receivers - no needs to pay for other versions if you want just to create a basic map! Now the Free version supports creation of basic marine maps and/or use of extended types
This version is solely for non commercial use only! Be sure to read the terms of use before downloading this software. By downloading you agree with the terms of use."
(3) use of the cGPSmapper Software for
preparing maps for sale or license to a third party, or (4) use of
the cGPSmapper Software to provide any service to an external
organisation for which payment is received.
Even if the map author does not intend to make money from the maps, as far as I understand you are then not allowed to pass on any maps, as openstreetmap data must be given on under the same license (CCBYSA 2.0) and that license allows commercial use of the map data or products thereof as long as you leave the map data under the same license. Using cgpsmapper free to my understanding is therefore incompatible with the openstreetmap CCBYSA 2.0 license (and also the new odbl license).
Share Alike — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.CCBYSA 2.0
Therfore clearly using cgpsmapper is not possible if you ever plan to give OSM maps made by cgpsmapper to a 3. person.--Extremecarver 18:25, 12 November 2009 (UTC)
Yes, you may be right, unfortunately. Looks like I'm going to have to pull down my maps of Slovenia and add some license warnings in the Wiki. --Breki 14:14, 13 November 2009 (UTC)
Well the right to "commercialise" OSM data is the reason why we all have to do loads of efforts with the contourlines as seperate downloads/layers..., You could of course ask Stan if he makes an explicit exception for openstreetmap data based maps.--Extremecarver 16:24, 13 November 2009 (UTC)
I guess he would answer with "buy a commercial version of cgpsmapper" :). Maybe I'll ask him nevertheless. As for contours: I think they should be separate in any case: contour maps don't change and it's wasteful to keep regenerate them and force people to re-download them every time OSM data changes. --Breki 17:26, 14 November 2009 (UTC)
Well as I wrote in a comment to you quite some time ago, I don't understand why cgpsmapper at all. Mkgmap still has some flaws (e.g. address search not yet fully functional on GPS, though it does work well in Mapsource) or some problems with routing over tile boarders but many other features that even the commercial 2800$ version of cgpsmapper is missing. So I cannot see the point in using cgpsmapper anyhow. There is nothing except ESRI support that the free version of cgpsmapper can do that mkgmap can't do (well some TYPFile rendering stuff, but or maptk do it much better and have no such license restrictions - is even open source).
I used mkgmap for some time but was frustrated with certain things. I used cgpsmapper because I couldn't find any other way to generate IMG and TYP files from some kind of text input file (like .MP). Basically as a user I want to specify a single rules file and let the tool do all the work for me, not by manually combining 2-3 separate tools - it's just to fiddly. --Breki 19:40, 14 November 2009 (UTC)
Well you could add the code to generate typfiles into mkgmap - shouldn't be too difficult. However I don't think mp gives osm fair justice. It is too limited. Actually Garmin img can support much more then what you can consider clean mp. Also cgpsmapper doesn't correct many OSM data bugs (at least when I tried it) and I had cgpsmapper producing maps that crashed my GPS or locked Mapsource. Mkgmap now more or less corrects all those bugs. Also I see no reason at all why you should not directly convert osm to *.img. Converting to mp has no scripts nearly as capable as mkgmap style-file - Also ground-truth is severly limited compared to what you can do with mkgmap style-files (overlays, continue function, conditional rules,....).
The reason for not converting directly to .img is very simple: it's a closed-source format and I don't have the time to do reverse engineering, since this is not my main project. As for GT limitations: since it shares code with Kosmos, any new features added to Kosmos will also be shared with GT. And anyway, I'm not sure it's that limited compared to mkgmap. Maybe you should take a look at GT's hiking rules and make a simple estimate of how much time an ordinary user would need to prepare similar maps using mkgmap + +... I developed GT primarily for my own needs and I'm fairly satisfied with the produced maps. When I worked with mkgmap, it took me much more time to produce such maps (and BTW back then it didn't have conditional rules) and the look and feel on Garmin unit wasn't very good, it was difficult to distinguish map features. --Breki 06:49, 15 November 2009 (UTC)
I contacted Stan/Marcin of cgpsmapper mapcenter(2) due to the openstreetmap based maps that they are offering for download. They will change their license regarding mapcenter 2 to allow dual licensing with CCBYSA 2.0 for openstreetmap based maps. I now also asked whether they will do the same for maps created with cgpsmapper free. The contact has been very professional and forecoming. I'll update this here if they do change their terms for cgpsmapper free/personal/shareware version too. --Extremecarver 15:34, 18 November 2009 (UTC)
Great, thanks for the help. Anyway, I got some twitter feedback that mkgmap supports generating from polish files (for non-routing too) link, I'll check it out when I get some free time. --Breki 21:12, 23 November 2009 (UTC)

Multiple relations

Hi there, GroundTruth is an excellent tool! I like the possibilities based on the rules very much. I have just one problem: If a way is member of multiple relations, it is just recognised as a member of the first relation in the order of the osm-file. For example a way is member of an ncn-network-bicycle route and of an rcn-network-route. GroundTruth is recognising it just as a member of an ncn-route or as a member of an rcn-route. If it is recognised as a member of an rcn-route, it will not be recognised as a member of an ncn-route too. If I want to highlight the ncn-routes, this way will be missed.

Hmmm good question. I haven't really tested this scenario. I'll add it to the "todo" list for the next release, thanks for the report --Breki 17:58, 13 March 2009 (UTC)

Run under Linux

Because I don't found anything on this question, I tried to run it on a Debian Squeeze, with GT version 1.7.702.14 (not tested with other versions). It run without any problem. I just ran with this command line:

 mono GroundTruth.exe <command> <options>

I don't use GT to make map (so, this is not tested), but to generate OSM contours from the NASA SRTM.

I don't know where to post it, so I write on the discussion page. --Lolo 32 09:12, 15 January 2010 (UTC)


I use GroundTruth to generate hiking maps. It's great tool, but unfortunately it stopped working for my country (Poland) this weekend. I tried to compile newest map and go map some more but instead I got this nasty bug in log:

2010-04-27 18:52:53,647 DEBUG [1] GroundTruth.Engine.ProgramRunner - Running program .\cpreview.exe ('"E:\Varia\GPS\GroundTruth-1.8.740.17\Drivin\Temp\455_pv.txt"') for the maximum duration of 60 minutes
2010-04-27 18:52:53,647 DEBUG [1] GroundTruth.Engine.ProgramRunner - Setting working directory to 'E:\Varia\GPS\GroundTruth-1.8.740.17\Drivin\Temp'
2010-04-27 18:52:54,101 DEBUG [5] GroundTruth.Engine.ProgramRunner - [exec] *******************************************************************************
2010-04-27 18:52:54,101 DEBUG [5] GroundTruth.Engine.ProgramRunner - [exec] cGPSMapper home page:
2010-04-27 18:52:54,101 DEBUG [5] GroundTruth.Engine.ProgramRunner - [exec] *******************************************************************************
2010-04-27 18:52:54,101 DEBUG [5] GroundTruth.Engine.ProgramRunner - [exec] Preview & index builder for cGPSmapper - 6.2
2010-04-27 18:52:54,101 DEBUG [5] GroundTruth.Engine.ProgramRunner - [exec]
2010-04-27 18:52:54,101 DEBUG [5] GroundTruth.Engine.ProgramRunner - [exec] Indexer compatible with cgpsmapper0098 version only
2010-04-27 18:52:54,147 DEBUG [5] GroundTruth.Engine.ProgramRunner - [exec] Codepage set to: 1250
2010-04-27 18:52:54,147 DEBUG [5] GroundTruth.Engine.ProgramRunner - [exec] TDBProcessing: 00235020.img
2010-04-27 18:52:54,398 DEBUG [5] GroundTruth.Engine.ProgramRunner - [exec] trying to read after file
2010-04-27 18:52:54,398 DEBUG [5] GroundTruth.Engine.ProgramRunner - [exec] Fatal error reading IMG file - please report to
2010-04-27 18:52:54,429 DEBUG [3] GroundTruth.Engine.ProgramRunner - [exec]
2010-04-27 18:52:54,429 DEBUG [5] GroundTruth.Engine.ProgramRunner - [exec]
2010-04-27 18:52:54,491 ERROR [1] GroundTruth.ConsoleApp - ERROR: System.ArgumentException: Map making failed.
at GroundTruth.Engine.ProgramRunner.RunExternalProgram(String programExePath, String workingDirectory, String commandLineFormat, Object[] args)
at GroundTruth.Engine.MapMaker.RunCPreview(String commandLineFormat, Object[] args)
at GroundTruth.Engine.Tasks.GeneratePreviewAndTdbFilesTask.Execute(ITaskRunner taskRunner)
at GroundTruth.Engine.MapMaker.Run()
at GroundTruth.MapMakingCommand.Execute(IEnumerable`1 args)

This is confusing because it looks like img file is damaged, yet no error was shown, and I'm able to use img files to create mapset working in MapSource with external tools, and I can open img file with no problems at all. To add some spice Czech republic gets compiled with no problem. Worklflow for me looks like that - download data from geofabrik, split with mkgmap's tile splitter and compile with GroundTruth. Error occured first on Sunday, and is present ever since. Jaszczur666 19:45, 28 April 2010 (UTC)

Hi, this looks like a problem with cGPSmapper's cpreview.exe tool (it is the one which is reporting the "Fatal error reading IMG file" error). Have you switched to a new version of cGPSmapper lately or has this started to happen just because of the new OSM file? --Breki 15:26, 30 April 2010 (UTC)

I thought for a while and realized that I've updated all binaries recently to 0100b version. After playing with older versions and finally keeping new cgpsmapper and downgrading cpreview to 096a GroundTruth works again. I thought that bug that You spotted in march last year was fixed in version 0100b. It seems that is not fixed, at least not fully. I used binary version for new processors. My machine is quad core Phenom so I think it's "new". Jaszczur666 11:58, 1 May 2010 (UTC)

OK, my suggestion is to contact the author of cGPSmapper and send him the 455_pv.txt file (it should be in the Temp directory) and let him know about this. --Breki 11:12, 3 May 2010 (UTC)

ERROR: System.NotSupportedException

When I try to generate the srtm data for Baltic Countries (bounds="53.8,19.5,60.0,28.5") I am getting the following error:

ERROR: System.NotSupportedException: Only area directory type 0 is currently supported.

  at Brejc.DemLibrary.Ibf.IbfUtilities.Open(String fileName)
  at GroundTruth.Engine.Ibf.Ibf2Osm.DefaultIbf2OsmGenerator.LoadIbfFile()
  at GroundTruth.Engine.Ibf.Ibf2Osm.DefaultIbf2OsmGenerator.Run(Ibf2OsmGenerationParameters parameters)
  at GroundTruth.Ibf2OsmCommand.Execute(IEnumerable`1 args)
  at GroundTruth.ConsoleApp.Process()

All the other countries in Europa are generated without any error. Is this Error known? --WalterSchloegl (talk) 21:46, 28 January 2015 (UTC)