Running mkgmap in Eclipse

Hi, this is my first foray into looking at the mkgmap code so please bear with. I'm trying to run mkgmap in an Eclipse workspace and I've downloaded the r1899 source archive as a starting point. I'm getting a load of errors, mostly around a number of crosby* libraries missing. Is there somewhere I can look to find out what I need to do to pull together a working environment? Also, is Eclipse a suitable IDE for this? It's what I've been working with for the last couple of years so it is comfortably familiar at least. Any help appreciated. Walter

On 23/03/2011 10:30, Walter Wright wrote:
Hi, this is my first foray into looking at the mkgmap code so please bear with. I'm trying to run mkgmap in an Eclipse workspace and I've downloaded the r1899 source archive as a starting point. I'm getting a load of errors, mostly around a number of crosby* libraries missing. Is there somewhere I can look to find out what I need to do to pull together a working environment? Also, is Eclipse a suitable IDE for this? It's what I've been working with for the last couple of years so it is comfortably familiar at least. Any help appreciated. Walter
I don't tend to build my own version much but I have got it to work in Eclipse. Last time I built mkgmap (a few months ago) I noted down the steps I had taken. I've taken a copy of those steps and put them into the wiki. They may help (either directly or as a starting point for somebody to expand into a fuller explanation).

When I did it (November last year) I just commented out the PBF references because I knew I wasn't going to be using PBF format files at any stage (this may not work for you of course). I vaguely recollect form this list that later mkgmap versions handle the lack of PBF libraries better if they're not available (but may be completely misremembering that - best to check the list archives). I'm guessing that you've found and had a read of stuff like http://github.com/scrosby/OSM-binary , http://code.google.com/p/protobuf/ , http://wiki.openstreetmap.org/wiki/PBF_Format aleady? Other possible gotchas: o I set the compiler level to 1.6 (the default may not be 1.6 if you've primarily used Eclipse for something else). o I had to install ant (it wasn't part of the "general Java" eclipse that I'd been using). I doubt that either of these are relevant if you've been using Eclipse for ages, but just in case... Cheers, Andy

Last time I built mkgmap (a few months ago) I noted down the steps I had taken. I've taken a copy of those steps and put them into the wiki.
Do you mean this page http://wiki.openstreetmap.org/wiki/Mkgmap/dev? On 23 March 2011 11:53, MarkS <OSM@redcake.co.uk> wrote:
On 23/03/2011 10:30, Walter Wright wrote:
Hi, this is my first foray into looking at the mkgmap code so please bear with. I'm trying to run mkgmap in an Eclipse workspace and I've downloaded the r1899 source archive as a starting point. I'm getting a load of errors, mostly around a number of crosby* libraries missing. Is there somewhere I can look to find out what I need to do to pull together a working environment? Also, is Eclipse a suitable IDE for this? It's what I've been working with for the last couple of years so it is comfortably familiar at least. Any help appreciated. Walter
I don't tend to build my own version much but I have got it to work in Eclipse.
Last time I built mkgmap (a few months ago) I noted down the steps I had taken. I've taken a copy of those steps and put them into the wiki. They may help (either directly or as a starting point for somebody to expand into a fuller explanation).
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

That's the page. (and I'll freely admit it isn't anything more than a starting point) On 23/03/2011 14:15, Walter Wright wrote:
Last time I built mkgmap (a few months ago) I noted down the steps I had taken. I've taken a copy of those steps and put them into the wiki. Do you mean this page http://wiki.openstreetmap.org/wiki/Mkgmap/dev?
On 23 March 2011 11:53, MarkS <OSM@redcake.co.uk <mailto:OSM@redcake.co.uk>> wrote:
On 23/03/2011 10:30, Walter Wright wrote: > Hi, this is my first foray into looking at the mkgmap code so please > bear with. I'm trying to run mkgmap in an Eclipse workspace and I've > downloaded the r1899 source archive as a starting point. I'm getting a > load of errors, mostly around a number of crosby* libraries missing. Is > there somewhere I can look to find out what I need to do to pull > together a working environment? > Also, is Eclipse a suitable IDE for this? It's what I've been working > with for the last couple of years so it is comfortably familiar at least. > Any help appreciated. > Walter >
I don't tend to build my own version much but I have got it to work in Eclipse.
Last time I built mkgmap (a few months ago) I noted down the steps I had taken. I've taken a copy of those steps and put them into the wiki. They may help (either directly or as a starting point for somebody to expand into a fuller explanation).
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk <mailto:mkgmap-dev@lists.mkgmap.org.uk> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi On 23/03/11 10:30, Walter Wright wrote:
Hi, this is my first foray into looking at the mkgmap code so please bear with. I'm trying to run mkgmap in an Eclipse workspace and I've downloaded the r1899 source archive as a starting point. I'm getting a load of errors, mostly around a number of crosby* libraries missing. Is there somewhere I can look to find out what I need to do to pull together a working environment?
The splitter project contains the jar files you need. I've not got around to including them directly into the mkgmap project as they are required to build it (the files that use it can be excluded and it will still work). The jar files you need are protobuf.jar and osmpbf.jar which are located in the lib directory of the splitter project. http://svn.mkgmap.org.uk/splitter/trunk
Also, is Eclipse a suitable IDE for this? It's what I've been working with for the last couple of years so it is comfortably familiar at least.
Yes it will be fine if you are familiar with it. I don't use it myself, so I don't know how you configure the library jar files. ..Steve

Thanks Steve, I'll pull those down and see how I get on. Walter
-----Original Message----- From: mkgmap-dev-bounces@lists.mkgmap.org.uk [mailto:mkgmap-dev-bounces@lists.mkgmap.org.uk] On Behalf Of Steve Ratcliffe Sent: 23 March 2011 14:54 To: Development list for mkgmap Subject: Re: [mkgmap-dev] Running mkgmap in Eclipse
Hi
On 23/03/11 10:30, Walter Wright wrote:
Hi, this is my first foray into looking at the mkgmap code so please bear with. I'm trying to run mkgmap in an Eclipse workspace and I've downloaded the r1899 source archive as a starting point. I'm getting a load of errors, mostly around a number of crosby* libraries missing. Is there somewhere I can look to find out what I need to do to pull together a working environment?
The splitter project contains the jar files you need. I've not got around to including them directly into the mkgmap project as they are required to build it (the files that use it can be excluded and it will still work).
The jar files you need are protobuf.jar and osmpbf.jar which are located in the lib directory of the splitter project.
http://svn.mkgmap.org.uk/splitter/trunk
Also, is Eclipse a suitable IDE for this? It's what I've been working with for the last couple of years so it is comfortably familiar at least.
Yes it will be fine if you are familiar with it. I don't use it myself, so I don't know how you configure the library jar files.
..Steve
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Ok, looking good. I'm down to 1 compilation error, but I'm not sure how to resolve it. In fact, I'm not sure why it's a compilation error at all? MultiHashMap.java: Line 24: Name clash: The method get(K) of type MultiHashMap<K,V> has the same erasure as get(Object) of type HashMap<K,V> but does not override it It's not happy about the method signature: public List<V> get(K key) { ... So far what I've done is:- 1) Import the downloaded source file mkgmap-r1899-src.tar.gz 2) Added the libraries osmpbuf.jar and protobuf.jar 3) Deleted GeoTiffDEM.java (it had 20-odd errors but wasn't referenced from anywhere) That leaves me with the 1 error described above. Any thoughts? Walter
-----Original Message----- From: mkgmap-dev-bounces@lists.mkgmap.org.uk [mailto:mkgmap-dev-bounces@lists.mkgmap.org.uk] On Behalf Of Steve Ratcliffe Sent: 23 March 2011 14:54 To: Development list for mkgmap Subject: Re: [mkgmap-dev] Running mkgmap in Eclipse
Hi
On 23/03/11 10:30, Walter Wright wrote:
Hi, this is my first foray into looking at the mkgmap code so please bear with. I'm trying to run mkgmap in an Eclipse workspace and I've downloaded the r1899 source archive as a starting point. I'm getting a load of errors, mostly around a number of crosby* libraries missing. Is there somewhere I can look to find out what I need to do to pull together a working environment?
The splitter project contains the jar files you need. I've not got around to including them directly into the mkgmap project as they are required to build it (the files that use it can be excluded and it will still work).
The jar files you need are protobuf.jar and osmpbf.jar which are located in the lib directory of the splitter project.
http://svn.mkgmap.org.uk/splitter/trunk
Also, is Eclipse a suitable IDE for this? It's what I've been working with for the last couple of years so it is comfortably familiar at least.
Yes it will be fine if you are familiar with it. I don't use it myself, so I don't know how you configure the library jar files.
..Steve
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Steve, Do you see the compilation error in MultiHashMap.java? If not, it may just come down to my using Eclipse. MultiHashMap.java: Line 24: Name clash: The method get(K) of type MultiHashMap<K,V> has the same erasure as get(Object) of type HashMap<K,V> but does not override it It's not happy about the method signature: public List<V> get(K key) { ... } My experience with generics isn't deep enough to know how to resolve this (while still keeping the intended functionality of MultiHashMap) Walter On 23 March 2011 14:53, Steve Ratcliffe <steve@parabola.me.uk> wrote:
Hi
On 23/03/11 10:30, Walter Wright wrote:
Hi, this is my first foray into looking at the mkgmap code so please bear with. I'm trying to run mkgmap in an Eclipse workspace and I've downloaded the r1899 source archive as a starting point. I'm getting a load of errors, mostly around a number of crosby* libraries missing. Is there somewhere I can look to find out what I need to do to pull together a working environment?
The splitter project contains the jar files you need. I've not got around to including them directly into the mkgmap project as they are required to build it (the files that use it can be excluded and it will still work).
The jar files you need are protobuf.jar and osmpbf.jar which are located in the lib directory of the splitter project.
http://svn.mkgmap.org.uk/splitter/trunk
Also, is Eclipse a suitable IDE for this? It's what I've been working with for the last couple of years so it is comfortably familiar at least.
Yes it will be fine if you are familiar with it. I don't use it myself, so I don't know how you configure the library jar files.
..Steve
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

On 24/03/11 14:11, Walter Wright wrote: Hi Walter
Do you see the compilation error in MultiHashMap.java? If not, it may just come down to my using Eclipse. MultiHashMap.java: Line 24: Name clash: The method get(K) of type MultiHashMap<K,V> has the same erasure as get(Object) of type HashMap<K,V> but does not override it
No I don't see that. Does it really not allow you to compile it? I am suprised since many people use eclipse and it has not been mentioned before. I think that eclipse is wrong in this case, but as with all generics problems I reserve the right to change my mind :) ..Steve

Hi Steve, I'm really baffled about this. To eliminate any conflicts with the rest of the project, I just visited a work colleague, got him to start up a new Eclipse Java 1.6 project and type in just the Class and the get() method declarations. That produces the same error. If there are any fellow Eclipse users watching, I'd be interested to know if anything is reported with respect to this Class (warnings even)?. The version of Eclipse I use was downloaded about 4 weeks ago from the Apache site, so it's not stale. The JVM is version 1.6.0_06. Cheers, Walter On , Steve Ratcliffe <steve@parabola.me.uk> wrote:
On 24/03/11 14:11, Walter Wright wrote:
Hi Walter
Do you see the compilation error in MultiHashMap.java? If not, it may
just come down to my using Eclipse.
MultiHashMap.java: Line 24:
Name clash: The method get(K) of type MultiHashMap has the same erasure
as get(Object) of type HashMap but does not override it
No I don't see that.
Does it really not allow you to compile it? I am suprised since many
people use eclipse and it has not been mentioned before. I think that
eclipse is wrong in this case, but as with all generics problems I
reserve the right to change my mind :)
..Steve
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk

Hi
To eliminate any conflicts with the rest of the project, I just visited
Well does changing get(K key) to get(Object key) make any difference? If so I will just change it to that and move on. I didn't realise when I wrote my last reply that it is HashMap.get(Object key) and not HashMap.get(K key). ..Steve

Hi
To eliminate any conflicts with the rest of the project, I just visited
Well does changing get(K key) to get(Object key) make any difference? If so I will just change it to that and move on.
I didn't realise when I wrote my last reply that it is HashMap.get(Object key) and not HashMap.get(K key).
..Steve
Yes, that's the solution which works in Eclipse Helios (3.6). WanMil

Hi WanMil, Yes, that change works for me. Bizarrely, I tried the non-compiling code in an Interstage IDE (a fairly old Fujitsu Eclipse-based product) and it was fine. Random. Thanks to everyone for the help. Walter
-----Original Message----- From: mkgmap-dev-bounces@lists.mkgmap.org.uk [mailto:mkgmap-dev-bounces@lists.mkgmap.org.uk] On Behalf Of WanMil Sent: 24 March 2011 18:17 To: Development list for mkgmap Subject: Re: [mkgmap-dev] Running mkgmap in Eclipse
Hi
To eliminate any conflicts with the rest of the project, I just visited
Well does changing get(K key) to get(Object key) make any difference? If so I will just change it to that and move on.
I didn't realise when I wrote my last reply that it is HashMap.get(Object key) and not HashMap.get(K key).
..Steve
Yes, that's the solution which works in Eclipse Helios (3.6).
WanMil
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (7)
-
Chris Miller
-
MarkS
-
SomeoneElse
-
Steve Ratcliffe
-
Walter Wright
-
walter.wright@gmail.com
-
WanMil