1PHYGHTMAP(1) User Commands PHYGHTMAP(1)
2
3
4
6 phyghtmap - NASA SRTM / GeoTiff -> OSM xml (.osm), OSM pbf (.osm.pbf)
7 or OSM o5m (.o5m) translator
8
10 phyghtmap [options] [<hgt or GeoTiff file>] [<hgt or GeoTiff files>]
11
13 phyghtmap generates contour lines from NASA SRTM and smiliar data as
14 well as from GeoTiff data in OSM formats. For now, there are three
15 ways to achieve this. First, it can be used to process existing source
16 files given as arguments on the command line. Note that the filenames
17 must have the format [N|S]YY[W|E]XXX.hgt, with YY the latitude and XXX
18 the longitude of the lower left corner of the tile. Second, it can be
19 used with an area definition as input. The third way to use phyghtmap
20 is to specify a polygon definition. In the last two cases, phyghtmap
21 will look for a cache directory (per default: ./hgt/) and the needed
22 SRTM files. If no cache directory is found, it will be created. It
23 then downloads all the needed NASA SRTM data files automatically if
24 they are not cached yet. There is also the possibility of masking the
25 NASA SRTM data with data from www.viewfinderpanoramas.org which fills
26 voids and other data lacking in the original NASA data set. Since the
27 3 arc second data available from www.viewfinderpanoramas.org is com‐
28 plete for the whole world, good results can be achieved by specifying
29 --source=view3. For higher resolution, the 1 arc second SRTM data in
30 version 3.0 can be used by specifying --source=srtm1 in combination
31 with --srtm-version=3.0. SRTM 1 arc second data is, however, only
32 available for latitudes between 59 degrees of latitude south and 60 de‐
33 grees of latitude north.
34
36 -h, --help
37 show this help message and exit
38
39 -a LEFT:BOTTOM:RIGHT:TOP, --area=LEFT:BOTTOM:RIGHT:TOP
40 choses the area to generate osm SRTM data for by bounding box.
41 If necessary, files are downloaded from the NASA server. Spec‐
42 ify as <left>:<bottom>:<right>:<top> in degrees of latitude and
43 longitude, respectively. Latitudes south of the equator and lon‐
44 gitudes west of Greenwich may be given as negative decimal num‐
45 bers. If this option is given, specified hgt files will be omit‐
46 ted.
47
48 --polygon=FILENAME
49 use polygon FILENAME as downloaded from http://download.geofab‐
50 rik.de/clipbounds/ as bounds for the output contour data. The
51 computation time will be somewhat higher then. If specified, a
52 bounding box passed to the --area option will be ignored.
53
54 --download-only
55 only download needed files, don't write contour data.
56
57 -s STEP, --step=STEP
58 specify contour line step size in meters or feet, if using the
59 --feet option. The default value is 20.
60
61 -f, --feet
62 output contour lines in feet steps rather than in meters.
63
64 -0, --no-zero-contour
65 say this, if you don't want the sea level contour line (0 m)
66 (which sometimes looks rather ugly) to appear in the output.
67
68 -o PREFIX, --output-prefix=PREFIX
69 specify a prefix for the filenames of the output osm file(s).
70
71 -p PLOTPREFIX, --plot=PLOTPREFIX
72 specify the prefix for the files to write longitude/latitude/el‐
73 evation data to instead of generating contour osm.
74
75 -c ELEVATION_MAJOR,ELEVATION_MEDIUM, --line-cat=ELEVATION_MAJOR,ELEVA‐
76 TION_MEDIUM
77 specify a string of two comma seperated integers for major and
78 medium elevation categories, e. g. '200,100' which is the de‐
79 fault. This is needed for fancy rendering.
80
81 -j NJOBS, --jobs=NJOBS
82 number of jobs to be run in parallel (POSIX only)
83
84 --osm-version=OSM-VERSION
85 pass a number as OSM-VERSION to use for the output. The default
86 value is 0.6. If you need an older version, try 0.5.
87
88 --write-timestamp
89 write the timestamp attribute of node and way elements in OSM
90 XML and o5m output. This might be needed by some interpreters.
91 In o5m output, this also triggers writing of changeset and user
92 information.
93
94 --start-node-id=NODE-ID
95 specify an integer as id of the first written node in the output
96 OSM xml. It defaults to 10000000 but some OSM xml mergers are
97 running into trouble when encountering non unique ids. In this
98 case and for the moment, it is safe to say 10000000000 (ten bil‐
99 lion) then.
100
101 --start-way-id=WAY-ID
102 specify an integer as id of the first written way in the output
103 OSM xml. It defaults to 10000000 but some OSM xml mergers are
104 running into trouble when encountering non unique ids. In this
105 case and for the moment, it is safe to say 10000000000 (ten bil‐
106 lion) then.
107
108 --max-nodes-per-tile=MAXNODESPERTILE
109 specify an integer as a maximum number of nodes per generated
110 tile. It defaults to 1000000, which is approximately the maxi‐
111 mum number of nodes handled properly by mkgmap. For bigger
112 tiles, try higher values. For a single file output, say 0 here.
113
114 --max-nodes-per-way=MAXNODESPERWAY
115 specify an integer as a maximum number of nodes per way. It de‐
116 faults to 2000, which is the maximum value for OSM api version
117 0.6. Say 0 here, if you want unsplitted ways.
118
119 --simplifyContoursEpsilon=EPSILON
120 simplify contour lines using the Ramer-Douglas-Peucker (RDP) al‐
121 gorithm with this EPSILON value. The larger the value, the more
122 simplified the contour lines. The value passed will be directly
123 used, i. e. in case of WGS84 based reference systems like
124 EPSG:4326, the passed value is interpreted as degrees of lati‐
125 tude and longitude, respectively. Use a value of 0.0 to remove
126 only vertices on straight lines. Sensible values to reduce the
127 output file size while preserving resonable accuracy are depen‐
128 dent on the file resolution. For SRTM3 data, some value between
129 0.0001 and 0.0005 seems reasonable, reducing the file size by
130 something like one or two thirds. Note that using contour line
131 simplification will slow down contour line generation. The de‐
132 fault is not to use RDP.
133
134 --simplifyContoursMaxDistance=MAX_VERTEX_DISTANCE
135 Do not delete all vertices while simplifying a contour line us‐
136 ing RDP but only delete points within this range. The default
137 is to delete all dispensable vertices. Only use this option if
138 you want to get the benefit of RDP but need somehow close-lying
139 points because of rendering issues or so. Using this option will
140 dramatically slow down contour line generation.
141
142 --gzip=COMPRESSLEVEL
143 turn on gzip compression of output files. This reduces the
144 needed disk space but results in higher computation times.
145 Specifiy an integer between 1 and 9. 1 means low compression
146 and faster computation, 9 means high compression and lower com‐
147 putation.
148
149 --pbf write protobuf binary files instead of OSM XML. This reduces
150 the needed disk space. Be sure the programs you want to use the
151 output files with are capable of pbf parsing. The output files
152 will have the .osm.pbf extension.
153
154 --o5m write o5m binary files instead of OSM XML. This reduces the
155 needed disk space. Be sure the programs you want to use the out‐
156 put files with are capable of o5m parsing. The output files
157 will have the .o5m extension.
158
159 --srtm=SRTM-RESOLUTION
160 use SRTM resolution of SRTM-RESOLUTION arc seconds. Possible
161 values are 1 and 3, the default value is 3. For different SRTM
162 data versions and map coverage, see the --srtm-version option.
163
164 --srtm-version=VERSION
165 use this VERSION of SRTM data. Supported SRTM versions are 2.1
166 and 3. Version 2.1 has voids which were filled in version 3 us‐
167 ing ASTER GDEM and other data. In version 2.1, only the US ter‐
168 ritory is included in the 1 arc second dataset. In version 3,
169 nearly the whole world is covered. The default for this option
170 is 3. If you want the old version, say --srtmversion=2.1 here
171
172 --earthexplorer-user=EARTHEXPLORER_USERNAME
173 the username to use for earthexplorer login. This is needed if
174 you want to use NASA SRTM sources in version 3.0. If you do not
175 yet have an earthexplorer login, visit
176 https://ers.cr.usgs.gov/register/ and create one. Once speci‐
177 fied, phyghtmap will store the earthexplorer login credentials
178 unencrypted in a file called '.phyghtmaprc' in your home direc‐
179 tory. I. e., you only have to specify this option (and the
180 --earthexplorer-password option) once. In addition, the pass‐
181 word specified on the command line may be read by every user on
182 your system. So, don't choose a password which you don't want
183 to be disclosed to others. This option should be specified in
184 combination with the --earthexplorer-password option.
185
186 --earthexplorer-password=EARTHEXPLORER_PASSWORD
187 the password to use for earthexplorer login. This option should
188 be specified in combination with the --earthexplorer-user op‐
189 tion. For further explanation, see the help given for the
190 --earthexplorer-user option.
191
192 --viewfinder-mask=VIEWFINDER-RESOLUTION
193 if specified, NASA SRTM data are masked with data from
194 www.viewfinderpanoramas.org. Possible values are 1 and 3 (for
195 explanation, see the --srtm option).
196
197 --source=DATA-SOURCE, --data-source=DATA-SOURCE
198 specify a list of sources to use as comma-seperated string.
199 Available sources are 'srtm1', 'srtm3', 'view1' and 'view3'. If
200 specified, the data source will be selected using this option as
201 preference list. Specifying --source=view3,srtm3 for example
202 will prefer viewfinder 3 arc second data to NASA SRTM 3 arc sec‐
203 ond data. Also see the --srtm-version option for different ver‐
204 sions of SRTM data.
205
206 --corrx=SRTM-CORRX
207 correct x offset of contour lines. A setting of --corrx=0.0005
208 was reported to give good results. However, the correct setting
209 seems to depend on where you are, so it is may be better to
210 start with 0 here.
211
212 --corry=SRTM-CORRY
213 correct y offset of contour lines. A setting of --corry=0.0005
214 was reported to give good results. However, the correct setting
215 seems to depend on where you are, so it may be better to start
216 with 0 here.
217
218 --hgtdir=DIRECTORY
219 Cache directory for hgt files. The downloaded SRTM files are
220 stored in a cache directory for later use. The default direc‐
221 tory for this is ./hgt/ in the current directory. You can spec‐
222 ify another cache directory with this option.
223
224 --rewrite-indices
225 rewrite the index files and exit. Try this if phyghtmap encoun‐
226 ters problems when trying to download data files.
227
228 --void-range-max=MINIMUM_PLAUSIBLE_HEIGHT_VALUE
229 extend the void value range up to this height. The hgt file
230 format uses a void value which is -0x8000 or, in terms of deci‐
231 mal numbers, -32768. Some hgt files contain other negative val‐
232 ues which are implausible as height values, e. g. -0x4000
233 (-16384) or similar. Since the lowest place on earth is about
234 -420 m below sea level, it should be safe to say -500 here in
235 case you encounter strange phyghtmap behaviour such as program
236 aborts due to exceeding the maximum allowed number of recur‐
237 sions.
238
239 -v, --version
240 print version and exit.
241
243 Here are some usage examples
244
245 phyghtmap -a 8.59:49.34:8.78:49.45
246 generate openstreetmap xml for the area around Heidelberg, Ger‐
247 many
248
249 phyghtmap -a 8.59:49.34:8.78:49.45 -o heidelberg
250 same as above but save data to heidelberg_*.osm files instead of
251 automatically generated filenames
252
253 phyghtmap -a -25:62:-12:68 -o iceland
254 This will not work since no SRTM data is available north of 60
255 degrees of latitude.
256
257 phyghtmap -a -25:62:-12:68 -o iceland --viewfinder-mask=3
258 Yes, this works. There is data available for that area at
259 www.viewfinderpanoramas.org.
260
261 phyghtmap -a -25:62:-12:68 -o iceland --viewfinder-mask=3 -j 16
262 Same as above but use 16 parallel processes for the contour line
263 calculation.
264
265 phyghtmap -a -25:62:-12:68 -o iceland --source=view3,srtm3 -j 16
266 Essentially the same as above.
267
268 phyghtmap -a -25:62:-12:68 -o iceland -s 10 -c 100,50
269 Say this, if you want contour lines for Iceland with a step size
270 of ten meters and major contour lines every 100 meters and
271 medium contour lines every 50 meters.
272
273 phyghtmap -a 6:44:9:47 -o high_alps --viewfinder-mask=1
274 With this, you get wonderful contour line .osm with a resolution
275 of 1 arc second where data is available at www.viewfinderpanora‐
276 mas.org and NASA SRTM 3 arc second data elsewhere.
277
278 phyghtmap -a 6:44:9:47 -o high_alps --source=view1,view3,srtm3
279 Similar to the example above, but try to use viewfinder 1 arc
280 second data first, viewfinder 3 arc second data second and srtm
281 3 arc second data last.
282
283 phyghtmap -a 6:44:9:47 --max-nodes-per-tile=100000 --max-nodes-per-
284 way=400
285 This generates contour lines for the high alps. Each output
286 file will contain not more than 100000 nodes, each way therein
287 will not contain more than 400 nodes.
288
289 phyghtmap -a 6:44:9:47 -j 2 --max-nodes-per-tile=0 --max-nodes-per-
290 way=0 --gzip=9
291 This generates contour lines for the high alps and writes them
292 to a single output file. Note that it is possible to use multi‐
293 ple processes in parallel. --max-nodes-per-way=0 means that the
294 ways will be as long as possible. --gzip=9 will produce gzipped
295 output with a compression level of 9.
296
297 phyghtmap -a 6:44:9:47 -j 2 --max-nodes-per-tile=0 --max-nodes-per-
298 way=0 --pbf
299 Same as above but output will be a osm protobuf binary file
300 (.osm.pbf).
301
302 phyghtmap -a 6:44:9:47 -j 2 --max-nodes-per-tile=0 --max-nodes-per-
303 way=0 --o5m
304 Same as above but output will be a o5m binary file (.o5m).
305
306 phyghtmap -s 5 NXXEYYY.hgt
307 Make contour line .osm with steps of 5 meters from file
308 NXXEYYY.hgt. Note that no area was specified here, the area is
309 read from the filename. You can use phyghtmap like this with
310 .hgt files from sources other than NASA SRTM or www.viewfinder‐
311 panoramas.org, as long as the filenames contain the needed geo‐
312 graphic information.
313
314 phyghtmap -p example_plotname -a 8.9:49.0:9.0:49.1
315 Do not generate contour line OSM xml but write a file exam‐
316 ple_plotname_*.xyz with lines containing space seperated values
317 of longitude, latitude and elevation for each point stored in
318 the corresponding .hgt file within the specified area. For big‐
319 ger areas, you will probably get more than one output file.
320
322 If you find a bug, please report it to <phyghtmap@aldw.de>.
323
325 Adrian Dempwolff <phyghtmap@aldw.de>
326
328 Copyright (c) 2009-2021 Adrian Dempwolff. This code is distributed un‐
329 der the GNU General Public License version 2, or, at your option, any
330 later version <http://gnu.org/licenses/gpl.html>.
331
332
333
334phyghtmap 2.23 January 2021 PHYGHTMAP(1)