0
|
1 TopoTiler Readme
|
|
2 ================
|
|
3
|
|
4 What Does This Do?
|
|
5 ------------------
|
|
6
|
|
7 This program allows you to turn USGS GeoPDF files (such as those from the
|
|
8 `National Map <https://nationalmap.gov>`_ program) into tileable GeoTIFF
|
|
9 files.
|
|
10
|
|
11 By "tileable" I mean suitable for tiling into a complete raster
|
|
12 layer with gdalwarp or some other such tool. This implies that the so-called
|
|
13 "map collar" (i.e. the margin and any notation therein, basically anything
|
|
14 other than the represenataional body of the map) is removed and cropped
|
|
15 away.
|
|
16
|
|
17 Why Do This?
|
|
18 ------------
|
|
19
|
|
20 It allows one to use such maps as the basis for a raster layer in QGIS
|
|
21 and other GIS programs.
|
|
22
|
|
23 The National Map products are very nice, high-quality topo maps. Their greatest
|
|
24 flaw is that they are distributed only as GeoPDF documents, and such a format
|
|
25 is really only useful for generating printed output (and not as input to a GIS).
|
|
26 Rendering such documents into tileable raster data is the easiest workaround
|
|
27 to this drawback.
|
|
28
|
|
29 Why Is This Only a Command-Line Program?
|
|
30 ----------------------------------------
|
|
31
|
|
32 Two reasons:
|
|
33
|
|
34 1. I have not yet had time to write a GUI front end for it. I wrote TopoTiler
|
|
35 to serve an occasional need of mine, and a command-line utility works well
|
|
36 enough.
|
|
37 2. I am not yet certain if there is really a need to. A lot of that depends
|
|
38 on the need for TopoTiler in the first place. If this program proves useful
|
|
39 to a lot of people, and the consensus among its user base is that a GUI
|
|
40 would be beneficial, I will probably add one.
|
10
|
41
|
0
|
42 Prerequisites
|
|
43 -------------
|
|
44
|
|
45 This program requires `python3 <https://python.org/>`_ (specifically, Python 3.9 or better), the
|
|
46 `Pillow Python library <https://python-pillow.org/>`_, and
|
|
47 `GDAL <https://gdal.org/>`_ to be installed.
|
|
48
|
|
49 make-tile
|
|
50 ---------
|
|
51
|
|
52 This is the executable script to run.
|
|
53
|
|
54 Synopsis
|
|
55 ^^^^^^^^
|
|
56
|
|
57 ``make-tile`` [``-l``/``--layers`` *list*] [``-r``/``--resolution`` *dpi*] *file*
|
|
58
|
|
59 Convert USGS GeoPDF to tileable GeoTIFF. Input files must have an
|
|
60 extension of ``.pdf`` (case insensitive). Output files will be generated to
|
|
61 match each input file, with an extension of ``.tiff``.
|
|
62
|
|
63 Arguments
|
|
64 ^^^^^^^^^
|
|
65
|
|
66 -l/--layers
|
|
67 Comma-separated list of layers to include. See below for default.
|
10
|
68 -o/--output
|
|
69 Specify output file. Defaults to input file with extention changed
|
|
70 to .tiff.
|
0
|
71 -r/--resolution
|
|
72 Output resolution in DPI. Default is 300.
|
10
|
73
|
0
|
74 Environment
|
|
75 ^^^^^^^^^^^
|
|
76
|
|
77 ``GDALBIN`` may be set to the directory containing the GDAL executables. If
|
|
78 so, they will only be looked for there. Else the standard execution path
|
|
79 will be searched.
|
|
80
|
|
81 ``TMPDIR`` may be set to a place to write temporary files. Doing so is a
|
|
82 good idea if ``make-tile`` runs out of space in the default temporary files
|
|
83 area (this program makes very large scratch files).
|
|
84
|
|
85 Layers
|
|
86 ^^^^^^
|
|
87
|
|
88 By default, all ``Map_Frame`` layers, except for
|
|
89 ``Map_Frame.Projection_and_Grids`` and
|
|
90 ``Map_Frame.Terrain.Shaded_Relief``, will be included. This behavior can be
|
10
|
91 changed with the ``--layers`` option.
|
|
92
|
|
93 MakeWaypoints
|
|
94 -------------
|
|
95
|
|
96 Synopsis
|
|
97 ^^^^^^^^
|
|
98
|
|
99 ``kotlin MakeWaypointsKt`` [``-latfirst``] *file*
|
0
|
100
|
10
|
101 Prompt for long, lat (or, with ``-latfirst``, lat, long) pairs and names and
|
|
102 create a file containing the specified waypoints. Coordinates are expected to
|
|
103 be two comma-separated floating-point numbers, with negative values indicating
|
|
104 locations in the southern or western hemispheres (i.e. the standard way of
|
|
105 representing coordinates in computer storage).
|
|
106
|
|
107 Basic sanity checks are performed on the coordinates entered.
|
|
108
|
|
109 Notes
|
|
110 ^^^^^
|
|
111
|
|
112 This program is in Kotlin, despite my starting this project in Python, because
|
|
113 the JVM has a much more concise and simple way (i.e. ``XMLStreamWriter``) for
|
|
114 producing XML output.
|
|
115
|
|
116 Longitude, not latitude, is first by default because that is the way QGIS
|
|
117 exports coordinates.
|