If you were Registered and logged in, you could reply and use other advanced thread options
Hi all,
Back in 2002 someone posted the method detailed below to convert a raster
map to one uploadable in a Garmin gps device. I started fiddling with it but
then changed jobs, had little spare time and forgot about the project. Four
years down the road I came across it again and was wondering about your
experiences with this and if improvement was possible given four past years
of development of software and insight.
In short the method involves
-scanning a map, if needed patching it together with Panavue (obviously if
you already have a digital raster map not needed)
-extract required information (p.e. streets) from map filtering through
color (in Irfan view) and changing it to black&white
-close gaps in lines in Gimp
-vectorize with WinTopo
-convert WinTopo's ASCII export format to different ASCII format required by
cGPSmap (using perl script)
-complete with cGPSmap
A long list of software indeed. However, the advantage to me seems to be
that if you have the software available you dont have to manually trace a
map and that appeals to me for larger maps.
Specifically, I have the following questions
- Is it still necessary to use Perl for ASCII format conversion or is there
a better way to transfer the vector data from WinTopo to cGPSmap?
- Does anyone know of
- a photoshop function that does the same as the Gimp function (see
text below under IPX-closing)
- an improved version of the Perl script?
- any other improvements on this method ?
I already tried tracing the author (johann gruber) online but to no avail...
many thanks best regards,
BN
----------------------------------------------------------------------------
-------------------------------------
Method to convert raster maps 2 vector maps 4 download into Garmin Vista
----------------------------------------------------------------------------
-------------------------------------
From: "johanngruber"
Date: Tue Apr 23, 2002 12:55 am
Subject: How to convert raster maps 2 vector maps 4 download into Garmin
Vista
In the following I will describe how (parts of) a raster map can be
converted to a vector map, which can be downloaded to a Garmin etrex
(Vista). Note that this procedure so far works fine for "line information"
such as streets and rivers. It has to be improved to work also for points
(e.g. cities) and areas (e.g. lakes). Other raster information (e.g. text)
will be hard to translate into a vector map (but streets, rivers, etc. can
be labeled).
Also note, that the procedure involves a lot of programs. Two of them are
not freeware (but...).
So, here is the how-to:
1) Generate image file(s) of your map in GIF-Format.
You can either scan a paper map, save a part of an electronic map (if
supported by the map program) or capture a screen shot of an electronic map
(if saving is not supported by the map program). In either case you should
have a GIF-image at the end. For capturing from screen you can use e.g. Cads
4.0 (free trial version for 30 days).
2) Stitch together multiple images.
In case you had to scan the map in several pieces you can stitch them
together, e.g. using PanaVue Image Assembler V2.05. Don't waste your time
using the automatic align method, use manual aligning instead. Here it is
handy to have a grid in your images, so that you can better align your
images. Note that in the unregistered version this Shareware adds its logo
to the exported image. Maybe you can find a crack somewhere (or does anybody
know a good freeware)? In any case you have to convert the map images from
GIF to BMP format before using PanaVue. The exported image has to be
converted back again from BMP to GIF. For both conversions you can use Irfan
View, which is freeware.
3) Extract the required information from the raster map (e.g streets shown
in red).
a) Load the map into Irfan View.
b) Count the colors in the image (Image->CountColorsUsed). If you have
something between 2 and 20 or 30, then you probably captured your image from
an electronic map and you are fine. If you have millions of colors, then you
probably scanned a paper map. In this case you have to reduce the number of
colors to e.g. 16. But beware I have never used a scanned map!
c) Reduce number of colors (Image->DecreaseColorDepth) to the counted value
(or e.g. to 16 for a scanned map).
d) Edit the palette (Image->Palette->EditPalette). This means set all colors
but red to the background color. Remember, you want to keepthe red color,
because your streets are shown in red!
d) Count the colors again. Now there should be only 2 colors.
e) Reduce number of colors to 2. Now the image is black and white.
f) Increase number of colors (Image->IncreaseColorDepth) to 256 and convert
to Greyscale (Image->ConvertToGreyscale). This step is needed to have a
greyscale image for GIMP in the next step. Otherwise GIMP doesn't work.
to Greyscale (Image->ConvertToGreyscale). This step is needed to have a
h) Save image in BMP format.
i) Exit Irfan View.
4) Close gaps in image.
Usually some other raster colors are printed over parts of the
desired information. That's why the image processed so far probably has some
gaps. Without further processing before vectorizing the image you'll end up
with lots of short vectors. To avoid this and
have few and long vectors the gaps will be closed using GIMP. GIMP (current
version 1.23) is an image editor available under the Gnu license, which
means you don't have to buy it. a) Load the BMP image (the one you saved in
step 3) into GIMP. b) Delete unwanted parts of the image (e.g. text). c)
Right-click on the image and select Filter->IPX-Closing. Now the lines
should be thicker. Repeat this process until all gaps are closed.
d) Save image in BMP format.
e) Exit GIMP.
5) Vectorize the image.
Here it is described how WinTopo v2.12 can be used. Note that this is
limited demo version. But maybe you can find a crack? a) Load the image into
WinTop v2.12.
b) Image->ThinningZjang&SuenMethod. This makes the thick lines thin. c)
Image->Prune. This removes short lines "hanging" from the vectors. Increase
the value until all unwanted short lines are removed. d) Vector->Vectorise.
Finally, this is the vectorization! Play around with the settings in
Image->Prune. This removes short lines "hanging" from the vectors. Increase
the value until all unwanted short lines are removed. d) Vector->Vectorise.
Vector->VectorExtractionOptions to achieve optimum results.
e) File->SaveVectorAs and save in "WinTopo Data File" format. f) Exit
WinTopo.
e) File->SaveVectorAs and save in "WinTopo Data File" format. f) Exit
6) Convert the format of the vector file.
Now you have to convert the vector file from one ASCII format (as exported
from WinTopo) into another ASCII format (as input to GPSmap). On a DOS
prompt do: perl txt2rgn.pl vectors.txt > vectors.rgn The perl-script
txt2rgn.pl is hopefully attached to this post.
7) Complete the resulting vector file (named vectors.rgn in the above
example) according to the documentation of cGPSmap. You can find cGPSmap at
http://gps.chrisb.org/
Now run cGPSmap to generate an image file and run cGPSmap again to construct
a stand-alone map for download into your Vista!
So, what do you think? Any suggestions or improvements. Or has someone come
up with a simpler, yet still cheap procedure?
Johann
Here is txt2rgn.pl:
# PERL script to convert vector data from WinTopo
# export format to input format as expected by GPSmap.
# Usage (on Windows-PC): perl txt2rgn.pl vectors.txt > vectors.rgn
''; # set output field separator
$\ _ "\n"; # set output record separator
$FS =','; $lineCtr = 0;
while (o) {
($Fldl,$Fld2) = split(/[,\n]/, $_, 9999); if (/POLYLINE/) {
++$lineCtr;
# PRINT HEADER AND COORDINATES OF FIRST POINT print ' [RGN40]';
print 'Type=Ox 16';
print 'Dirlndicator=O';
printf "Label=%04i\n", $lineCtr;
$_ _ &GetlineO();
$lon = $Fldl / 1000;
$lat = $Fld2 / 1000;
printf'DataO=(%8.5f,%8.5f)', $lat, $lon; $_ = &GetlineO();
# PRINT HEADER AND COORDINATES OF FIRST POINT do {
$lon = $Fldl / 1000;
Vat = $Fld2 / 1000;
printf ",(%8.5f,%8.5f)", $lat, $lon;
$_ = &GetlineO();
} while ($Fldl ne'END');
# WRITE FOOTER FOR EACH POLY-LINE
printf "\n";
print ' [END-RGN40]'; printf "\n";
} }
sub Getline0 {
if ($getline ok = (($_ = o) ne ")) { ($Fldl,$Fld2) = split(/[,\n]/, $_,
9999);
}
$; }
Bob Newheart wrote:
> Hi all,
> Back in 2002 someone posted the method detailed below to convert a
> raster map to one uploadable in a Garmin gps device. I started
> fiddling with it but then changed jobs, had little spare time and
> forgot about the project. Four years down the road I came across it
> again and was wondering about your experiences with this and if
> improvement was possible given four past years of development of
> software and insight.
> In short the method involves
> -scanning a map, if needed patching it together with Panavue
> (obviously if you already have a digital raster map not needed)
> -extract required information (p.e. streets) from map filtering
> through color (in Irfan view) and changing it to black&white
> -close gaps in lines in Gimp
> -vectorize with WinTopo
> -convert WinTopo's ASCII export format to different ASCII format
> required by cGPSmap (using perl script)
> -complete with cGPSmap
> A long list of software indeed. However, the advantage to me seems to
> be that if you have the software available you dont have to manually
> trace a map and that appeals to me for larger maps.
> Specifically, I have the following questions
> - Is it still necessary to use Perl for ASCII format conversion or is
> there a better way to transfer the vector data from WinTopo to
> cGPSmap?
> - Does anyone know of
> - a photoshop function that does the same as the Gimp
> function (see text below under IPX-closing)
> - an improved version of the Perl script?
> - any other improvements on this method ?
> I already tried tracing the author (johann gruber) online but to no
> avail...
> many thanks best regards,
> BN
> Back in 2002 someone posted the method detailed below to convert a
> raster map to one uploadable in a Garmin gps device. I started
> fiddling with it but then changed jobs, had little spare time and
> forgot about the project. Four years down the road I came across it
> again and was wondering about your experiences with this and if
> improvement was possible given four past years of development of
> software and insight.
> In short the method involves
> -scanning a map, if needed patching it together with Panavue
> (obviously if you already have a digital raster map not needed)
> -extract required information (p.e. streets) from map filtering
> through color (in Irfan view) and changing it to black&white
> -close gaps in lines in Gimp
> -vectorize with WinTopo
> -convert WinTopo's ASCII export format to different ASCII format
> required by cGPSmap (using perl script)
> -complete with cGPSmap
> A long list of software indeed. However, the advantage to me seems to
> be that if you have the software available you dont have to manually
> trace a map and that appeals to me for larger maps.
> Specifically, I have the following questions
> - Is it still necessary to use Perl for ASCII format conversion or is
> there a better way to transfer the vector data from WinTopo to
> cGPSmap?
> - Does anyone know of
> - a photoshop function that does the same as the Gimp
> function (see text below under IPX-closing)
> - an improved version of the Perl script?
> - any other improvements on this method ?
> I already tried tracing the author (johann gruber) online but to no
> avail...
> many thanks best regards,
> BN
Why bother?
Dennis Pogson wrote...
> Why bother?
Probably because for many purposes, and in some locations for all purposes,
commercial Garmin maps are utter crap! The usual response to such
complaints is "Make your own if you think that you can do better" and here
is one person who is prepared to do just that. If you're happy with Garmin
offerings then indeed why bother, and happy for you, but otherwise it's
either do it yourself or do without.
David
David Lee wrote:
> Dennis Pogson wrote...
>> Why bother?
>
> Probably because for many purposes, and in some locations for all purposes,
> commercial Garmin maps are utter crap! The usual response to such
> complaints is "Make your own if you think that you can do better" and here
> is one person who is prepared to do just that. If you're happy with Garmin
> offerings then indeed why bother, and happy for you, but otherwise it's
> either do it yourself or do without.
> Probably because for many purposes, and in some locations for all purposes,
> commercial Garmin maps are utter crap! The usual response to such
> complaints is "Make your own if you think that you can do better" and here
> is one person who is prepared to do just that. If you're happy with Garmin
> offerings then indeed why bother, and happy for you, but otherwise it's
> either do it yourself or do without.
Instead of creating an entire map, why not just create a route that can
be uploaded?
- Garmin GPS 75
- Global Positioning System
- 2005-11-23
- Help - GPS 10 Query.
- Garmin GPS
- 2005-09-17
- Garmin GPS Recommendation
- UK GPS Discussions
- 2011-11-29
- Was going to get a Garmin GPS - should i just get iphone instead?
- Global Positioning System
- 2009-12-07





