Menu

Maptuit?

Maps
2004-02-21
2004-04-12
1 2 > >> (Page 1 of 2)
  • Nobody/Anonymous

    http://www.maptuit.com/htmlclient/map.cgi?<LON>,<LAT>,1024,768,0,1,1,Unique,0,Maps+m

    Does this link work for other people also?
    1024x768 seems to be the max.  Both 1025x768 and 1024x769 return errors.

    Near as I can tell, here's what the values do:
    <LON>:  longitude of course
    <LAT>:  latitude of course
    1024:  h res
    768:  v res
    0:  rotation.  Setting this to 1 rotates the map to the left 1 degree.
    1:  scale.  0 is full-out view of the US, 1 is close-in, 2 is slightly farther out, 3 is farther out still.  500 is a view of several states.  I don't know what the scale for this number is, or how linear it is.
    1:  can be 1 or 2.  both 0 and 3 don't work.  Map type 2 seems to be a different projection:  it's stretched out flatter.  I'm guessing in projection 2 any two lines with the same longitude have the same vertical coordinate on the map.
    Unique:  not sure what this does.
    0:  not sure what this does.
    Maps+m:  in the URL I found, this had a few spaces and some formatting text, and a longitude/latitude to draw a dot or triangle on.  I edited this down to the shortest length that still returns a map.

    Since the scale seems to be different than MapBlast, I'm thinking we need to take some measurements and figure out which mapblast scale number corresponds to which scale in this system.  Scale '1' seems to correspond to scale '2500', but I haven't tested this theory.

    Again, I'm not sure if this URL will work -- let me know.

     
    • Nobody/Anonymous

      I did some more checking.  Near as I can tell, each scale point in this URL is equivalent to 2815 scale points in mapblast's scale.  The URL DOES accept decimal values.

      Here's my methodology:
      I used qpeGPS on an existing mapblast map, recorded precise long/lat coordinates and pixel positions for the top left and bottom right.
      I then used the "proper" interface to Maptuit to ask for marker triangles above those same long/lat coordinates.  I saved the graphic to my PC and used an image editor to find the pixel positions of those two coordinates.

      Both marker arrows are the same shape and same pixel pattern.  I used the lower-left most pixel of the bottom tip of the arrow for both coordinates.  The original qpeGPS map positions had a separation of 1278x873 pixels, and the maptuit (scale 1.3) map positions had a separation of 873x699 pixels.  I did the scale math in both directions and got the same answer +/- 1 unit in both directions, so I consider my number to be accurate +/- 0.2%.  The actual figure is 2815 +/- 6.

      Because I only used three coordinates, I haven't reliably tested that this is actually the same projection as mapblast used.  At least I know the center, the top left, and the bottom right will line up.

      Is anyone interested in rewriting scripts to use this new source?

       
      • Nobody/Anonymous

        OK, *provided* these URLs actually work for other people (because nobody has posted to say "yeah it works for me")...

        You have to kind of work around the map scale difference.  Create a separate URL for each 'scale', i.e. "Maptuit 002500", "Maptuit 005000", "Maptuit 007500", ... "Maptuit 100000".

        The format for the Maptuit URL will be:  http://www.maptuit.com/htmlclient/map.cgi?<LON>,<LAT>,1024,768,0,***SOME*SCALE*VALUE*HERE***,1,Unique,0,Maps+m

        There are three unverified assumptions, so don't trust these maps until someone verifies them.  (You can verify them yourself if you want -- download some maps and get in the car and drive :) )

        Maptuit 002500
        http://www.maptuit.com/htmlclient/map.cgi?<LON>,<LAT>,1024,768,0,0.8881,1,Unique,0,Maps+m

        Maptuit 005000
        http://www.maptuit.com/htmlclient/map.cgi?<LON>,<LAT>,1024,768,0,1.7762,1,Unique,0,Maps+m

        Maptuit 007500
        http://www.maptuit.com/htmlclient/map.cgi?<LON>,<LAT>,1024,768,0,2.6643,1,Unique,0,Maps+m

        Maptuit 010000
        http://www.maptuit.com/htmlclient/map.cgi?<LON>,<LAT>,1024,768,0,3.5524,1,Unique,0,Maps+m

        Maptuit 015000
        http://www.maptuit.com/htmlclient/map.cgi?<LON>,<LAT>,1024,768,0,5.3286,1,Unique,0,Maps+m

        Maptuit 025000
        http://www.maptuit.com/htmlclient/map.cgi?<LON>,<LAT>,1024,768,0,8.8810,1,Unique,0,Maps+m

        Maptuit 050000
        http://www.maptuit.com/htmlclient/map.cgi?<LON>,<LAT>,1024,768,0,17.7620,1,Unique,0,Maps+m

        Maptuit 075000
        http://www.maptuit.com/htmlclient/map.cgi?<LON>,<LAT>,1024,768,0,26.6430,1,Unique,0,Maps+m

        Maptuit 100000
        http://www.maptuit.com/htmlclient/map.cgi?<LON>,<LAT>,1024,768,0,35.5240,1,Unique,0,Maps+m

        Maptuit 250000
        http://www.maptuit.com/htmlclient/map.cgi?<LON>,<LAT>,1024,768,0,88.8099,1,Unique,0,Maps+m

        Maptuit 500000
        http://www.maptuit.com/htmlclient/map.cgi?<LON>,<LAT>,1024,768,0,177.6199,1,Unique,0,Maps+m

        Add those to your map sources text file.  When you download a map, be sure you match the map source with the scale you selected.

        PLEASE let the board know if this works for people.   Oh, and let the mailing lists know as well, if you'd like.  :)

         
        • Nobody/Anonymous

          OK, hold off on Maptuit for now.  Apparently it uses a different projection than FRITZ.

          I had a friend punch up a quick perl script to autocreate wget and gif2png lines in a bash script for us.  I'll use that script to reinterpret the xcenter/ycenter/scale values into whatever is needed for the other projections.  Once I figure out how to display these maps, I'll post my findings AND the perl script.  :)

           
          • Nobody/Anonymous

            I feel like a real idiot, replying to my own post several times in a row.  Hopefully someone will see this and let me know if it works for them too.  :)

            It works!  I've got it downloading several maps in bulk, and my overlayed GPS tracks are displaying in the correct location.  Apparently the projection is still FRITZ, but the map just adds a six pixel border on all sizes (as well as some extra dead space at the bottom).  To get the map to display correctly you must tell qpeGPS the resolution is actually 1036x780 for a map with resolution (specified in the URL) of 1024x768.

            Here's the procedure for getting maps for an area:

            You will need:
            *  Carsten Schneider's getmaps program, from http://z-soft.z-portal.info/getmaps/index.html
            *  The top-left and bottom-right longitude and latitude of the region you want mapped
            *  The map scale you want the maps in
            *  A perl script, maptuit.pl
            *  gif2png
            *  perl

            1)  Find the top-left and bottom-right longitude and latitude of the region you want mapped.
            2)  Select a scale of map you want.  Divide that scale by 1.5.  (So if I want maps of scale 5000 after division my adjusted-scale is 3333)
            3)  Execute getmaps with the place-name, coordinates, and scale you picked.  getmaps will attempt to download from www.vicinity.com, but will instead create a large number of gif files that won't convert to PNG.  More importantly, it will create a text file, location_name_3333_maps.txt, containing formatted filenames of the maps it attempted to download.
            4)  Delete the newly-created bad gif files.
            5)  Execute maptuit.pl with the location_name_3333_maps.txt file as the sole command line argument.  The script will create two files:  location_name_3333.sh and location_name_3333.txt
            6)  With a network connection, execute location_name_3333.sh.  You may need to chmod it executable before you can do this.  This script will download the maps requested, but actually at the scale you originally wanted (5000 in the example).  The maps will be overlap just enough to avoid having to drive toward the edge of a map before the next map is displayed.
            7)  Append location_name_3333.txt to the end of your maps.txt file, and move the png files into your maps directory.

            I'm hand-typing this perl script someone else wrote without a good understanding of perl myself, so it may contain typos.

            maptuit.pl:

            #!/usr/bin/perl

            # Get the argument filename
            $filename = $ARGV[0];
            $filename =~ s/(.+)_maps\.txt//;
            open SCRIPT, ">$filename.sh" or die("can't open $filename.sh for writing");
            open TEXT, ">$filename.txt" or die("can't open $filename.txt for writing");

            print SCRIPT "#!/bin/bash\n";

            while (<>)
            {
            my ($FRITZ, $filename, $scale, $hres, $vres, $lon, $lat) = split;

            # First, do some scale magic
            my $newscale = $scale * 1.5;
            $newscale =~ s/(.+)\..//;

            # Round the newscale
            my $modulo = $newscale % 10;
            $newscale += (10 - $modulo) if ($modulo >= 5);

            # And get the ratio
            my $ratio = $newscale / 2815.0;

            # Muck with the filename a bit
            $filename =~ s/$scale/$newscale/;

            print TEXT "$FRITZ $filename $newscale 1036 780 $lon $lat\n";

            $filename =~ s/\.png/\.gif/;

            # Print out the lines
            printf SCRIPT "wget -O $filename http://www.maptuit.com/htmlclient/map.cgi?%s,%s,1024,768,0,%.4f,1,Unique,0,Maps+m\n", $lat, $lon, $ratio;
            print SCRIPT "gif2png -d -O $filename &\n";
            }

            If anyone wants to give this a try, please post back here with results.  Thanks guys -- enjoy!

             
            • Nobody/Anonymous

              I'm an idiot:  I typo'ed.  Added an extra semicolon.  Fixed below:

              maptuit.pl:

              #!/usr/bin/perl

              # Get the argument filename
              $filename = $ARGV[0];
              $filename =~ s/(.+)_maps\.txt//;
              open SCRIPT, ">$filename.sh" or die("can't open $filename.sh for writing");
              open TEXT, ">$filename.txt" or die("can't open $filename.txt for writing");

              print SCRIPT "#!/bin/bash\n";

              while (<>)
              {
              my ($FRITZ, $filename, $scale, $hres, $vres, $lon, $lat) = split;

              # First, do some scale magic
              my $newscale = $scale * 1.5;
              $newscale =~ s/(.+)\..//;

              # Round the newscale
              my $modulo = $newscale % 10;
              $newscale += (10 - $modulo) if ($modulo >= 5);

              # And get the ratio
              my $ratio = $newscale / 2815.0;

              # Muck with the filename a bit
              $filename =~ s/$scale/$newscale/;

              print TEXT "$FRITZ $filename $newscale 1036 780 $lon $lat\n";

              $filename =~ s/\.png/\.gif/;

              # Print out the lines
              printf SCRIPT "wget -O $filename http://www.maptuit.com/htmlclient/map.cgi?%s,%s,1024,768,0,%.4f,1,Unique,0,Maps+m\n", $lat, $lon, $ratio;
              print SCRIPT "gif2png -d -O $filename &\n";
              }

               
      • Nobody/Anonymous

        I've created an updated qpeGPS (for the Zaurus) which allows for the entry of a scale ratio as compared to the standard MapBlast/qpeGPS scale.  It's based on 0.9.1, but the sources.txt file is *not* compatible with previous versions of qpeGPS.

        You can find it here: http://www.currybrothers.com/zaurus/sl5600_patches.html

        Be sure to read the Readme and look at the sample sources.txt file.

        So far, It's been pretty useful.  Maybe someone else will find it useful, too.

         
        • Nobody/Anonymous

          Is the updated version of gpsd also available with it?

           
          • Nobody/Anonymous

            Assuming you mean GPSd 1.10, no.  I've have no success getting qpeGPS 0.9.1 working with it...

             
            • Nobody/Anonymous

              any version beyond the one which was originally packaged would do, at least for a test.  i was unable to get qpeGPS to interface with my LeadTek CF card at anything other than 1200 b.  i was able to install maps of Taiwan, and could even have the map move (and change scale), but it would not display my speed or bearing.  without those vital aspects its totally useless for navigation.  not being able to resove the issue, i have deleted qpeGPS from my Zaurus.

               
            • Nobody/Anonymous

              whoops - i forgot to say that i assumed it was gpsd - the interface - which has the problem....

               
    • Nobody/Anonymous

      (I tried to post this once, and I thought I got a confirmation, but I can't find the post now.  I even rescanned the forum using force-refresh.  If this is a double-post, it's my company firewall's fault.  :-) )

      I did some more checking.  Near as I can tell, each scale point in this URL is equivalent to 2815 scale points in mapblast's scale.  The URL DOES accept decimal values.

      Here's my methodology:
      I used qpeGPS on an existing mapblast map, recorded precise long/lat coordinates and pixel positions for the top left and bottom right.
      I then used the "proper" interface to Maptuit to ask for marker triangles above those same long/lat coordinates.  I saved the graphic to my PC and used an image editor to find the pixel positions of those two coordinates.

      Both marker arrows are the same shape and same pixel pattern.  I used the lower-left most pixel of the bottom tip of the arrow for both coordinates.  The original qpeGPS map positions had a separation of 1278x873 pixels, and the maptuit (scale 1.3) map positions had a separation of 873x699 pixels.  I did the scale math in both directions and got the same answer +/- 1 unit in both directions, so I consider my number to be accurate +/- 0.2%.  The actual figure is 2815 +/- 6.

      Because I only used three coordinates, I haven't reliably tested that this is actually the same projection as mapblast used.  At least I know the center, the top left, and the bottom right will line up.

      Is anyone interested in rewriting scripts to use this new source?

       
    • Nobody/Anonymous

      Hi There,

      I've been trying your perl code, as a method to get working maps. The perl code errored when I'd copied it to my system, so I took out the ; in Maps+m\n";, $lat  and there was no error.

      I used getmaps to generate the maps.txt file. Then I pumped it into your maptuit.pl and it runs, and quits without doing anything. :-(

      No maps were generated. I suspect there is a problem with maptuit / your perl code having a map size of 1024 x 768, whereas getmaps used to download its maps at 1280 x 1024.

      I am tempted to edit getmaps.c and have a go at compiling it, after changing the 1280x1024 in getmaps.c to 1024x768. However, I am not too sure what that will do to the accuracy of the resulting maps (working with the GPS).

      If you have any further solution comments, please let me know.... I'm off on holiday to Eastern Europe in only a few days!

      Regards,
      Steven G.

       
      • Nobody/Anonymous

        The perl code doesn't create any maps itself.  It creates two output files:  one is a substitute "maps.txt" file, and one is a bash script with wget and gif2png command lines.

        Here's the procedure:
        make the maps.txt like you did above.  Suppose the filename is yourlocation_maps.txt

        Run maptuit.pl this way:  ./maptuit.pl yourlocation_maps.txt

        It should quit without displaying anything on the screen.  Look at the filesystem again -- it should create two text files in the same directory:  yourlocation.txt and yourlocation.sh  (same as the input filename but with _maps.txt stripped off the end and then .txt or .sh added to the end.)

        Next, chmod yourlocation.sh so it's executable.

        Next, run yourlocation.sh.  (Perhaps view the file first, so you know I'm not doing anything weird to your system.)  It should download all those maps.

        Next, append the yourlocation.txt to your maps.txt file.

        Your last post was pretty detailed, but please post more information about which steps do and don't work.  From what you described above, it sounds like the .txt and .sh files aren't even being created, or possibly that you're running ./maptuit.pl with no command line arguments.

        Thanks again for trying it -- I hope it works for you!  I've run this script to create about seven batches of detail maps, and so far qpeGPS has been working with them very well.  I've got nearly spot-on accuracy, except in places like four and five lane interstates (it thinks the road is more narrow than it actually is) and on- and off-ramps.

         
    • Nobody/Anonymous

      apparently, the 2 output files are .sh and .txt (which are hidden), try ls -a to see if they are here and rename them.

       
    • Nobody/Anonymous

      Seems this works great, even though the 2 output files were .sh and .txt. I managed to get the maps fine, merged the txt file to maps.txt and place the png files into the maps directory. However, for some strange reason qpegps does not like the maps as it will not view them. The files are okay as I've viewed them in the image viewer application.
      Is there some step I missed or is it a glitch in qpegps?

      - Trevor

       
      • Nobody/Anonymous

        You might be missing gif2png.  qpegps expects to find the maps in PNG format, but the files come from Maptuit in GIF format.  The script makes alternating wget and gif2png calls, downloading each file and then converting each file to PNG.

        If you're missing the gif2png utility, or it isn't in your path, then the script will download a bunch of GIFs but will tell qpegps to look for PNG's, so you'll have the problem you're describing.

        Could you double-check that you have the gif2png utility?  If you don't have it but you just got it recently, if you'd like you can still use that .sh file.  Just cat the .sh file, pipe through 'grep' looking for gif2png, and put the output in a new file.  Then edit the new file, add #!/bin/bash to the beginning, and chmod it executable.  Then just run that and it'll mass-convert your GIF files to PNG.

        Also, the tool was designed to take the input file a command line argument, not as standard input.  (I'm surprised it even works with standard input, but I guess Perl is more flexible than I am.  :) )  If you give it an input file blahblahblah_maps.txt it will strip off the _maps.txt from the end and name the output files blahblahblah.txt and blahblahblah.sh.  Hidden files never occurred to me.

        Hope it works for you!

         
    • Nobody/Anonymous

      Hi,

      Thanks for the reply. The utility gif2png had been installed and it converted the gif to png files no problem. My apologies as I should have mentioned that, all the map images are in fact png format no problems. The scale of the maps is 75000 so I presume that isnt a problem?  Also just for curiosity I used the import feature of qpegps to see if it would use the image and it did.

      This is what the maps.txt looks like:-

      FRITZ southmaine_75000_44.102310_-71.164238.png 75000 1036 780 44.102310 -71.164238
      FRITZ southmaine_75000_43.963421_-71.164238.png 75000 1036 780 43.963421 -71.164238

       
      • Nobody/Anonymous

        So where does that leave us?  Do things work only if you manually import your maps? Or is everything working properly now?

         
    • Nobody/Anonymous

      Hi,

      Thanks for the reply. The utility gif2png had been installed and it converted the gif to png files no problem. My apologies as I should have mentioned that, all the map images are in fact png format no problems. The scale of the maps is 75000 so I presume that isnt a problem?  Also just for curiosity I used the import feature of qpegps to see if it would use the image and it did.

      This is what the maps.txt looks like:-

      FRITZ southmaine_75000_44.102310_-71.164238.png 75000 1036 780 44.102310 -71.164238
      FRITZ southmaine_75000_43.963421_-71.164238.png 75000 1036 780 43.963421 -71.164238

      - Trevor

       
    • Nobody/Anonymous

      oops, sorry for the dupe posts....

      - Trevor

       
    • Nobody/Anonymous

      No, I never actually imported the maps, just selected import and the image came up in the preview window. Although I might try the import feature and see if that works. I did just now re-downloading maps at a different scale (50000) so will  place a note on here to let you know if it worked or not.

      - Trevor

       
      • Nobody/Anonymous

        One thing to watch out for:  the resolution of the map is different than the resolution of the graphic file.  After you import the map, re-edit the text file and pick the higher resolution.

        Also, I think the format of the maps.txt file changed in the last version or so.  Do you need to update to a newer qpegps?  My version was downloaded a couple weeks ago.

         
    • Nobody/Anonymous

      Okay, I figured it out...finally!!!! Took awhile and it was such a stupid problem. What happened is that originally I had installed qpepgs onto the Z flash, then I had removed the installation and reinstalled qpegps onto the SD card. I placed all the maps onto the SD card not taking any notice of the config file location for the maps. Strangely enough it was picking up the maps.txt file from the new location, but trying to pick up the actual maps from the original location on flash!! So I just had to change the location of the maps to point to the new location on the SD card and now everything works as it should!!

       
      • Nobody/Anonymous

        Great!  Glad you figured it out!  :)

         
1 2 > >> (Page 1 of 2)

Log in to post a comment.