Menu

Vicinity

Maps
Anonymous
2003-12-13
2004-03-26
  • Anonymous

    Anonymous - 2003-12-13

    When I use vicinity to download maps on my Zaurus, it works just fine.  But when I try to use the URL on a Windows box, it doesn't seem to work right -- I always get the same map which is incorrect.  I have a feeling that I may be entering the parameter values wrong.  Could someone show me a vicinity link that is working (as and example) so I can see if I'm doing the URL right?

    Thanks

     
    • Marc Michalewicz

      Hi,

      if it helps, I wrote a small perlscript which fetches automatically all maps with desired scales (given on the commandline) around a specific (commandline) location from vicinity: just copy it into a separate directory and run it with the appropriate long/lat/scale settings - not to forget the rastering-degree (0.2 is fine usuallay): it creates a maps.txt file as well:

      #!/usr/bin/perl

      ############################################################
      # Name:       : getmaps.pl
      # Description : retrieves maps from the vicinity for qpegps
      # Date        : 24. Aug. 2003
      #
      # e.g., Solothurn (CH), 100000:
      # http://www.vicinity.com/gif?&CT=47.2083:7.51858:100000&IC=&FAM=myblast&W=1280&H=1024
      #
      # Paris, 100000:
      # http://www.vicinity.com/gif?&CT=48.90:2.4:100000&IC=&FAM=myblast&W=1280&H=1024
      # http://www.vicinity.com/gif?&CT=48.90:2.4:100000&IC=&FAM=myblast&W=1280&H=1024
      # http://www.vicinity.com/gif?&CT=48.90:2.4:100000&IC=&FAM=myblast&W=1280&H=1024
      # http://www.vicinity.com/gif?&CT=48.90:2.4:100000&IC=&FAM=myblast&W=1280&H=1024
      #
      # Paris, 18 arrondissement: long 2.20'115" E / lat 48,53'115"
      # Solothurn: 47,12'490", 7.31'145"
      #
      # Crete:
      # http://www.vicinity.com/gif?&CT=35.33:25.18:100000&IC=&FAM=myblast&W=1280&H=1024
      #
      # maps.txt-format:
      # FRITZ  Paris_48.90_2.4_100000.png 100000 1280 1024
      ############################################################

      $got_term_signal=0;
      $SIG{'TERM'} = sub {print "\nexiting..\n"; $got_term_signal=1;};
      $SIG{'INT'}  = sub {print "\nexiting..\n"; $got_term_signal=1;};

      my $destlong = shift;
      my $destlat  = shift;
      my $howmuch = shift;
      my $locationname = shift;
      my @scales = @ARGV;

      if (!$destlong) {
        print "usage: getmaps.pl <long> <lat> <howmuch> <name> <scale1> <scale2> ... <scalen>\n";
        print "e.g.:  getmaps.pl getmaps.pl 7.51858 47.2083 0.1 solothurn 5000 20000 50000 100000 500000 1000000\n";
        print "e.g.:  getmaps.pl  2.35 48.85 0.2 paris_notredame 5000 20000\n";
        exit;
      }

      $howmuch = 0.1 unless $howmuch;
      $destlong=2.3652 unless $destlong;
      $destlat=48.9152 unless $destlat;

      $long1 = $destlong-$howmuch unless $long1;
      $long2 = $destlong+$howmuch  unless $long2;
      $lat1  = $destlat-$howmuch unless $lat1;
      $lat2  = $destlat+$howmuch unless $lat2;

      $locationname = "Paris" unless $locationname;
      open FHW,">maps.txt";
      print "PID: $$\n";
      @scales = ('2000','5000','20000','100000','200000') unless @scales;

      foreach $scale (@scales) {
        if ($scale eq '1000') {
          $step = 0.005;
        }  elsif ($scale eq '5000') {
          $step = 0.02;
        } elsif ($scale eq '2000') {
          $step = 0.02;
        } elsif ($scale eq '20000') {
          $step = 0.05;
        } elsif ($scale eq '50000') {
          $step = 0.125;
        } elsif ($scale eq '100000') {
          $step = 0.25;
        } elsif ($scale eq '200000') {
          $step = 0.5;
        } elsif ($scale eq '500000') {
          $step = 0.5;
        } elsif ($scale eq '1000000') {
          $step = 0.5;
        }

        print "fetching map for area between (long/lat) $long1/$lat1 and $long2/$lat2 scale is $scale\n";
        for ($long = $long1; $long <=$long2; $long +=$step) {
          for ($lat = $lat1; $lat <=$lat2; $lat +=$step) {
            if ($got_term_signal) {exit};
            #print "fetching map for (long/lat) $long/$lat \n";
            $url = "http://www.vicinity.com/gif?&CT=$lat:$long:$scale&IC=&FAM=myblast&W=1280&H=1024";
            $gif_filename = $locationname."_".$long."_".$lat."_".$scale."_1280__1024.gif";
            $png_filename = $locationname."_".$long."_".$lat."_".$scale."_1280__1024.png";
            print "getting lat $lat, long $long, scale 1:$scale, location $locationname\n";
            `wget \&quot;$url\&quot; -O \&quot;$gif_filename\&quot; && convert $gif_filename $png_filename > /dev/null 2>/dev/null; rm $gif_filename\n`;
            print FHW "FRITZ $png_filename $scale 1280 1024 $lat $long\n";
          }
        }
      }

      close FHW;
      exit 0;

       
    • Nobody/Anonymous

      And as to an example of URL which is working, here it is:
      http://www.vicinity.com/gif?&CT=28:-82.5:200000&IC=&FAM=myblast&W=1280&H=1024

      View from Tampa, FL.

       
    • Nobody/Anonymous

      Vicinity seems to be returning fixed-size "error" graphics every now and then.  I've found if you just retry the request, perhaps waiting several seconds between retries, you eventually get the map you want.  (I've confirmed this by typing a URL, getting an error graphic, and then refreshing several times until I get the requested map.)

      I think the script needs to be changed so it detects this condition and retries the request as needed.  I'm not sure how to code that though.  Do any of you guys have any ideas?

      I'm using that 'getmaps' script, which exec's 'wget' to grab the maps.  I imagine an easy way to implement this fix might be to temporarily rename one's wget executable, and create a wrapper script 'wget' that calls the real thing, but checks the resultant map for an error response and retries the request as appropriate.

      --Michael Spencer

       
    • Nobody/Anonymous

      Are there any other places with maps? I am in Charlotte NC USA and I am looking for a map for my vacation in New Orleans!! Vicinity does not seem to be working for me.

       
    • Nobody/Anonymous

      Hi,
      the script worked right, i downloaded a lot of Italy Maps, but since a couple of week Vicinity seems don't work good, i cannot download any type of maps.
      Regards Steve

       
    • Nobody/Anonymous

      Does this work anymore?

       

Log in to post a comment.