Browse Source

Fix errors in argument parsing in Python script

Phyks (Lucas Verney) 4 years ago
parent
commit
6b3d689727

+ 1
- 0
.gitignore View File

@@ -1 +1,2 @@
1 1
 build/*
2
+*.pyc

+ 1
- 0
scripts/libskimap/__init__.py View File

@@ -0,0 +1 @@
1
+#!/usr/bin/env python3

+ 1
- 1
scripts/libskimap/esri.py View File

@@ -5,7 +5,7 @@
5 5
 
6 6
 import math
7 7
 
8
-import tools
8
+from . import tools
9 9
 
10 10
 
11 11
 def parse_header(fh):

scripts/libskimap/srtm.py → scripts/libskimap/hgt.py View File


+ 1
- 1
scripts/libskimap/osm.py View File

@@ -6,7 +6,7 @@
6 6
 """
7 7
 import xml.etree.ElementTree as ET
8 8
 
9
-import geodata
9
+from . import geodata
10 10
 
11 11
 
12 12
 def fetch_metadta(lat_min, lng_min, lat_max, lng_max, data_file=""):

+ 1
- 1
scripts/libskimap/output.py View File

@@ -3,7 +3,7 @@
3 3
     (ARG) file (slightly modified implementation to fit with our needs).
4 4
     http://geotrellis.io/documentation/0.9.0/geotrellis/io/arg/
5 5
 """
6
-import tools
6
+from . import tools
7 7
 
8 8
 
9 9
 def format_arg(points):

+ 5
- 5
scripts/skimap.py View File

@@ -79,16 +79,16 @@ if __name__ == "__main__":
79 79
     parser = argparse.ArgumentParser(
80 80
         description="Fetch height dataset from geodata.")
81 81
     parser.add_argument("--lat-min", dest="lat_min", action="store",
82
-                        required=True,
82
+                        required=True, type=float,
83 83
                         help="Minimum latitude in the covered area.")
84 84
     parser.add_argument("--lat-max", dest="lat_max", action="store",
85
-                        required=True,
85
+                        required=True, type=float,
86 86
                         help="Maximum latitude in the covered area.")
87 87
     parser.add_argument("--lng-min", dest="lng_min", action="store",
88
-                        required=True,
88
+                        required=True, type=float,
89 89
                         help="Minimum longitude in the covered area.")
90 90
     parser.add_argument("--lng-max", dest="lng_max", action="store",
91
-                        required=True,
91
+                        required=True, type=float,
92 92
                         help="Maximum longitude in the covered area.")
93 93
     parser.add_argument("--out", dest="out", action="store",
94 94
                         required=True,
@@ -100,7 +100,7 @@ if __name__ == "__main__":
100 100
                         action="store", required=False, default="",
101 101
                         help="Ouptut geographic metadata file name " +
102 102
                         "(defaults to osm_(--out arg) file).")
103
-    parser.add_argument("in", dest="in_files", action="store", nargs="+",
103
+    parser.add_argument("in_files", action="store", nargs="+",
104 104
                         help="Input dataset files or folder containing input" +
105 105
                         "files.")
106 106
     # Parse parameters