[DebianGIS-dev] [SCM] gpsprune branch, master, updated. debian/9-2-6-g9895e71

David Paleino dapal at debian.org
Wed May 5 21:28:53 UTC 2010


The following commit has been merged in the master branch:
commit 8a6378c5aa63d1f82f7ca20f5c3418f68a7c37af
Author: David Paleino <dapal at debian.org>
Date:   Wed May 5 23:26:07 2010 +0200

    debian/scripts/get-tiles.py added, can be used to re-generate tiles*.txt files (see debian/copyright)

diff --git a/debian/changelog b/debian/changelog
index 9b1f162..7960205 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,8 +4,10 @@ gpsprune (10-1) UNRELEASED; urgency=low
   * debian/copyright:
     - updated to include new info about files in
       tim/prune/function/srtm/gen/
+  * debian/scripts/get-tiles.py added, can be used to re-generate
+    tiles*.txt files (see debian/copyright)
 
- -- David Paleino <dapal at debian.org>  Wed, 05 May 2010 23:24:59 +0200
+ -- David Paleino <dapal at debian.org>  Wed, 05 May 2010 23:25:37 +0200
 
 gpsprune (9-2) unstable; urgency=low
 
diff --git a/debian/scripts/get-tiles.py b/debian/scripts/get-tiles.py
new file mode 100755
index 0000000..1f2dda1
--- /dev/null
+++ b/debian/scripts/get-tiles.py
@@ -0,0 +1,24 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+# © 2010, David Paleino <dapal at debian.org>
+#
+# This script is released under the GNU General Public License, version 2.
+
+from urllib2 import urlopen
+import re
+
+base = "http://dds.cr.usgs.gov/srtm/version2_1/SRTM3/%s/"
+regions = ["Eurasia", "North_America", "Australia", "Islands", "South_America", "Africa"]
+
+for reg in regions:
+    url = base % reg
+    tiles = []
+    for line in urlopen(url).readlines():
+        if line.startswith("<li>"):
+            match = re.match("^<li><.*> ([^>]*)<.*>", line)
+            if match:
+                tiles.append(match.group(1).replace(".hgt.zip", ""))
+    f = open("tiles%s.txt" % (regions.index(reg)+1), "w")
+    f.write('\n'.join([reg] + tiles))
+    f.close()

-- 
Tool to visualize, edit, convert and prune GPS data



More information about the Pkg-grass-devel mailing list