URL http://dds.cr.usgs.gov/srtm
attached a perl script and an option file for mkgmap and the rules for shp2osm
 

On 29 Jun 2010, at 18:43 , Scott Crosby wrote:

> What is the URL for the SRTM data and the command lines you're using to 
> process it?
> 
> Scott
> 
> 
> 
> _______________________________________________
> mkgmap-dev mailing list
> [email protected]
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
#!/usr/bin/perl -w

my $minor = 25;
#$medium = 100;
#$major = 200;

unless (-e "hgt") {`mkdir hgt`};
unless (-e "tif") {`mkdir tif`};
unless (-e "shp") {`mkdir shp`};
unless (-e "osm") {`mkdir osm`};


while (< *.hgt.zip>) {
  $tile = $_;
  $tile =~ s/.hgt.zip//;
  $tile =~ m/([SN])(\d+)([EW])(\d+)/;
  $mapname = "$2" . "$4" ;
  if ($1 eq "N" ) {
      $b = $2;
  } else {
      $b = $2 * -1;
  }
  $t = $b +1;
  if ($3 eq "E" ) {
      $l = $4;
  } else {
      $l = $4 * -1;
  }
  $r = $l +1;


  unless (-e "140${mapname}.img") {
      unless (-e "osm/${tile}.osm") {
	  unless (-e "osm/${tile}0.osm") {
	      unless (-e "shp/${tile}.shp") {
		  unless (-e "tif/${tile}.tif") {
		      unless (-e "hgt/${tile}.hgt") {`unzip -d hgt $_`};
		      `gdal_translate -of GTiff hgt/${tile}.hgt tif/${tile}.tif`
		  };
		  `gdal_contour -a ele tif/${tile}.tif shp/${tile}.shp -i $minor`
	      };
	      `java  -Xmx4096M -cp ../shp-to-osm-0.6.1-jar-with-dependencies.jar Main --shapefile shp/${tile}.shp --rulesfile ../shp2osm.rule --osmfile osm/${tile} --outputFormat osm --maxnodes 20000000`
	  };
	  open(IN, "osm/${tile}0.osm" ) or  die $! ;
	  open(OUT, ">osm/${tile}.osm" ) or  die $! ;
	  $i = 0;
	  while (<IN>) {
	      $i++;
	      if ($i == 3) {
		  print OUT "<bounds minlat='" . "$b" . "' minlon='" . "$l" . "' maxlat='" . "$t" . "' maxlon='" . "$r" ."'/>";
	      }
	      print OUT ;
	  }
	  close IN;
	  close OUT;
      unlink "osm/${tile}0.osm";
      };
      `java -Xmx4000m -jar ../mkgmap.jar -c ../contour.opt --mapname=140$mapname osm/${tile}.osm` 
  };
}

`java -Xmx4000m -jar ../mkgmap.jar -c contour.opt   --tbdfile  --gmapsupp 100*img`;
`gmapi-builder.py -t contour.tdb  -b contour.img 100*.img  contour.img`;

Attachment: contour.opt
Description: Binary data

Attachment: shp2osm.rule
Description: Binary data

_______________________________________________
mkgmap-dev mailing list
[email protected]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Reply via email to