Small contribution

Hello, As I am new here, I introduce myself. I am the author of a Garmin map made with the well known cgpsmapper. I discovered OpenStreetMap few months earlier and I started to work with mkgmap. My goal is to produce my map with mkgmap. I am not yet ready because of these "problems" : - mkgmap cannot compile one of my big polygons even if I slice it with mapedit. - mkgmap produces bigger files than cgpsmapper. - derspite data come from OSM, routing does not work with my maps in Mapsource (it is not a real problem, I cannot also do that with free cgpsmapper). - mkgmap produces a different draw of the map when compiled with net and route options : roads name appear and cities name are not displayed in Mapsource. For mkgmap routing revision 856 and later : PolishMapDataSource.java (line 405): I found a minor bug in polish format reader : the max resolution is wrong when X != 0 in 'DataX' Here is the code that works for me work : private void setResolution(MapElement elem, String name) { if (endLevel > 0){ elem.setMinResolution(extractResolution(endLevel)); //EMERALDISLAND elem.setMaxResolution(extractResolution(name)); } else { int res = extractResolution(name); elem.setMinResolution(res); elem.setMaxResolution(res); } } I also noticed with an old Mapsource version (6.11.x) that strings defined with map.addInfo() and map.addCopyright() in MapBuilder.java appear in a different order (menu help/about/product info). It might be a bug from Mapsource... When you select a map in Mapsource, the column zone is fielded with "overview map". I activated the option --overview-name and also --product-info. Changes are done in these 2 files : TdbBuilder.java and TdbFile.java TdbBuilder.java : public class TdbBuilder implements Combiner { private static final Logger log = Logger.getLogger(TdbBuilder.class); private OverviewMap overviewSource; private TdbFile tdb; private int parent = 63240000; private String overviewMapname; //EMERALDISLAND private String overviewName; private int tdbVersion; /** * Initialise by saving all the information we require from the command line * args. * * @param args The command line arguments as they are at the end of the list. * In otherwords if the same argument appears more than once, then it will * have the value that was set last. */ public void init(CommandArgs args) { overviewMapname = args.get("overview-mapname", "63240000"); try { parent = Integer.parseInt(overviewMapname); } catch (NumberFormatException e) { log.debug("overview map name not an integer", overviewMapname); } //EMERALDISLAND overviewName = args.get("overview-name", "Overview map"); int familyId = args.get("family-id", 0); int productId = args.get("product-id", 1); String seriesName = args.get("series-name", "OSM map"); String familyName = args.get("family-name", "OSM map"); //EMERALDISLAND short productVersion = (short)args.get("product-version", 100); if (args.exists("tdb-v4")) { tdbVersion = TdbFile.TDB_V407; } else { tdbVersion = TdbFile.TDB_V3; } tdb = new TdbFile(tdbVersion); //EMERALDISLAND tdb.setProductInfo(familyId, productId, productVersion, seriesName, familyName, overviewName); } In private void addToTdb(FileInfo finfo) : // add a space between mapdesc and first ( String desc = mapdesc + ' (' + mapname + ')'; TdbFile.java : Add this private class data : private String overviewName; public void setProductInfo(int familyId, int productId, short productVersion, String seriesName, String familyName, String _overviewName) { headerBlock = new HeaderBlock(tdbVersion); headerBlock.setFamilyId((short) familyId); headerBlock.setProductId((short) productId); headerBlock.setProductVersion(productVersion); headerBlock.setSeriesName(seriesName); headerBlock.setFamilyName(familyName); //EMERALDISLAND overviewName = _overviewName; } Finally, I noticed that Version.VERSION returns 'svn' in mapBuilder.java As I was looking for why my contour lines and summits with altitude in meters in my file (polish format .mp) are displayed in meters divided by 3.2808399 (a feet to meters conversion) - is there a setting to solve this ? - I found the function distance() where the earth is supposed to be a sphere which is a pretty good approximation. After a fast search, I found this interesting link for distance computation : WGS84 distance : http://www.movable-type.co.uk/scripts/latlong-vincenty.html spherical distance : http://www.movable-type.co.uk/scripts/latlong.html In the case I want to contribute to the code (to correct bugs or activate functions for example), how can I do this ? Thank you for your great work. PS : there is also somewhere a string "OMS map" instead of "OSM map", I don't remember which file.

On Feb 13, 2009, at 13:51, David wrote:
As I am new here, I introduce myself.
Welcome!
I am the author of a Garmin map made with the well known cgpsmapper. I discovered OpenStreetMap few months earlier and I started to work with mkgmap. My goal is to produce my map with mkgmap. I am not yet ready because of these "problems" :
- mkgmap cannot compile one of my big polygons even if I slice it with mapedit.
Does mkgmap crash? Could you send the crash output and/or a small sample .mp-file?
- mkgmap produces bigger files than cgpsmapper.
I think mkgmap is not very much optimised for small file size, but how large is the difference? Are you comparing maps generated from .mp for both tools?
- derspite data come from OSM, routing does not work with my maps in Mapsource (it is not a real problem, I cannot also do that with free cgpsmapper).
Routing should now work. You need to use the "--route" option (but you appear to know that), and if you start with a .osm-file, you need to check out the nod branch from svn for the moment. What's going wrong for you?
- mkgmap produces a different draw of the map when compiled with net and route options : roads name appear and cities name are not displayed in Mapsource.
Not sure what's wrong here. Anyone else see this?
For mkgmap routing revision 856 and later :
I haven't looked at these modifications in detail, since I don't know those parts of the code too well. Regarding this:
In the case I want to contribute to the code (to correct bugs or activate functions for example), how can I do this ?
It would be best if you post your changes in patch form: Edit a local checkout of svn, then do "svn diff".
As I was looking for why my contour lines and summits with altitude in meters in my file (polish format .mp) are displayed in meters divided by 3.2808399 (a feet to meters conversion) - is there a setting to solve this ?
No idea... What does an entry for a contour line in a .mp-file look like? I would imagine mkgmap just writes a label, so it's surprising this should be wrong.
- I found the function distance() where the earth is supposed to be a sphere which is a pretty good approximation.
It should be good enough for our purposes. Cheers Robert

On Fri, Feb 13, 2009 at 01:51:46PM +0100, David wrote:
when X != 0 in 'DataX'
That looks good, I've applied that change. Thanks.
When you select a map in Mapsource, the column zone is fielded with "overview map". I activated the option --overview-name and also --product-info. Changes are done in these 2 files : TdbBuilder.java and TdbFile.java
OK I have added this too, except that I changed --overview-name to --overview-description and set it into the TDB and the overview map. Please check if that is what you intended.
As I was looking for why my contour lines and summits with altitude in meters in my file (polish format .mp) are displayed in meters divided by 3.2808399 (a feet to meters conversion) - is there a setting to solve this
I think there may be a flag in the .img that switches between feet and meters. If anyone knows, let me know.
PS : there is also somewhere a string "OMS map" instead of "OSM map", I don't remember which file.
It was in ProductBlock -- fixed. Thanks! ..Steve
participants (3)
-
David
-
Robert Vollmert
-
Steve Ratcliffe