1PHYGHTMAP(1)                     User Commands                    PHYGHTMAP(1)
2
3
4

NAME

6       phyghtmap  -  NASA SRTM / GeoTiff -> OSM xml (.osm), OSM pbf (.osm.pbf)
7       or OSM o5m (.o5m) translator
8

SYNOPSIS

10       phyghtmap [options] [<hgt or GeoTiff file>] [<hgt or GeoTiff files>]
11

DESCRIPTION

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
33       degrees of latitude north.
34

OPTIONS

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/lati‐
73              tude/elevation 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
79              default. 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
116              defaults 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)
121              algorithm  with  this  EPSILON value.  The larger the value, the
122              more simplified the contour lines.  The  value  passed  will  be
123              directly  used,  i.  e. in case of WGS84 based reference systems
124              like EPSG:4326, the passed value is interpreted  as  degrees  of
125              latitude  and  longitude,  respectively.   Use a value of 0.0 to
126              remove only vertices on  straight  lines.   Sensible  values  to
127              reduce  the output file size while preserving resonable accuracy
128              are dependent on the file  resolution.   For  SRTM3  data,  some
129              value  between  0.0001 and 0.0005 seems reasonable, reducing the
130              file size by something like one or two thirds.  Note that  using
131              contour  line simplification will slow down contour line genera‐
132              tion.  The default is not to use RDP.
133
134       --simplifyContoursMaxDistance=MAX_VERTEX_DISTANCE
135              Do not delete all vertices  while  simplifying  a  contour  line
136              using 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
167              using  ASTER  GDEM  and other data.  In version 2.1, only the US
168              territory is included in the 1 arc second dataset.   In  version
169              3,  nearly  the  whole  world  is covered.  The default for this
170              option is 3.  If you want the old version, say --srtmversion=2.1
171              here
172
173       --earthexplorer-user=EARTHEXPLORER_USERNAME
174              the  username to use for earthexplorer login.  This is needed if
175              you want to use NASA SRTM sources in version 3.0.  If you do not
176              yet       have      an      earthexplorer      login,      visit
177              https://ers.cr.usgs.gov/register/ and create one.   Once  speci‐
178              fied,  phyghtmap  will store the earthexplorer login credentials
179              unencrypted in a file called '.phyghtmaprc' in your home  direc‐
180              tory.   I.  e.,  you  only  have to specify this option (and the
181              --earthexplorer-password option) once.  In addition,  the  pass‐
182              word  specified on the command line may be read by every user on
183              your system.  So, don't choose a password which you  don't  want
184              to  be  disclosed to others.  This option should be specified in
185              combination with the --earthexplorer-password option.
186
187       --earthexplorer-password=EARTHEXPLORER_PASSWORD
188              the password to use for earthexplorer login.  This option should
189              be   specified  in  combination  with  the  --earthexplorer-user
190              option.  For further explanation, see the  help  given  for  the
191              --earthexplorer-user option.
192
193       --viewfinder-mask=VIEWFINDER-RESOLUTION
194              if   specified,  NASA  SRTM  data  are  masked  with  data  from
195              www.viewfinderpanoramas.org.  Possible values are 1 and  3  (for
196              explanation, see the --srtm option).
197
198       --source=DATA-SOURCE, --data-source=DATA-SOURCE
199              specify  a  list  of  sources  to use as comma-seperated string.
200              Available sources are 'srtm1', 'srtm3', 'view1' and 'view3'.  If
201              specified, the data source will be selected using this option as
202              preference list.  Specifying  --source=view3,srtm3  for  example
203              will prefer viewfinder 3 arc second data to NASA SRTM 3 arc sec‐
204              ond data.  Also see the --srtm-version option for different ver‐
205              sions of SRTM data.
206
207       --corrx=SRTM-CORRX
208              correct  x offset of contour lines.  A setting of --corrx=0.0005
209              was reported to give good results.  However, the correct setting
210              seems  to  depend  on  where  you are, so it is may be better to
211              start with 0 here.
212
213       --corry=SRTM-CORRY
214              correct y offset of contour lines.  A setting of  --corry=0.0005
215              was reported to give good results.  However, the correct setting
216              seems to depend on where you are, so it may be better  to  start
217              with 0 here.
218
219       --hgtdir=DIRECTORY
220              Cache  directory  for  hgt  files. The downloaded SRTM files are
221              stored in a cache directory for later use.  The  default  direc‐
222              tory for this is ./hgt/ in the current directory.  You can spec‐
223              ify another cache directory with this option.
224
225       --rewrite-indices
226              rewrite the index files and exit.  Try this if phyghtmap encoun‐
227              ters problems when trying to download data files.
228
229       --void-range-max=MINIMUM_PLAUSIBLE_HEIGHT_VALUE
230              extend  the  void  value  range up to this height.  The hgt file
231              format uses a void value which is -0x8000 or, in terms of  deci‐
232              mal numbers, -32768.  Some hgt files contain other negative val‐
233              ues which are  implausible  as  height  values,  e.  g.  -0x4000
234              (-16384)  or  similar.  Since the lowest place on earth is about
235              -420 m below sea level, it should be safe to say  -500  here  in
236              case  you  encounter strange phyghtmap behaviour such as program
237              aborts due to exceeding the maximum  allowed  number  of  recur‐
238              sions.
239
240       -v, --version
241              print version and exit.
242

USAGE EXAMPLES

244       Here are some usage examples
245
246       phyghtmap -a 8.59:49.34:8.78:49.45
247              generate  openstreetmap xml for the area around Heidelberg, Ger‐
248              many
249
250       phyghtmap -a 8.59:49.34:8.78:49.45 -o heidelberg
251              same as above but save data to heidelberg_*.osm files instead of
252              automatically generated filenames
253
254       phyghtmap -a -25:62:-12:68 -o iceland
255              This  will  not work since no SRTM data is available north of 60
256              degrees of latitude.
257
258       phyghtmap -a -25:62:-12:68 -o iceland --viewfinder-mask=3
259              Yes, this works.  There is  data  available  for  that  area  at
260              www.viewfinderpanoramas.org.
261
262       phyghtmap -a -25:62:-12:68 -o iceland --viewfinder-mask=3 -j 16
263              Same as above but use 16 parallel processes for the contour line
264              calculation.
265
266       phyghtmap -a -25:62:-12:68 -o iceland --source=view3,srtm3 -j 16
267              Essentially the same as above.
268
269       phyghtmap -a -25:62:-12:68 -o iceland -s 10 -c 100,50
270              Say this, if you want contour lines for Iceland with a step size
271              of  ten  meters  and  major  contour  lines every 100 meters and
272              medium contour lines every 50 meters.
273
274       phyghtmap -a 6:44:9:47 -o high_alps --viewfinder-mask=1
275              With this, you get wonderful contour line .osm with a resolution
276              of 1 arc second where data is available at www.viewfinderpanora‐
277              mas.org and NASA SRTM 3 arc second data elsewhere.
278
279       phyghtmap -a 6:44:9:47 -o high_alps --source=view1,view3,srtm3
280              Similar to the example above, but try to use  viewfinder  1  arc
281              second  data first, viewfinder 3 arc second data second and srtm
282              3 arc second data last.
283
284       phyghtmap  -a  6:44:9:47  --max-nodes-per-tile=100000  --max-nodes-per-
285       way=400
286              This  generates  contour  lines  for the high alps.  Each output
287              file will contain not more than 100000 nodes, each  way  therein
288              will not contain more than 400 nodes.
289
290       phyghtmap  -a  6:44:9:47  -j  2 --max-nodes-per-tile=0 --max-nodes-per-
291       way=0 --gzip=9
292              This generates contour lines for the high alps and  writes  them
293              to a single output file.  Note that it is possible to use multi‐
294              ple processes in parallel.  --max-nodes-per-way=0 means that the
295              ways will be as long as possible.  --gzip=9 will produce gzipped
296              output with a compression level of 9.
297
298       phyghtmap -a 6:44:9:47  -j  2  --max-nodes-per-tile=0  --max-nodes-per-
299       way=0 --pbf
300              Same  as  above  but  output  will be a osm protobuf binary file
301              (.osm.pbf).
302
303       phyghtmap -a 6:44:9:47  -j  2  --max-nodes-per-tile=0  --max-nodes-per-
304       way=0 --o5m
305              Same as above but output will be a o5m binary file (.o5m).
306
307       phyghtmap -s 5 NXXEYYY.hgt
308              Make  contour  line  .osm  with  steps  of  5  meters  from file
309              NXXEYYY.hgt.  Note that no area was specified here, the area  is
310              read  from  the  filename.  You can use phyghtmap like this with
311              .hgt files from sources other than NASA SRTM or  www.viewfinder‐
312              panoramas.org,  as long as the filenames contain the needed geo‐
313              graphic information.
314
315       phyghtmap -p example_plotname -a 8.9:49.0:9.0:49.1
316              Do not generate contour line OSM xml  but  write  a  file  exam‐
317              ple_plotname_*.xyz  with lines containing space seperated values
318              of longitude, latitude and elevation for each  point  stored  in
319              the corresponding .hgt file within the specified area.  For big‐
320              ger areas, you will probably get more than one output file.
321

BUGS

323       If you find a bug, please report it to <phyghtmap@aldw.de>.
324

AUTHOR

326       Adrian Dempwolff <phyghtmap@aldw.de>
327
329       Copyright (c) 2009-2018 Adrian Dempwolff.   This  code  is  distributed
330       under the GNU General Public License version 2, or, at your option, any
331       later version  <http://gnu.org/licenses/gpl.html>.
332
333
334

phyghtmap 2.21 December 2018 PHYGHTMAP(1)



        
Impressum