[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kismet-wireless
Subject:    gpsmap additions, mapblast, terraserver (read this =)
From:       "Matthew S. Hallacy" <poptix () techmonkeys ! org>
Date:       2002-08-31 12:30:07
[Download RAW message or body]

Hi.

the folks using gpsdrive figured out a way to use mapblast again, so I've
patched gpsmap to be able to use it again, and I've also added the ability
to use terraserver, selection of which map server to use is done with
the -A option (0 = mappoint, 1 = mapblast, 2 = terraserver), if none is 
specified, mappoint is used.

if you specify terraserver, you *must* specify a scale from 10 to 16, the
scale specified has nothing to do with the regular scale (10 = 1 meter 
ground resolution, 11 = 2 meter resolution, etc)

try it out, if you notice any problems, please report it.


the diff against the 8/31/2002 kismet-devel is attached, I assume that
Mike will let the list know if/when he accepts the patch.


-- 
Matthew S. Hallacy                            FUBAR, LART, BOFH Certified
http://www.poptix.net                           GPG public key 0x01938203

["gpsmap-8.31.02.diff" (text/plain)]

diff -rc kismet-devel/gpsmap.cc kismet-devel+poptix/gpsmap.cc
*** kismet-devel/gpsmap.cc	Tue Aug 27 13:45:56 2002
--- kismet-devel+poptix/gpsmap.cc	Sat Aug 31 07:15:49 2002
***************
*** 63,72 ****
  
  const char *config_base = "kismet.conf";
  
- //const char url_template[] = \
"http://www.mapblast.com/gif?&CT=%f:%f:%ld&IC=&W=%d&H=%d&FAM=myblast&LB=%s";  // &L = \
USA for the USA, EUR appears to be generic for Europe, EUR0809 for other parts of \
Europe.. if you get it wrong your map will be very bland =)  // default to USA, \
                probably want to change this. -- poptix
! const char url_template[] = \
"http://msrvmaps.mappoint.net/isapi/MSMap.dll?ID=3XNsF.&C=%f,%f&L=USA&CV=1&A=%ld&S=%d,%d&O=0.000000,0.000000&MS=0&P=|5748|";
  const char download_template[] = "wget \"%s\" -O %s";
  
  // Decay from absolute blue for multiple tracks
--- 63,74 ----
  
  const char *config_base = "kismet.conf";
  
  // &L = USA for the USA, EUR appears to be generic for Europe, EUR0809 for other \
parts of Europe.. if you get it wrong your map will be very bland =)  // default to \
                USA, probably want to change this. -- poptix
! const char url_template_mp[] = \
"http://msrvmaps.mappoint.net/isapi/MSMap.dll?ID=3XNsF.&C=%f,%f&L=USA&CV=1&A=%ld&S=%d,%d&O=0.000000,0.000000&MS=0&P=|5748|";
                
! const char url_template_ts[] = \
                "http://terraservice.net/GetImageArea.ashx?t=1&lat=%f&lon=%f&s=%ld&w=%d&h=%d";
                
! const char url_template_mb[] = \
"http://www.mapblast.com/myblastd/MakeMap.d?&CT=%f:%f:%d&IC=&W=%d&H=%d&FAM=myblast&LB=";
                
! 
  const char download_template[] = "wget \"%s\" -O %s";
  
  // Decay from absolute blue for multiple tracks
***************
*** 84,89 ****
--- 86,94 ----
  3000000, 4000000, 5000000, 6000000, 7000000, 8000000, 9000000, 10000000, 15000000,
  20000000, 25000000, 30000000, 35000000, 40000000, 0 };
  
+ // Terraserver scales for conversion to mapblast scales
+ long int terrascales[] = { 2757, 5512, 11024, 22048, 44096, 88182, 176384 };
+ 
  // Image colors
  const char *netcolors[] = {
      "#000000",
***************
*** 142,147 ****
--- 147,154 ----
  int draw_opacity, draw_track, draw_bounds, draw_range, draw_interpolated, \
                draw_hull, draw_scatter,
      draw_legend, convert_greyscale, keep_gif, draw_center, center_dot, verbose, \
interpolation_res;  
+ int alternatemap = 0;
+ 
  int sample_points;
  
  // points .. replaced by gpspoint
***************
*** 1653,1659 ****
  }
  
  
! int Usage(char *argv, int ec = 1) { /*FOLD00*/
      printf("Usage: %s [OPTION] <GPS files>\n", argv);
      printf(
             "  -c, --coords <x,y,s>         Force map center at x,y of scale s\n"
--- 1660,1666 ----
  }
  
  
! void Usage(char *argv, int ec = 1) { /*FOLD00*/
      printf("Usage: %s [OPTION] <GPS files>\n", argv);
      printf(
             "  -c, --coords <x,y,s>         Force map center at x,y of scale s\n"
***************
*** 1683,1688 ****
--- 1690,1696 ----
             "  -T, --threads <num>          Number of simultaneous threads used for \
complex\n"  "                               operations\n"
             "  -M, --metric                 Fetch metric-titled map\n"
+            "  -A, --alternatemap           Alternate map source, 1 for Mapblast, 2 \
                for TerraServer (aerial photos, you must provide a scale between 10 \
                and 16)\n"
             "  -F, --filter <MAC list>      Comma-seperated ALL CAPS list of MAC's \
                to filter\n"
             "  -I, --invert-filter          Invert filtering (ONLY draw filtered \
                MAC's)\n"
             "  -v, --verbose                Verbose output while running\n"
***************
*** 1700,1706 ****
  
      char mapname[1024];
      char mapoutname[1024];
- 
      unsigned int metric = 0;
  
      static struct option long_options[] = {   /* options table */
--- 1708,1713 ----
***************
*** 1726,1731 ****
--- 1733,1739 ----
          { "draw-center-dot", no_argument, 0, 'd' },
          { "interpolated-color", required_argument, 0, 'C' },
          { "metric", no_argument, 0, 'M' },
+         { "alternatemap", required_argument, 0, 'A' },
          { "draw-hull", no_argument, 0, 'H' },
          { "draw-scatter-plot", no_argument, 0, 'p' },
          { "dot-size", required_argument, 0, 'D' },
***************
*** 1772,1778 ****
      int label = 0;
  
      while(1) {
!         int r = getopt_long(argc, argv, \
"S:T:tbrils:c:o:m:O:gqu:hvdkC:MHVpD:f:IwL:N",  long_options, &option_index);
  
          if (r < 0) break;
--- 1780,1786 ----
      int label = 0;
  
      while(1) {
!         int r = getopt_long(argc, argv, \
"S:A:T:tbrils:c:o:m:O:gqu:hvdkC:MHVpD:f:IwL:N",  long_options, &option_index);
  
          if (r < 0) break;
***************
*** 1828,1833 ****
--- 1836,1847 ----
              snprintf(mapname, 1024, "%s", optarg);
              usermap = 1;
              break;
+         case 'A':
+ 	    if (sscanf(optarg, "%d", &alternatemap) != 1) {
+ 		    fprintf(stderr, "Invalid map server.\n");
+ 		    Usage(argv[0]);
+ 	    }
+             break;
          case 'M':
              metric = 1;
              break;
***************
*** 1956,1961 ****
--- 1970,1986 ----
          exit(1);
      }
  
+     // It's way too much of a kludge to muck with munging the scale around
+     if (alternatemap == 2) {
+ 	if ((user_scale < 10) || (user_scale > 16)) {
+ 		fprintf(stderr, "FATAL: You must provide a scale with the -A option that is from \
10 to 16\n"); + 		exit(0);
+ 	}
+ 	scale2 = user_scale;
+ 	user_scale = terrascales[(scale2 - 10)];
+     }
+ 
+ 
      // Initialize stuff
      num_tracks = 0;
  //    memset(&global_map_avg, 0, sizeof(gps_network));
***************
*** 2045,2056 ****
  
          char url[1024];
  
!         scale2 = (long) (scale / 1378.6);
! 
!         snprintf(url, 1024, url_template, map_avg_lat, map_avg_lon, scale2,
!                  map_width, map_height);
! //                 metric ? "&DU=KM" : ""); // poptix -- there is no scale on \
                mappoint
! 
          printf("Map url: %s\n", url);
          printf("Fetching map...\n");
  
--- 2070,2086 ----
  
          char url[1024];
  
! 	if (alternatemap == 2) {
! 	        snprintf(url, 1024, url_template_ts, map_avg_lat, map_avg_lon, scale2,
!         	         map_width, map_height);
! 	} else if (alternatemap == 1) {
! 	        snprintf(url, 1024, url_template_mb, map_avg_lat, map_avg_lon, scale,
!       	         map_width, map_height, metric ? "&DU=KM" : "");
! 	} else {
! 	        scale2 = (long) (scale / 1378.6);
! 	        snprintf(url, 1024, url_template_mp, map_avg_lat, map_avg_lon, scale2,
!         	         map_width, map_height);
! 	}
          printf("Map url: %s\n", url);
          printf("Fetching map...\n");
  



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic