Welcome, Guest. Please login or register.

Login with username, password and session length
Forums Search:  


Author Topic: Free MP to IMG converter with routing support??  (Read 17684 times)

dhisum_dhisum

  • Mapper
  • ***
  • Posts: 71
  • Karma: 0
    • View Profile
Free MP to IMG converter with routing support??
« on: February 06, 2009, 05:13:43 PM »
I started thinking that since cGPSMapper charges your first born child for the routing version, could we not write a MP to img converter ourselves. I started looking here and there and found a few resources. This page http://wiki.openstreetmap.org/index.php/OSM_Map_On_Garmin/Format lists them all.

I looked yesterday at the MP file format. It is basically a text file with pretty simple format. Sitting for a few hours, I was able to code up something that could load up the MP format files in memory. Now comes the difficult part. The Garmin IMG format is somewhat a mystery and in spite of some people having dug through it, the autorouting/searching part of it seems like a mystery still. Anyone else have any experience in this?
« Last Edit: October 12, 2010, 08:49:05 PM by Indrid Cold »

krellor

  • Guest
Re: Free MP to IMG converter with routing support??
« Reply #1 on: February 07, 2009, 10:19:57 AM »
I have looked at a pdf the goes through what is known of the IMG format.  http://sourceforge.net/projects/garmin-img/

I'll admit, I'm a professional programmer, and writing a comprehensive IMG handler looks daunting.  It could take weeks, but more likely months of work and testing.  The inside of the IMG files are basically little file systems.  I had thought the same thing about making my own converter, but looking at the file specification, it looks like a whole bunch of work.  I guess my problem is that I don't really need routing so for myself, it isn't worth months of hard coding.  That said, if there was enough community support to get it done, I would contribute my skills to an open source project.

Also, the best documented file specification is from 2001, so who knows what has been changed that only those like Stan (cGPSMaker creator) knows about.  That is another few months of uploading maps to GPS units, figuring out what isn't right, and going back to source.  I just don't have the time to do it by myself, and I don't know how many programmers we have here who all know the same languages.  If people want to list the languages they know I guess I'll start and see if there is any overlap.

C
C++
C#
x86 Assembler
VB.net
Cobol
Rexx
Natural

And a few other scripting languages.

-Oz-

  • Map Maker!
  • Administrator
  • Expert Advisor
  • *****
  • Posts: 1577
  • Karma: 27
    • View Profile
    • GPSFileDepot
Re: Free MP to IMG converter with routing support??
« Reply #2 on: February 07, 2009, 12:24:53 PM »
I'm looking for something that takes the shapefiles and makes them into .mp easily :)

But this would be awesome
Dan Blomberg
Administrator - GPSFileDepot
GPS Units: Garmin Dakota 20, Garmin GPSMap 60csx, Nuvi 255W, Nuvi 250W, ForeRunner 110, Fenix 2, Tactix Bravo, Foretrex 401
See/Download My Maps!

dhisum_dhisum

  • Mapper
  • ***
  • Posts: 71
  • Karma: 0
    • View Profile
Re: Free MP to IMG converter with routing support??
« Reply #3 on: February 07, 2009, 01:54:54 PM »
I looked at the sourceforge document as well. It does look daunting but there are some open source implementations. Maybe we can use them as reference of build on top of that. I write software for a living too and I am good with C/C++, C# and have used  Java, python, perl etc. a while back I taught assembly long back, and it is still not all lost from my head.

Oz,

Why would shapefile to MP be useful? The shapefile format seems to be well documented:
www.esri.com/library/whitepapers/pdfs/shapefile.pdf

There seems to be a C library to deal with shapelib here:
http://shapelib.maptools.org/

-Oz-

  • Map Maker!
  • Administrator
  • Expert Advisor
  • *****
  • Posts: 1577
  • Karma: 27
    • View Profile
    • GPSFileDepot
Re: Free MP to IMG converter with routing support??
« Reply #4 on: February 07, 2009, 03:35:23 PM »
Because then I could try to automate the entire process and not have to wait for it to open in global mapper or the like to get it back out to .mp files.
Dan Blomberg
Administrator - GPSFileDepot
GPS Units: Garmin Dakota 20, Garmin GPSMap 60csx, Nuvi 255W, Nuvi 250W, ForeRunner 110, Fenix 2, Tactix Bravo, Foretrex 401
See/Download My Maps!

John_M

  • Jr. Member
  • **
  • Posts: 25
  • Karma: 0
    • View Profile
Re: Free MP to IMG converter with routing support??
« Reply #5 on: February 07, 2009, 04:42:46 PM »
Oz

The shareware version of cgpsmapper is only 30$ and has support for shapefiles. Having cgpsmapper read the shapefile is how my workflow runs.

krellor

  • Guest
Re: Free MP to IMG converter with routing support??
« Reply #6 on: February 07, 2009, 05:19:25 PM »
dhisum_dhisum, if you are interested in trying to write something like this then I'll help.  I think we would probably want to write it in C.  What are your thoughts on it?

-Oz-

  • Map Maker!
  • Administrator
  • Expert Advisor
  • *****
  • Posts: 1577
  • Karma: 27
    • View Profile
    • GPSFileDepot
Re: Free MP to IMG converter with routing support??
« Reply #7 on: February 07, 2009, 05:43:08 PM »
Oz

The shareware version of cgpsmapper is only 30$ and has support for shapefiles. Having cgpsmapper read the shapefile is how my workflow runs.


Does it read the MP_TYPE column from it or?

And I don't know C (know php/sql/vb) but for a project like this I'd probably learn.
Dan Blomberg
Administrator - GPSFileDepot
GPS Units: Garmin Dakota 20, Garmin GPSMap 60csx, Nuvi 255W, Nuvi 250W, ForeRunner 110, Fenix 2, Tactix Bravo, Foretrex 401
See/Download My Maps!

John_M

  • Jr. Member
  • **
  • Posts: 25
  • Karma: 0
    • View Profile
Re: Free MP to IMG converter with routing support??
« Reply #8 on: February 07, 2009, 06:38:40 PM »

Does it read the MP_TYPE column from it or?

And I don't know C (know php/sql/vb) but for a project like this I'd probably learn.


This is part of the mp file I use that reads in a shapefile. You tell it what column to use

[SHP]
name=nhd_waterbody401221
Type=RGN80
LabelField=name
TypeField=mp_type
Level=0
EndLevel=3
[END]

-Oz-

  • Map Maker!
  • Administrator
  • Expert Advisor
  • *****
  • Posts: 1577
  • Karma: 27
    • View Profile
    • GPSFileDepot
Re: Free MP to IMG converter with routing support??
« Reply #9 on: February 07, 2009, 07:51:20 PM »
oh, cool, thanks.
Dan Blomberg
Administrator - GPSFileDepot
GPS Units: Garmin Dakota 20, Garmin GPSMap 60csx, Nuvi 255W, Nuvi 250W, ForeRunner 110, Fenix 2, Tactix Bravo, Foretrex 401
See/Download My Maps!

dhisum_dhisum

  • Mapper
  • ***
  • Posts: 71
  • Karma: 0
    • View Profile
Re: Free MP to IMG converter with routing support??
« Reply #10 on: February 09, 2009, 02:00:06 PM »
Krellor, i have been thinking on this. I think C is a good language to code this in. However, C# would probably be a lot faster as it has support for a lot of data structures directly built in. For performance critical sections, we could always write the performance critical sections  using COM and COM interop. I started reading the garmin-img doc and doing a little hex reading of the IMGs that I have. It would probably make sense to read one of the city navigator IMGs to understand how the routing thing works.

What do you think?

Regarding Oz's thoughts on Shapefile to MP conversion, Someone already wrote a .NET wrapper on type of the shapelib. Maybe one of these days, I will just use that to write the v0.1 version for converting shapefile to MPs

-Oz-

  • Map Maker!
  • Administrator
  • Expert Advisor
  • *****
  • Posts: 1577
  • Karma: 27
    • View Profile
    • GPSFileDepot
Re: Free MP to IMG converter with routing support??
« Reply #11 on: February 09, 2009, 10:30:37 PM »
Yea, I'd say definitely start with just .mp to .img; then add searching for POIs and stuff; then do routable; I'd sell the routable version (but for maybe $100 or something small).
Dan Blomberg
Administrator - GPSFileDepot
GPS Units: Garmin Dakota 20, Garmin GPSMap 60csx, Nuvi 255W, Nuvi 250W, ForeRunner 110, Fenix 2, Tactix Bravo, Foretrex 401
See/Download My Maps!

maps4gps

  • Expert Advisor
  • *****
  • Posts: 1524
  • Karma: 17
    • View Profile
Re: Free MP to IMG converter with routing support??
« Reply #12 on: February 10, 2009, 07:08:54 AM »
This may not be a big concern if you use the Census Tiger data for roads.  They appear to divide ever line by any/ever other line that intersects.
« Last Edit: July 10, 2010, 10:09:31 PM by Indrid Cold »

krellor

  • Guest
Re: Free MP to IMG converter with routing support??
« Reply #13 on: February 10, 2009, 09:10:17 AM »
Well, in my mind routing is way down the road.  The first step will be to better understand the IMG format, and start work on a mp to img converter. 

dhisum_dhisum, C# would work fine for me.  I am a big fan of C#.  My main concern is indeed the memory management aspect of it.  Your solution for that seems fine to me.  We could even maybe get around doing that by creating our own swap files in C# if the problem is simply storing a large amount of data in memory.  I admit that I do find it frustrating that many of these programs try to operate entirely in volatile memory.  I know that performance can take a hit using swap file, but at least the job gets done on machines with less RAM.  Maybe it could be option at run time to use a swap file or not.

For now, I am still reading up on the IMG format specifications.