Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

What do you prefer for Windows freeware to view GPS tracks on offline USGS topo maps?

31 views
Skip to first unread message

Arlen Holder

unread,
Aug 7, 2018, 10:43:18 PM8/7/18
to
What do you prefer for Windows freeware to view GPS tracks on offline USGS topo maps?

Occasionally I wish to see tracks & profiles on a Windows desktop USGS map.
(OSM maps are substandard - so I'm only asking about offline USGS maps.)

I use the following offline method, but it could use improvement:
1. I create the gpx tracks using OSMtracker freeware on Android.
2. If needed, I convert the format using GPSBabel freeware on Windows.
3. Normally I view offline on USGS maps in OziExplorer trialware.

OziExplorer is kind of a pain, for a variety of reasons, so I'm seeking a
better simple offline USGS map viewer on Windows. That's all I ask.

Lest someone mention online options, we can always view tracks on USGS maps
online with any of the following topographic map track-viewing online
sites:
a. http://caltopo.com (gpx format)
b. http://mygpsfiles.com/app/ (gpx format)
c. https://mapsengine.google.com/map/ (kml format)
etc.
But this question is not about online viewing of tracks on USGS maps.

It's a bitch to add USGS topo maps to the offline Google Earth product, so,
I've been there, done that, and don't like the Google Earth method either.
<https://www.outdoors.org/articles/amc-outdoors/how-to-add-usgs-topographic-maps-to-google-earth/>

On Android, it's very easy to display tracks *directly* onto any
georeferenced PDF map downloaded *directly* from the USGS, but I'm asking
about Windows software to basically do the same thing that Android software
does for free.

There is "Viking" for Windows, or "GPS Master" but they appear to be stuck
on OSM maps, where USGS maps are the only ones that have the accuracy:
https://sourceforge.net/projects/viking/
https://www.gpsmaster.nl/

The QGIS software "might" work, as that's the main one I haven't tried yet.
https://docs.qgis.org/2.18/en/docs/user_manual/

REFERENCED-SOFTWARE LINKS:
OSM Tracker: https://github.com/labexp/osmtracker-android
OSM Tracker: https://play.google.com/store/apps/details?id=me.guillaumin.android.osmtracker
GPS Babel: https://www.gpsbabel.org/
Ozi Explorer: http://www.oziexplorer.com/w/
Google Earth: https://www.google.com/earth/download/gep/agree.html
USGS maps: https://viewer.nationalmap.gov/launch/
USGS georeferenced topo maps: https://nationalmap.gov/ustopo/index.html
USGS historical topo maps: https://ngmdb.usgs.gov/topoview/viewer
USGS national map viewer: https://viewer.nationalmap.gov/advanced-viewer/

In summary, this question asks:
What do you prefer for Windows freeware to view GPS tracks on offline USGS topo maps?

B. R. 'BeAr' Ederson

unread,
Aug 8, 2018, 12:12:37 AM8/8/18
to
On Wed, 8 Aug 2018 02:43:15 -0000 (UTC), Arlen Holder wrote:

> The QGIS software "might" work, as that's the main one I haven't tried yet.
> https://docs.qgis.org/2.18/en/docs/user_manual/

Best solution. But use a current 3.x version. I posted a "howto" earlier
this year here in acf:

Message-ID: <4t85l9yxwf8o$.d...@br-ederson.eternal-september.org>
https://groups.google.com/forum/message/raw?msg=alt.comp.freeware/W3IjaKFeLrM/mvZicW-jAAAJ
thread:
https://groups.google.com/forum/#!topic/alt.comp.freeware/W3IjaKFeLrM

Please note, that WMS is by far faster than using Geo-Pdf.

F-Up set to acf.
BeAr
--
===========================================================================
= What do you mean with: "Perfection is always an illusion"? =
===============================================================--(Oops!)===

Arlen Holder

unread,
Aug 8, 2018, 9:51:09 AM8/8/18
to
On 7 Aug 2018 21:12:32 GMT, B. R. 'BeAr' Ederson wrote:

> Best solution. But use a current 3.x version.
> QGIS is a free open source desktop GIS program,
> that rivals the best commercial programs of that category:
> http://www.qgis.org

Thanks for that confirmation that I should try to figure out this QGIS
stuff (but you must also note that it's complex as all hell, simply because
the available options are seemingly vastly more map-related functionality
than I want or need).

All I need are two things:
1. Create routes offline on existing freely available USGS maps
2. View tracks offline on those same freely available USGS maps
and ... at times ... when hikes span quadrangles...
3. Combine quadrangles of the freely available USGS maps

I'm going to bluntly state that I'm confused like you can't believe which,
if any, of the related products do those two things (which anyone would
want to do who hikes).

But, to that end, I picked up the latest versions there:
<https://www.qgis.org/en/site/forusers/download.html>
* Version 3.2.1 ​
* Version 2.18.22 LTR

I will try to test, but I am not "serving" maps, nor am I creating a
Graphic Information System (GIS). All I want to do is what anyone who hikes
in the USA would want to do, which is view tracks and create routes on the
Windows desktop using existing USGS georeferenced freely available maps.

> It does (much) more than you need

All I need to do is create routes and view tracks offline on USGS maps.

> www.osgeo.org

Wow. They have a lot of stuff at https://www.osgeo.org

Given all I want is to create routes & view tracks offline on existing
freely available USGS maps, I think this is the related product page:
https://www.osgeo.org/choose-a-project/mapping-and-cartography/desktop-mapping/

Where they seem to have four (extremely confusing) products:
* GRASS GIS https://www.osgeo.org/projects/grass-gis/
* gvSIG Desktop https://www.osgeo.org/projects/gvsig/
* Marble Globe https://www.osgeo.org/projects/marble/
* QGIS Desktop https://www.osgeo.org/projects/qgis/

It's hard to tell which of those, if any, allow me to view tracks and edit
routes on existing freely available USGS georeferenced PDF maps.

> freegis.org

That web site says it has 'ended' where nothing is available today.

> Please note, that WMS is by far faster than using Geo-Pdf.
> Although the GeoPdf files /are/ georeferenced and could be used directly,
> they load too slow to make this fun. (Several raster and vector layers
> have to be combined and transparency rules to applied in the process of
> displaying it.) So WMS is the way to go.

I do not know what this "WMS" is.

Since OSM sucks, the only maps I care about are the freely available USGS
PDF maps, which are "geo referenced" PDFs.

Looking up what the heck "WMS" means, it's not easily found:
https://duckduckgo.com/html?q=wms%20versus%20geopdf
https://duckduckgo.com/html?q=wms%20map%20versus%20geo%20pdf
https://duckduckgo.com/html/?q=%22geo%22%20pdf%20wms&norw=1
etc.

It's miserable to look up what the heck "wms" even means.
Eventually, I figured out it stands for:
WEB MAP SERVICE: https://en.wikipedia.org/wiki/Web_Map_Service
"A Web Map Service (WMS) is a standard protocol developed by the Open
Geospatial Consortium in 1999 for serving georeferenced map images over the
Internet.[1] These images are typically produced by a map server from data
provided by a GIS database.[3]"

Just to be clear, I have absolutely zero desire to 'serve' a map.
I have zero desire to use the Internet for my routes and tracks.
I have zero desire to create my own maps.

The main thing I want to do is what anyone would want to do who hikes,
which is these two very similar things:
a. Create a route on a freely available USGS map, and,
b. View a track on that freely available USGS map.
In addition, I might need to *combine* USGS map quadrangles just to have a
single map when a hike spans quadrangle borders.

I can do all that with OziExplorer but it's a PITA (as you're likely
aware).

There are so many programs above to choose from (marble, grss, gvsig, qgis,
etc.), that I'm not yet sure which (if any) does that - which anyone would
want to do who hikes.

B. R. 'BeAr' Ederson

unread,
Aug 8, 2018, 12:23:20 PM8/8/18
to
On Wed, 8 Aug 2018 13:51:06 -0000 (UTC), Arlen Holder wrote:

[QGIS for task stated in subject]
I sum up my answers to your additional questions and comment your remarks
here in one place to reduce clutter:
* OSGeo is generalized open source GIS platform combining a huge number
of projects covering different, sometimes overlapping tasks. Some of
these projects depend on others.
* You don't need to worry about any of them, except QGIS (= the desktop
GIS with the most enduser-friendly GUI among these programs). QGIS
installs all dependencies necessary for normal work and permits later
installation of extensions, if need should arise. No need to use the
global OSGeo installer. QGIS stand-alone will do the trick with less
hassle.
* You should use the most current QGIS from 3.x branch. (As I wrote in my
original answer to your question.
* Yes, QGIS can display tracks on USGS Topo maps. I tested this earlier
this year before answering the question I linked to.
* You can use downloaded Geo-Pdf files of the USGS Topo maps. But these
load so slow (even on very fast PC's), that I strongly advise against
it. Better use the WMS (Web map services) provided by the US government:
https://services.nationalmap.gov/arcgis/services/USGSImageryTopoLarge/MapServer/WmsServer?
* To use this link, you include it in the QGIS WMS configuration.
* You see: Not you /provide/ a WMS. You /use/ WMS provided by others.

>> freegis.org
>
> That web site says it has 'ended' where nothing is available today.

That's really sad news. Three months ago it was still up and running.
You get the information via archive.org, though. Here is an example
link to the Software projects page:

https://web.archive.org/web/20170821163917/http://freegis.org/database/?cat=0

Arlen Holder

unread,
Aug 8, 2018, 10:43:21 PM8/8/18
to
On 8 Aug 2018 13:51:06 GMT, Arlen Holder wrote:

> The main thing I want to do is what anyone would want to do who hikes,
> which is these two very similar things:
> a. Create a route on a freely available USGS map, and,
> b. View a track on that freely available USGS map.
> In addition, I might need to *combine* USGS map quadrangles just to have a
> single map when a hike spans quadrangle borders.

Here's my ad-hoc log file to save others time when installing, so they have
fewer surprises...

============================================================================
https://www.qgis.org/en/site/forusers/download.html

Started installing at 5:45
Finished installing at 5:52

When you run"QGIS 3.2.1 Bonn Setup", it gives you a license overview of:
1. QGIS
2. Oracle Instant Client
3. MrSID Raster Plugin for GDAL
4. ECW Raster Plugin for GDAL
5. SZIP compression library

It wants to go in C:\Program Files\QGIS 3.2
I put it in C:\app\database\map\qgis

It asks which components to install, which were, by default:
[x]QGIS
[_]North Caroline Data Set
[_]South Dakota (Spearfilsh)
[_]Alaska Data Set

I left the defaults since I have no idea what those things are.
The installer is *very* slow (what on earth is it doing for so long?).
(It's extracting a hell of a lot of stuff it turns out. Files galore.)

It's a rather badly behaved installer as it does things without asking.
It creates folders you never asked it to create outside your hierarchy:
C:\Users\name\Documents\GIS DataBase
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\QGIS 3.2
C:\Users\Public\Desktop\QGIS 3.2
C:\OSGeo4W64
(and likely others)

The bad behavior of the installer is likely due to default locations
for user data which can most likely (let's hope) be put where they
belong once the user becomes familiar with these enforced data location
decisions by the developers.

The installer puts a half-dozen shortcuts on the desktop to:
GRASS GIS 7.4.1.lnk = C:\app\database\map\qgis\bin\grass74.bat -gui
.\QGIS 3.2\OSGeo4W Shell.lnk = C:\app\database\map\qgis\OSGeo4W.bat
.\QGIS 3.2\QGIS Desktop 3.2.1 with GRASS 7.4.1.lnk = C:\app\database\map\qgis\bin\qgis-bin-g7.4.1.exe
.\QGIS 3.2\QGIS Desktop 3.2.1.lnk = C:\app\database\map\qgis\bin\qgis-bin.exe
.\QGIS 3.2\Qt Designer with QGIS 3.2.1 custom widgets.lnk = C:\app\database\map\qgis\bin\nircmd.exe exec hide C:\app\database\map\qgis\bin\qgis-designer.bat
.\QGIS 3.2\SAGA GIS (2.3.2).lnk = C:\app\database\map\qgis\bin\nircmd.exe exec hide "C:\app\database\map\qgis\bin\saga-ltr_gui.bat"

Presumably the starting point is the "QGIS Desktop 3.2.1.lnk".

That brings up an extensive GUI, which makes sense given the presumed
awesome power of this freeware program set to GIS personnel.

However, with power comes complexity when all you want to do is something
simple like view an existing map, and to view tracks on that map.

The logical question now is, in this order:
a. How do you view an existing USGS georeferenced PDF map quadrant in QGIS?
b. How do you combine two USGS quadrants into a single map in QGIS?
c. How do you view tracks on that georeferenced USGS PDF map?
d. How do you edit routes on that georeferenced USGS PDF map?
============================================================================
I'll be working on the answer to those simple questions, one by one.

As always, if anyone has the experience to recommend an answer to those
basic questions above, your helpful advice would be appreciated.

Arlen Holder

unread,
Aug 8, 2018, 10:58:43 PM8/8/18
to
On 9 Aug 2018 02:43:18 GMT, Arlen Holder wrote:

> The logical question now is, in this order:
> a. How do you view an existing USGS georeferenced PDF map quadrant in QGIS?
> b. How do you combine two USGS quadrants into a single map in QGIS?
> c. How do you view tracks on that georeferenced USGS PDF map?
> d. How do you edit routes on that georeferenced USGS PDF map?

The first hit from the USGS site doesn't bode well ...
<https://nationalmap.gov/ustopo/Import_US_Topo_Instructions.pdf>

Question: Can I import a US Topo into my geographic information system (GIS)?
Answer: Yes, but with many caveats.

Unfortunately, the real answer from *that* references, is actually:
Question: Can I import a US Topo (for free) into my geographic information system (GIS)?
Answer: No.

Because the software they describe for doing that task costs from hundreds
to thousands of dollars.
a. Import to ArcGIS with TerraGo commercial software ($2,637)
b. Reformat the GeoPDF as a GeoTIFF using Global Mapper ($350)

I'll look further to solve that simple problem set of loading existing
freely available USGS georeferenced PDFs into QGIS 3.2 software.

B. R. 'BeAr' Ederson

unread,
Aug 8, 2018, 11:56:48 PM8/8/18
to
On Thu, 9 Aug 2018 02:58:41 -0000 (UTC), Arlen Holder wrote:

> I'll look further to solve that simple problem set of loading existing
> freely available USGS georeferenced PDFs into QGIS 3.2 software.

You deserve what you get when you don't heed the advise given. I told you,
/not/ to use the GeoPdf maps, but the (also free) WMS services. And I
wrote, that I already tested this approach with no problems. But no, you
have to do it your way. - So be it...

Arlen Holder

unread,
Aug 9, 2018, 10:00:37 AM8/9/18
to
On 8 Aug 2018 20:56:43 GMT, B. R. 'BeAr' Ederson wrote:

> You deserve what you get when you don't heed the advise given. I told you,
> /not/ to use the GeoPdf maps, but the (also free) WMS services. And I
> wrote, that I already tested this approach with no problems. But no, you
> have to do it your way. - So be it...

I apologize that I didn't see this (or your other post), until just now.
(It was my fault for thinking nobody had responded.)

All I want are what anyone would want, which is:
a. Load USGS freely available quadrangles offline into Windows map freeware
b. View existing tracks
c. Create new routes
And ... at times...
d. Combine quadrangles if/when the tracks/routes cross quadrangle borders

Given those are my goals (and, I would posit, anyone would want the same
goals as they're perfectly natural), you'll notice that I don't care what
the incoming database is (geopdf or wms or whatever).

Given that the goals are universal, and the input database is the USGS, the
advantage to solving this problem is to everyone - not just you or me.

I *always* try all sincere suggestions - so I will try your prior
suggestion (which I just saw now) and report back the results.

Bear in mind that, while I'm not beholden to *any* specific USGS map
format, I have never even heard of WMS formats until you mentioned them,
so, I have to *find* them on the USGS site (and download them) first.

B. R. 'BeAr' Ederson

unread,
Aug 9, 2018, 3:10:49 PM8/9/18
to
On Thu, 9 Aug 2018 14:00:34 -0000 (UTC), Arlen Holder wrote:

> On 8 Aug 2018 20:56:43 GMT, B. R. 'BeAr' Ederson wrote:
>
>> You deserve what you get when you don't heed the advise given. I told you,
>> /not/ to use the GeoPdf maps, but the (also free) WMS services. And I
>> wrote, that I already tested this approach with no problems. But no, you
>> have to do it your way. - So be it...
>
> I apologize that I didn't see this (or your other post), until just now.
> (It was my fault for thinking nobody had responded.)

Even in my original answer I linked to a posting, where I wrote to use
WMS. And in another posting of the whole thread (I also linked to) I
explained, that GeoPdf files load considerably slower because of the
additional rendering mechanisms required.

You seem to not read the information provided to you thoroughly enough.
This makes answering very tedious... :-(

> Bear in mind that, while I'm not beholden to *any* specific USGS map
> format, I have never even heard of WMS formats until you mentioned them,
> so, I have to *find* them on the USGS site (and download them) first.

You already read that WMS is an online service provided by a GIS server
delivering the information. You cannot (and need not) download them.
You link them inside your GIS program (in this case QGIS) into the map
you work on. And depending on the zoom level and area position, the
data is loaded and rendered directly from the server. Only if you /need/
to do your work offline, you have to use downloaded data like GeoPdf.

Step by step (<sigh>):
1. Load latest QGIS standalone version from qgis.org (OSGeo4W would be
okay, too, but has more options and is therefore more complex)
2. Start the QGIS setup program (some details added to address questions
from another posting of yours):
* There are several open source / freeware licenses combined, because
QGIS is "just" a GUI to a multitude of separately developed GIS
components (most of them matured by more than 2 decades)
* The suggested installation directory is for the main program and
components. Because QGIS and its components are multiplatform and
need to comply to several different OS file storing guidelines and
standards, some components go to different folders (common files
directory, user data folder,...). Providing the end user with
flexible target directories for these components, as well, could
render the setup broken (missing search path settings, rights,...)
Therefore, the user can not adjust those directories.
* QGIS comes with some GIS sample data for the user to "play" with
the program without the need to acquire data elsewhere. Also some
tutorials use this data. For the task in question, the sample data
is not needed.
* The desktop shortcuts created are, IMHO, a nuisance. They can be
deleted. (The program can be started via Start menu as well as
via Explorer.)
* GRASS GIS is one of the underlying GIS components of QGIS. (A main
one, actually, and a full-fledged, but less enduser-friendly desktop
GIS by itself.)
3. Start QGIS Desktop. It starts with an empty "Map project". (The GRASS
integration is only needed for advanced GIS functions.)
4. Open menu <Layer><Add Layer><Add WMS/WMTS Layer...>
5. Click <New> button on the "Layers" tab of the "Data source manager"
while "WMS/WMTS" is selected
6. Choose whatever "Name" you like (e.g. "US Topo") and post a link to
a US Topo WMS in the "URL" field, for instance:
https://basemap.nationalmap.gov/arcgis/services/USGSTopo/MapServer/WmsServer?
and press <OK>. "US Topo" is now selected in the drop-down box on top
of the "Layers" tab.
7. Press <Connect>. Now at least one layer should be listed. Select the
deepest entry, change layer name to "Topo" (to easier identify it in
the layers overview) and click <Add> button
8. Now you probably see a world map. Zoom into the area you like to
view in detail using the +zoom lens tool or the mouse scroll wheel.
9. If you have a *.gpx trackfile, load it via menu <Layer><Add Layer>
<Add Vector Layer...> (File should be selected; you browse to the
*.gpx file via the 3-dot-button on the right side of the vector
dataset(s) field. Hit <Add> button and select whatever sub-themes
you need from the *.gpx (e.g. waypoints; number of features should
be larger than 0).
10. Right click on the *.gpx subtheme added inside the "Layers" main
map theme browser and choose "Zoom to Layer".
11. You can not directly edit *.gpx files with QGIS. So again right
click on that layer and choose <Export><Save Feature As>.
12. In the "Save Vector Layer as..." dialog choose format "ESRI
shapefile", choose a name and target directory, leave all options
at default settings (esp. "Add saved file to map" and click <OK>.
13. Use <Toggle editing> from right mouse menu of the layer and use
GIS editing tools to adjust the feature to whatever you want (e.g.
use "Add point feature" tool to add a waypoint to the Waypoints
shapefile layer (or whatever layer you just created from *.gpx)
<For more editing information consult help/tutorials/...>
14. Use <Toggle editing> again and choose to save changes when asked.
15. Now Re-Export the shapefile to *.gpx format (like done the other
way round in step 12).
16. If you like, you can export the displayed map with waypoints or any
other overlay to Pdf: <Project><Import/Export><Export Map to Pdf>
17. You can save the currently loaded layers, positions and so on as
a "map project", if you wish to reuse them. The linked WMS themes
will be available from "Data browser" and "Data source manager" even
if you don't save a map project.

Done. Most of the time was used for writing. The process itself took
(with setup - I didn't have a current version of QGIS installed) around
15 minutes.

;-----------

During the last couple of months the USGS seems to have retired quite
a few online data sources, that have been up and running for years.
A good pointer for current WMS links seems to be:

https://viewer.nationalmap.gov/services

Since "request=GetCapabilities&service=WMS" is the standard function, it
/can/ be left out when copying/pasting WMS links.

HTH.

Arlen Holder

unread,
Aug 10, 2018, 5:00:11 AM8/10/18
to
On 9 Aug 2018 12:10:39 GMT, B. R. 'BeAr' Ederson wrote:
> Step by step (<sigh>):

****************************************************************************
Thanks to B. R. 'BeAr' Ederson, here's a step-by-step pictorial tutorial
on how to use existing free United States Geological Survey map databases
to view topographic maps, view tracks on those maps, & to edit routes -
using only Windows canonical Quantum GIS freeware.
<http://www.bild.me/bild.php?file=7004647qgis50.jpg>
****************************************************************************
============================================================================
. Download the text GPX track for Mount Umunhum used in this walkthru
<https://ufile.io/4yk0h> <=== this is automatically deleted in 30 days
============================================================================
. Obtain and install Quantum GIS 3.2.1 freeware for Windows
<https://www.qgis.org/en/site/forusers/download.html>
NOTE: It wants to install into: "C:\Program Files\QGIS 3.2"
Instead, I installed it into: "C:\app\database\map\qgis"
============================================================================
. On Windows, start QGIS from the shortcut titled "QGIS Desktop 3.2.1"
[C:\app\database\map\qgis\bin\qgis-bin.exe]
<http://www.bild.me/bild.php?file=7153673qgis00.jpg>
. Check the version using QGIS:Help > Check QGIS Version
<http://www.bild.me/bild.php?file=9838659qgis01.jpg>
. Load in the USGS map database for Mount Umunhum
QGIS:Layer > Add Layer > Add WMS/WMTS Layer
<http://www.bild.me/bild.php?file=5567310qgis02.jpg>
<http://www.bild.me/bild.php?file=6441506qgis03.jpg>
. Data Source Manager | WMS/WMTS: Layers > New
<http://www.bild.me/bild.php?file=8375690qgis04.jpg>
. Create a New WMS/WMTS Connection: Connection details >
Name = US Topo
URL = https://basemap.nationalmap.gov/arcgis/services/USGSTopo/MapServer/WmsServer?
<http://www.bild.me/bild.php?file=4419440qgis05.jpg>
NOTE: Because "request=GetCapabilities&service=WMS" is the default,
this also works: https://viewer.nationalmap.gov/services
. Press [OK]
<http://www.bild.me/bild.php?file=5964258qgis06.jpg>
. Press [Connect]
<http://www.bild.me/bild.php?file=7185012qgis07.jpg>
. Select the lowest entry in the list, which is:
ID = 1, Name = 0, Title = Layers, Abstract = blank
. At the bottom of the form is a "Layer name" field that says "Layers"
<http://www.bild.me/bild.php?file=3747539qgis08.jpg>
. Change that "Layer name" field from "Layers" to "Topo"
<http://www.bild.me/bild.php?file=5911324qgis09.jpg>
. Click [Add]
<http://www.bild.me/bild.php?file=8988786qgis10.jpg>
. Close the "Data Source Manager | WMS/WMTS" form so you can see below it.
<http://www.bild.me/bild.php?file=2708931qgis11.jpg>
. Zoom into the San Francisco Bay Area of California on that world map
<http://www.bild.me/bild.php?file=4420818qgis12.jpg>
. In my case I have a GPX trackfile named C:\tmp\umunhum.gpx
. QGIS:Layer > Add Layer > Add Vector Layer > C:\tmp\umunhum.gpx
<http://www.bild.me/bild.php?file=7658659qgis13.jpg>
<http://www.bild.me/bild.php?file=2999436qgis14.jpg>
. Click [Add]
<http://www.bild.me/bild.php?file=6303169qgis15.jpg>
. I chose to hit "Select All" because I wasn't sure which detail matter
<http://www.bild.me/bild.php?file=9189292qgis16.jpg>
. Click [OK]
<http://www.bild.me/bild.php?file=8923746qgis17.jpg>
. Click [Close] and notice that the track shows up on the map
<http://www.bild.me/bild.php?file=3437513qgis18.jpg>
. On the QGIS left-side "Layers" pane, rightclick on "umunhum track_points"
<http://www.bild.me/bild.php?file=1208912qgis19.jpg>
. Select [Zoom to Layer] (which should zoom to the entire track)
<http://www.bild.me/bild.php?file=1780048qgis20.jpg>
. Zoom as desired to visualize portions of that track
<http://www.bild.me/bild.php?file=4268242qgis21.jpg>
============================================================================
. To edit the track to create a desired route...
. Right-click on "umunhum track_points" > Export > Save Features As
<http://www.bild.me/bild.php?file=4251110qgis22.jpg>
. In the "Save Vector Layer as..." form, notice Format = GeoPackage
<http://www.bild.me/bild.php?file=4718890qgis23.jpg>
. Click the "Format" pulldown arrow to view & select "ESRI shapefile"
<http://www.bild.me/bild.php?file=1670863qgis24.jpg>
. Select a "File Name" of "umunhum_route" & click [OK]
<http://www.bild.me/bild.php?file=5680734qgis25.jpg>
. To locate those results, simply run the Windows find-string command:
c:\> dir /s/a/l/on/b c:\* | findstr umunhum
c:\tmp\umunhum.gpx
c:\app\database\map\qgis\bin\umunhum_route.cpg
c:\app\database\map\qgis\bin\umunhum_route.dbf
c:\app\database\map\qgis\bin\umunhum_route.prj
c:\app\database\map\qgis\bin\umunhum_route.qpj
c:\app\database\map\qgis\bin\umunhum_route.shp <=== the shapefile
c:\app\database\map\qgis\bin\umunhum_route.shx
. Right-click on "umunhum track_points" > Toggle editing
<http://www.bild.me/bild.php?file=1509654qgis26.jpg>
. QGIS:Edit > Select > Select Features
<http://www.bild.me/bild.php?file=4812814qgis27.jpg>
. Draw a selection bounding box around the points you wish to delete
<http://www.bild.me/bild.php?file=5292862qgis28.jpg>
. QGIS:Edit > Cut Features
<http://www.bild.me/bild.php?file=7115319qgis29.jpg>
. Right-click on "umunhum track_points" > Toggle editing
<http://www.bild.me/bild.php?file=7697018qgis30.jpg>
. Click [Save] when asked:
Stop Editing: Do you want to save the changes to layer umunhum_route?
<http://www.bild.me/bild.php?file=8199406qgis31.jpg>
. Right-click on "umunhum track_points" > Export > Save Features As
ESRI shapefile, umunhum_route_edited, [OK]
<http://www.bild.me/bild.php?file=8434183qgis32.jpg>
============================================================================
. QGIS:View > Zoom to layer
<http://www.bild.me/bild.php?file=2357420qgis33.jpg>
. QGIS:Project > Import/Export > Export Map to PDF
<http://www.bild.me/bild.php?file=7951952qgis34.jpg>
. In the "Save Map as PDF" form, click the [Save] button
<http://www.bild.me/bild.php?file=2918023qgis35.jpg>
. And give it a name, such as "c:\tmp\umunhum_hike.pdf" which you can
open in any PDF viewer
<http://www.bild.me/bild.php?file=9152603qgis36.jpg>
============================================================================
. QGIS:Project > Save > umunhum_project.qgz
<http://www.bild.me/bild.php?file=6423196qgis37.jpg>
. QGIS:Project > Exit QGIS
<http://www.bild.me/bild.php?file=4477916qgis38.jpg>
. When you re-open QGIS, you'll see "umunhum_project" in "Recent Projects"
<http://www.bild.me/bild.php?file=5984185qgis39.jpg>
. Doubleclicking on that "umunhum_project" brings you back where you were
<http://www.bild.me/bild.php?file=5473937qgis40.jpg>
. Right-click on "umunhum track_points" > Export > Save Features As
Format = GPS eXchange Format [GPX]
<http://www.bild.me/bild.php?file=7926860qgis41.jpg>
. Select a "File Name" of "umunhum_edited" & click [OK]
<http://www.bild.me/bild.php?file=2985650qgis42.jpg>
. In my case, that gave an error message of:
"Export to vector file failed.
Error: Creation of field track_fid failed (OGR error: Field of name
'track_fid' is not supported in GPX schema. Use GPX_USE_EXTENSIONS
creation option to allow use of the <extensions> element.)"
<http://www.bild.me/bild.php?file=9028313qgis43.jpg>
. Right-click on "umunhum track_points" > Export > Save Features As
Format = GPS eXchange Format [GPX]
In the "Save Vector Layer as..." form, notice the "Datasource Options"
pulldown section, which has "GPX_USE_EXTENSTIONS" set to "NO"
Set "GPX_USE_EXTENSTIONS" set to "YES" & click [OK]
. Select a "File Name" of "umunhum_edited" & click [OK]
<http://www.bild.me/bild.php?file=3859822qgis44.jpg>
. If the file exists, it will ask to overwrite (click [Yes])
. Then it will pop up a "Select Vector Layers to Add.." selection form
<http://www.bild.me/bild.php?file=2104715qgis45.jpg>
. Click [Select All] and then [OK] to create the file "umunhum_edited.gpx"
<http://www.bild.me/bild.php?file=4263537qgis46.jpg>
. QGIS:Project > Exit QGIS
****************************************************************************
As always, this is provided to both improve our tribal knowledge, and to
ask that others improve this information for the benefit of everyone.
***************************************************************************
Thanks to B. R. 'BeAr' Ederson!

wasbit

unread,
Aug 10, 2018, 5:51:39 AM8/10/18
to
"B. R. 'BeAr' Ederson" <use.r...@this.is.invalid> wrote in message
news:a9rj81vzc5f7$.dlg@br-ederson.eternal-september.org...
Thank you for that.
Whilst I have no need, I appreciate the time & trouble you take to pass on
your knowledge to others.

--
Regards
wasbit

Arlen Holder

unread,
Aug 10, 2018, 6:27:05 AM8/10/18
to
On 10 Aug 2018 02:51:28 GMT, wasbit wrote:

> Thank you for that.
> Whilst I have no need, I appreciate the time & trouble you take to pass on
> your knowledge to others.

I agree with you on commending B. R. 'BeAr' Ederson on the great WMS
Quantum GIS advice, where we've all been on Usenet for decades, and where
we ascribe to the tenets that each of us stands on each others' shoulders.

Our goal, always, is to learn and then to improve the tribal knowledge,
such that the tribal knowledge archives after DejaNews will contain the
record for all future users to benefit from:
http://tinyurl.com/alt-comp-freeware
http://tinyurl.com/sci-geo-satellite-nav
http://tinyurl.com/windowsxp-general
http://tinyurl.com/alt-comp-os-windows-10
http://tinyurl.com/comp-mobile-android
http://tinyurl.com/comp-mobile-ipad
http://tinyurl.com/misc-phone-mobile-iphone
http://tinyurl.com/alt-os-linux
http://tinyurl.com/comp-sys-mac-apps
https://tinyurl.com/alt-cellular
etc.

I think the key step-by-step related tutorials are the following (where
improvements are always welcome from those who know more than I do):

How to view & edit tracks on USGS WMS databases using QGIS freeeware
<https://groups.google.com/d/msg/alt.comp.freeware/IeNTm2cOrd8/F_ftT-p5CAAJ>

How to record tracks on USGS geocalibrated PDFs using Avenza freeware
<https://groups.google.com/forum/#!topic/comp.mobile.android/zNKD3jyeye4>

How to record GPX tracks on iOS & Android freeware & copy to the desktop
<https://groups.google.com/d/msg/comp.mobile.android/zNKD3jyeye4/vxLvk87oAgAJ>

How to freely geocalibrate multiple USGS quadrangles into a single PDF map
<https://groups.google.com/d/msg/alt.comp.freeware/W3IjaKFeLrM/TpFbNWiIAAAJ>

What's missing, I think, are the following problem solutions:
a. How to use the Quantum GIS USGS WMS method wholly offline (if possible)
b. How to combine & geoCalibrate USGS geoPDF quadrangles using Quantum GIS

The reason that (a) is needed is because it's a bad idea to be required to
use the Internet for personal private mapping solutions, while the reason
for (b) is that the Avenza solution on the mobile device sucks when your
hike crosses USGS quadrangle borders (which it often will do).

B. R. 'BeAr' Ederson

unread,
Aug 10, 2018, 12:12:51 PM8/10/18
to
On Fri, 10 Aug 2018 10:51:28 +0100, wasbit wrote:

[QGIS USTopo WMS walkthrough]
> Thank you for that.
> Whilst I have no need, I appreciate the time & trouble you take to pass on
> your knowledge to others.

We need to keep the good old standards of acf up, don't we? ;-)
Thanks for your motivating words! :-)

B. R. 'BeAr' Ederson

unread,
Aug 10, 2018, 12:28:03 PM8/10/18
to
On Fri, 10 Aug 2018 10:27:01 -0000 (UTC), Arlen Holder wrote:

[QGIS USTopo WMS walkthrough]
> What's missing, I think, are the following problem solutions:
> a. How to use the Quantum GIS USGS WMS method wholly offline (if possible)

WMS services can only be used online. There are methods to locally cache
already retrieved data. But that's too advanced to be elaborated here.
Apart from that, WMS usually delivers different scale-dependent content
details. Therefore, you most likely encounter missing or unfit data
details with offline cached content.

> b. How to combine & geoCalibrate USGS geoPDF quadrangles using Quantum GIS

Add them either via menu <Layer><Add Layer><Add Vector/Raster Layer...>
(method file type "Geospatial Pdf" or directory) or directly load them
from Browser subwindow by either double clicking or using right mouse
menu entry <Add Selected Layer(s) to Canvas>.

A fast PC and lots of memory help. Still: Start with only 1 file. Later
on you can experiment with more, if the GeoPdf files load fast enough.

B. R. 'BeAr' Ederson

unread,
Aug 10, 2018, 12:35:43 PM8/10/18
to
On Fri, 10 Aug 2018 10:27:01 -0000 (UTC), Arlen Holder wrote:

[QGIS USTopo WMS walkthrough]
> What's missing, I think, are the following problem solutions:
> a. How to use the Quantum GIS USGS WMS method wholly offline (if possible)

WMS services can only be used online. There are methods to locally cache
already retrieved data. But that's too advanced to be elaborated here.
Apart from that, WMS usually delivers different scale-dependent content
details. Therefore, you most likely encounter missing or unfit data
details with offline cached content.

> b. How to combine & geoCalibrate USGS geoPDF quadrangles using Quantum GIS

Add them either via menu <Layer><Add Layer><Add Vector/Raster Layer...>
(method file type "Geospatial Pdf" or directory) or directly load them
from Browser subwindow by either double clicking or using right mouse
menu entry <Add Selected Layer(s) to Canvas>.

A fast PC and lots of memory help. Still: Start with only 1 file. Later
on you can experiment with more, if the GeoPdf files load fast enough.

Supersede: I missed the part of your question about georeferencing the
USTopo Pdf files. These are GeoPdf's. Therefore they come already with
internal georeferncing information and will load at the correct map
position (in relation to other GIS data). If they do not, some of your
data has either missing or incorrect coordinate system information.
Incompatible coordinate systems are highly unlikely. QGIS supports
about any coordinate system that is currently in use (or has been in
past).

Arlen Holder

unread,
Aug 10, 2018, 3:22:42 PM8/10/18
to
On 10 Aug 2018 09:12:44 GMT, B. R. 'BeAr' Ederson wrote:

> We need to keep the good old standards of acf up, don't we? ;-)
> Thanks for your motivating words! :-)

I *appreciate* your good nature, and your willingness to help a fellow
a.c.f junkie.

Like most of us, I'm well into retirement, with decades on Usenet behind
me, but unlike most of us, I change nyms for privacy reasons (yes, I used
to post in my own name, but that was in the UNIX days before "spam" was a
related word, and well before privacy was something we worried about.

The one thing I don't do is hide who I am in the text - I only obfuscate
the headers - where I am always using the same strategy:

1. Ask a question and provide enough detail for people to answer it
2. Respond to each post that is worth responding to, in like manner
3. Try every reasonable suggestion (if feasible and possible)
4. Give back to the team so that others can stand on our shoulders
5. Thank those whose shoulders I stood on to get where I got
6. Ensure the tribal record *archives* the results (to last longer than us)

To that end, I *created* those tinyurl links to these newsgroups, e.g.,
http://tinyurl.com/alt-comp-freeware
I did that, oh, I don't know, a decade or more ago.

I've written so many tutorials (thousands?) that I can't count them (nor
can I even find them all since the headers are scrambled - which is the
point since I hide from robotic aggregators but not individual users).

All my tutorials use freeware because (a) freeware has the most leverage
since everyone can try the tools, and (b) I believe there is almost nothing
I can't do in freeware that others have to pay for in payware.

Most of my tutorials are on computer subjects, and most are cross platform
between all the major consumer operating systems (linux, windows, android &
iOS mostly).

But some are about WISP setup, or even on automotive mechanics.
For example, I recently wrote a tutorial on how to replace a clutch.
<https://groups.google.com/d/msg/alt.home.repair/qEhph1MmSKs/S_R2Y4gRBwAJ>

Even though I had never done a clutch before, the step-by-step detailed
howto (with pictures of EVERY bolt!) will help OTHERS who have the same
clutch.

I'm always giving back to the team - just as I'm always asking questions of
the team when the existing answer isn't easy to find on the net.

I'm also persistent, as I almost never fail, simply because *someone* knows
the answer to every question! Or we can find it out together.

I will try your suggestion on the USGS geospatial PDFs where these are the
two skills I need to attain:
1. The ability to use QGIS to *combine* 4 USGS geospatial PDFs into 1 file
2. The ability to use QGIS to view, track, & route *offline* on that file

Arlen Holder

unread,
Aug 10, 2018, 3:22:44 PM8/10/18
to
On 10 Aug 2018 09:35:36 GMT, B. R. 'BeAr' Ederson wrote:

> Supersede: I missed the part of your question about georeferencing the
> USTopo Pdf files. These are GeoPdf's. Therefore they come already with
> internal georeferncing information and will load at the correct map
> position (in relation to other GIS data). If they do not, some of your
> data has either missing or incorrect coordinate system information.
> Incompatible coordinate systems are highly unlikely. QGIS supports
> about any coordinate system that is currently in use (or has been in
> past).

Thanks for catching the subtlety that there is a need to combine USGS PDF
quadrangles.

Some reasons for that combined-quadrangle need are kind of obvious, while
others are related to the desire to utilize freeware.

The obvious need is that not every hike stays within a quadrangle, where,
in my experience, two to four quadrangles cover most hikes.

The subtle need is that some of the cross-platform freeware like Avenza on
the mobile devices, is crippled to 3 georeferenced "files", where if you
can combine USGS quadrangles, you have fewer files.

The part about your answer that I'm still confused about is that there is a
*border* on all these georeferenced PDFs. So, while each PDF is
georeferenced, when you remove that border and slap the four quadrangles
together, I'm not at all sure how the georeferencing can stay pristine.

In the case of oziExplorer, I ended up converting the USGS georeferenced
PDFs to a TIFF and then I had to re-georeference that resulting
four-quadrangle TIFF - which was a PITA - but certainly it was doable since
all four corners are always known in each USGS quadrangle geospatial PDF.

To restate the question, I have to first remark that you can't just slap
four quadrangles together becuase there are the borders to deal with, which
have to be cropped off for the inside borders.
+---------------------+ +---------------------+
|.....................| |.....................|
|.....................| |.....................|
|.....................| |.....................|
|.....................| |.....................|
|.....................| |.....................|
|.....................| |.....................|
+---------------------+ +---------------------+
+---------------------+ +---------------------+
|.....................| |.....................|
|.....................| |.....................|
|.....................| |.....................|
|.....................| |.....................|
|.....................| |.....................|
|.....................| |.....................|
+---------------------+ +---------------------+

There are 8 inside borders (actually only 4 if we combine them) which have
to be cropped in order fore the final four-quadrant map to be contiguous.

The open question is how, in Quantum GIS, do we combine those four USGS
geospatial PDF quadrangles into a single geospatial map file?

I suspect there are two possible answers:
1. It just works (since it's a very common need), or,
2. It has to be done manually (which is what I did with oziExplorer)

Arlen Holder

unread,
Aug 10, 2018, 3:22:45 PM8/10/18
to
On 10 Aug 2018 09:27:55 GMT, B. R. 'BeAr' Ederson wrote:

> WMS services can only be used online.

Bummer.
Thanks for your patience in answering that question, where, you'll note, I
do everything reasonable that anyone asks, where people put different
weights on privacy and speeds. But I'm only human. And I'm NOT an expert.

I'm just a guy who wants to track & route while on offtrail local hikes.

BTW, everyone is different, where my desktops are all old and slow.
I live in the mountains so my Internet comes from the sky from miles away.
As such, my WISP is really slow compared to those with wired ISPs.

Plus, I care greatly about privacy (far more so than do most people).
(IMHO ... Why should my detailed tracks and my map activities be placed on
the net for no good reason.)

That's why I prefer offline geospatial USGS PDFs, by the way, since they
can be downloaded and since I only care about a handful of quadrangles -
not the entire world (which the WMS database provides - which is overkill).

Remember, there always was an online solution, even before I asked here:
a. http://caltopo.com (gpx format)
b. http://mygpsfiles.com/app/ (gpx format)
c. https://mapsengine.google.com/map/ (kml format)
etc.
Where this thread question was never about online viewing of anything.

The goal is OFFLINE (aka private) viewing & editing of tracks/maps.
To that end, I _still_ wish to do these two very important things, that I
think ANYONE would want to do, particularly because of the rich breadth of
available historical maps (where you can walk in the footprints of your
ancesters)...

1. How do we combine USGS geospatial PDF quadrangles using QGIS?
2. How do we view tracks on USGS geospatial PDF maps using GGIS?

> There are methods to locally cache
> already retrieved data. But that's too advanced to be elaborated here.

That's good to know Mr Ederson, as you seem to be one of the extremely few
people on this ng who understand these things.

I don't understand them. All I want is what anyone would want.
* Offline free viewing & editing of USGS maps, tracks, & routes.

> Apart from that, WMS usually delivers different scale-dependent content
> details. Therefore, you most likely encounter missing or unfit data
> details with offline cached content.

I understand that the WMS "system" is powerful, not the least of which is
that the entire world appears to be available, whereas I only specifically
care about a handful of USGS quadrangles.

The only quadrangles I care about are those I hike in, and that's why a
USGS geospatial PDF is convenient, particularly a single local geospatial
PDF made out of probably four local separate geospatial PDF quadrants.

For example, it's really *nice* to view the ad-hoc track in real time on an
actual USGS geospatial PDF using the free Avenza software on the iOS and
Android mobile devices - but it's a pain that Avenza only allows 3 free
geospatial files and it's a pain to cross USGS quadrant borders.

Hence it would me immensely helpful to all if we knew how to combine USGS
geospatial quadrants using GQIS into a single larger local geospatial PDF
for use in real time on our mobile devices. (I see that you supplied a hint
below...)

>> b. How to combine & geoCalibrate USGS geoPDF quadrangles using Quantum GIS
>
> Add them either via menu <Layer><Add Layer><Add Vector/Raster Layer...>
> (method file type "Geospatial Pdf" or directory) or directly load them
> from Browser subwindow by either double clicking or using right mouse
> menu entry <Add Selected Layer(s) to Canvas>.
>
> A fast PC and lots of memory help. Still: Start with only 1 file. Later
> on you can experiment with more, if the GeoPdf files load fast enough.

OK. Thanks for that advice. I'll try it, but all my desktops are slow with
low RAM; but the utility of using geospatial PDFs offline is great - so
it's worth the attempt. I will document and report back.

Thanks for being one of the extremely few people who knows this stuff!
The good news is that everyone can benefit from the answers, since what I
want, everyone would want - as it's a basic need for offtrail hiking.

B. R. 'BeAr' Ederson

unread,
Aug 10, 2018, 5:31:00 PM8/10/18
to
On Fri, 10 Aug 2018 19:22:40 -0000 (UTC), Arlen Holder wrote:

[USGS Topo GeoPdf]
> The part about your answer that I'm still confused about is that there is a
> *border* on all these georeferenced PDFs. So, while each PDF is
> georeferenced, when you remove that border and slap the four quadrangles
> together, I'm not at all sure how the georeferencing can stay pristine.

First you need to know, that there are different kinds of US Topo GeoPdf
files available. Some older ones only consist of an image. These files
display rather quick in QGIS, but the borders always get in the way if
you display more than one overlapping GeoPdf at the same time. It is
possible to extract only the map area from such GeoPdf files using some
dedicated GeoTools. (I address this later.)

Newer US Topo GeoPdf files are multilayer. They contain an aerial ortho
image and several vector layers. In the QGIS Browser subwindow you'll see
each GeoPdf file with 2 entries. One with a gray lake(?) symbol, which
gives access to all vector layers of the Pdf file. One with blue and
black squares, which accesses the raster layer. Unfortunately, the latter
does /not/ just access the aerial image, but a completely rendered version
of the GeoPdf. (= The vector layers are overlay-rendered into the image,
which can take a /very/ long time and use quite a bit of the memory.)

If you just load the vector data of the GeoPdf in QGIS, you can disable
each of the vector layers of the GeoPdf, separately. This way you quite
easily can disable the border and any superfluous text on it. When you
combine the vector layers of adjacent GeoPdf files, they combine seam-
and borderless.

Now you'll encounter another problem, though: Lines are displayed just as
simple lines, areas as simple areas and so on. You don't see the usual
attribution displayed on maps. Now you either need to adjust all rules
for attribution by yourself or use predefined style files. Again no luck
for you, I only found ArcGIS attribution files on the Internet:

https://viewer.nationalmap.gov/tools/topotemplate

I don't have the time for doing the conversation. So you either need to
live with simple symbols, create the styles by yourself or get templates
from elsewhere.

Now back to the starting point. Like the old GeoPdf files, the new ones
can also be converted by GeoTools like the GDAL toolset. Nothing for the
faint of heart, but doable. Because I lack the time necessary for writing
a walk-through, I searched for a tutorial on the Internet and found:

https://bitangler.com/creating-maps.html

It has also supporting scripts and should point you in the right
direction. Anyways, I didn't recommend WMS for no reason... ;-)

Arlen Holder

unread,
Aug 10, 2018, 7:06:15 PM8/10/18
to
On 10 Aug 2018 14:30:52 GMT, B. R. 'BeAr' Ederson wrote:

> First you need to know, that there are different kinds of US Topo GeoPdf
> files available.

The good news is I'm just trying to hike, track, view, & route in 1 place.
Hence, there is only ONE set of four USGS quadrangles I care about.

Here's how anyone on this newsgroup can obtain their nearest quadrangles.
============================================================================
Download USGS PDF maps of the desired quadrangles.
1. Create a directory to store your downloaded USGS topographic maps:
mkdir C:\app\database\map\usgs\
2. Visit the USGS National Map Data Download & Visualization Services site:
https://viewer.nationalmap.gov/launch/
3. At top left, press "Download Maps" which takes you to a multipane page:
https://viewer.nationalmap.gov/basic/?basemap=b1&category=histtopo,ustopo&title=Map%20View
Note the right pane contains a map of the United States.
4. Left mouse drag your desired location to the center of that map.
Click the + (zoom) 7 times (re-center as needed) to see quadrangles.
It's simplest if you zoom until you have only 1 or 2 quadrangles in view.
At most, zoom to as many as four contiguous four-corner quadrangles.
5. In the left sidebar, click the blue "Find Products" button.
6. In the left sidebar under "Available Products", click "US Topo" "results".
7. In the left sidebar, scroll until you see the desired quadrangle.
Once you find the desired quadrangle, right click its "Download" button.
Choose to "Save Link As" so as to download the ~30MB PDF file.
8. Save the ~30MB PDFs using the default name of the quadrangle.pdf
C:\app\database\map\usgs\CA_Loma_Prieta_20150226_TM_geo.pdf

Read this document for instructions on how to read the USGS map margins:
http://education.usgs.gov/lessons/mapmargin.pdf (details)
http://education.usgs.gov/lessons/map_margins_2p.pdf (summary)
============================================================================
Note that printing can be done to paper using a good freeware tiler:
<https://sourceforge.net/projects/posterazor/>

Arlen Holder

unread,
Aug 10, 2018, 8:46:32 PM8/10/18
to
On 10 Aug 2018 09:35:36 GMT, B. R. 'BeAr' Ederson wrote:

> Add them either via menu <Layer><Add Layer><Add Vector/Raster Layer...>
> (method file type "Geospatial Pdf" or directory) or directly load them
> from Browser subwindow by either double clicking or using right mouse
> menu entry <Add Selected Layer(s) to Canvas>.

Thanks B. R. 'BeAr' Ederson for that advice which worked reasonably well!

Here's what I just tried after downloading a set of four geospatial PDFs
using the method and file types outlined in this post of a few moments ago:
<https://groups.google.com/d/msg/alt.comp.freeware/W3IjaKFeLrM/BCWbshWoCAAJ>

I figured I'd try a single quadrangle first, before trying to tile them.
I wasn't sure if the USGS geospatial PDFs are "vector" or "raster".
So I guessed at "vector" first.

This pretty much worked, with minor complications of too many layers:
. View the newly downloaded CA_Loma_Prieta_20150226_TM_geo.pdf file:
<http://www.bild.me/bild.php?file=4462770geopdf00.jpg>
. Start Quantum GIS 3.2.1 on Windows 10
<http://www.bild.me/bild.php?file=9663160geopdf01.jpg>
. QGIS:Layer > Add Layer > Add Vector Layer >
<http://www.bild.me/bild.php?file=7538129geopdf02.jpg>
. Data Source Manager Vector > Source
Vector Dataset(s) = C:\tmp\CA_Loma_Prieta_20150226_TM_geo.pdf
<http://www.bild.me/bild.php?file=5773673geopdf03.jpg>
. Click [Add] (It's so slow, be careful not to click twice!)
. It asks "Select Vector Layers to Add"
<http://www.bild.me/bild.php?file=5004482geopdf04.jpg>
. Not knowing any better, I hit [Select All]
<http://www.bild.me/bild.php?file=5858855geopdf05.jpg>
. And then [OK] (It's so slow, be careful not to click twice!)
<http://www.bild.me/bild.php?file=1424688geopdf06.jpg>
. And then [Close] (Be careful to only click once.)
<http://www.bild.me/bild.php?file=3545122geopdf07.jpg>

Well, that worked (albeit, as BeAr Ederson had warned, rather slowly).
At least it's offline - which always is the goal all along.

But now, the question comes how to *join* the four quadrangles in QGIS?

Trying that process with a second quadrangle, seems to kind of work:
<http://www.bild.me/bild.php?file=9247140geopdf08.jpg>
*Notice in that screenshot that the corners actually line up!*

Let's bring in a third contiguous quadrangle:
<http://www.bild.me/bild.php?file=9176734geopdf09.jpg>
And, the fourth:
<http://www.bild.me/bild.php?file=7754255geopdf10.jpg>

At this point, I decided to add the hiking track that I had saved.
And then to zoom to the layer of that track.
<http://www.bild.me/bild.php?file=8848544geopdf11.jpg>

Notice it worked, kind of sort of, but not really all that well:
<http://www.bild.me/bild.php?file=1819179geopdf12.jpg>

The good news is that the USGS geospatial PDF quadrangles seem to line
themselves up automatically, with the borders overlapping such that the
actual map corners coincide at the correct GPS corner dots.

I'm not sure how to make the four quadrangle map borders go away, but
that's probably a "layer" that I hope can be made invisible.

Arlen Holder

unread,
Aug 10, 2018, 11:02:05 PM8/10/18
to
On 11 Aug 2018 00:46:28 GMT, Arlen Holder wrote:

> I'm not sure how to make the four quadrangle map borders go away, but
> that's probably a "layer" that I hope can be made invisible.

Hi B. R. 'BeAr' Ederson,
QGIS is working a LOT better now that I'm getting the hang of layers!
The only thing I have left, I think, is to create a single large geospatial
PDF out of the four quadrangle geospacial PDFs!

Here's the progress so far...

I loaded in the offline geospatial PDFs for the four quadrangles,
which, when I turn on only the track and the terrain countours shows up
quite beautifully!
<http://www.bild.me/bild.php?file=1343863layers01.jpg>

I'm not sure yet how to export the four quadrangles as a single map file
(for input into Avenza crippleware on the iOS & Android mobile devices);
but the great news is that the four maps aiign themselves perfectly
automatically!
<http://www.bild.me/bild.php?file=8243968layers02.jpg>

It's amazing that the Quantum GIS software figures all this out!
<http://www.bild.me/bild.php?file=2137812layers03.jpg>

The result is that the four maps fit perfectly (where the blue lines you
see here I put in after the fact to show where the map borders were):
<http://www.bild.me/bild.php?file=9710070layers04.jpg>

About the only thing I need to do now is save these four geospatial PDF
quadrangles as a *single* (four-times larger) geospatial PDF quadrangle.

If that works - I think we've achieved the goal set out in the beginning of
this thread.

Turning off the borders was due to turning off:
[_]Map Frame Projection and Grids
And I also turned off some of the grids
[_]Map Collar Map Elements
[_]Map Frame PLSS
[_]Map Frame Woodland

I've turned on the following "features" to view & save:
[x]Map Frame Terrain Contours
[x]Map Frame Geographic Names
[xMap Frame Boundaries Jurisdictional Boundaries County or Equivalent
[xMap Frame Geographic Names
[xMap Frame Hydrography
[xMap Frame Structures
[xMap Frame Transportation Road Features
[xMap Frame Transportation Road Names and Shields

One by one I turned things on or off to get just what I wanted to see:
<http://www.bild.me/bild.php?file=6468310layers05.jpg>

This I saved as the perfect combination of the four quadrangles:
<http://www.bild.me/bild.php?file=2229776layers06.jpg>

And then I exported that database to PDF:
<http://www.bild.me/bild.php?file=9861338layers07.jpg>

The question is whether that PDF is a geospatial PDF that can be used on
the mobile device in the Avenza crippleware to display tracks.
<http://www.bild.me/bild.php?file=8814128layers08.jpg>

Darn. That didn't work. It was just a "normal" PDf and not a geospatial
PDF.

I think I should have right clicked on the database, and then saved as
"Geospatial PDF" format like I did earlier perhaps...
<http://www.bild.me/bild.php?file=8835052layers09.jpg>

The true test will be whether Avenza crippleware on iOS & Android will
track on this saved geospacial four-quadrangle PDF - but for now - I need a
quick test to figure out if a PDF is a regular PDF or a geospatial PDF.

Arlen Holder

unread,
Aug 10, 2018, 11:25:09 PM8/10/18
to
On 10 Aug 2018 09:35:36 GMT, B. R. 'BeAr' Ederson wrote:

> I missed the part of your question about georeferencing the
> USTopo Pdf files. These are GeoPdf's. Therefore they come already with
> internal georeferncing information and will load at the correct map
> position (in relation to other GIS data).

This statement from B. R. 'BeAr' Ederson turned out to be 100% accurate!

The 4 geospatial PDFs load perfectly in the right position in QGIS.
<http://www.bild.me/bild.php?file=2805142layers10.jpg>

My only stumbling block now is how to EXPORT the four geospatial PDFs as a
single larger combined geospatial PDF.
<http://www.bild.me/bild.php?file=8710379layers11.jpg>

Arlen Holder

unread,
Aug 10, 2018, 11:32:53 PM8/10/18
to
On 10 Aug 2018 14:30:52 GMT, B. R. 'BeAr' Ederson wrote:

> If you just load the vector data of the GeoPdf in QGIS, you can disable
> each of the vector layers of the GeoPdf, separately. This way you quite
> easily can disable the border and any superfluous text on it. When you
> combine the vector layers of adjacent GeoPdf files, they combine seam-
> and borderless.

I have to commend B. R. 'BeAr' Ederson that everything he said above is
100% correct. I didn't understand what he said until I tried it and saw it
for myself.

The four geospatial quadrangles tied together perfectly and I disabled
viewing of borders which made them one big map in QGIS!
<http://www.bild.me/bild.php?file=2805142layers10.jpg>

The only step left is exporting those selected layers of the four
geospatial PDF quadrangles as a single larger geospatial PDF.

B. R. 'BeAr' Ederson

unread,
Aug 11, 2018, 5:02:52 AM8/11/18
to
On Sat, 11 Aug 2018 03:32:51 -0000 (UTC), Arlen Holder wrote:

[Loading USGS Topo GeoPdf in QGIS]
> The only step left is exporting those selected layers of the four
> geospatial PDF quadrangles as a single larger geospatial PDF.

I'm a bit surprised that you did not complain about the attribution.
Did you already create a suitable style set and apply it to the vector
layers loaded from the GeoPdf files? Or are you content with "just
lines of arbitrary colors"?

Anyway, back to Pdf export. The export filter to Pdf in the menu
<Project><Import/Export><Export Map To Pdf...> doesn't write correct
GeoPdf files at the moment. Therefore you need a little detour. Export
the map first via menu <Project><Import/Export><Export Map To Image...>
to a Tiff file. Be sure to have the "Save world file" option ticked
/on/. (Set dimension, scale and resolution to your needs.)

The resulting Tiff file (including the *.tfw world file) /may/ already
work in your target program. If not, convert it to GeoPdf via QGIS
menu <Raster><Conversion><Translate (Convert Format)...>.

Choose the just exported *.tif(f) and select projection to the one
used inside your original USGS GeoPdf files. (Right click on any layer
loaded from one of your GeoPdf files and look up the CRS setting shown
in the <Properties><Information> section of the "Layer Properties". It
is most likely a NAD83/UTM zone. The EPSG number is sufficient to
identify the CRS.) Now run the process (in background).

The resulting GeoPdf will only contain a continuous image (no vector
layers). This way, it can not be used as flexible as the original
USGS GeoPdf files. OTOH, it should load considerably faster in most
programs.

Arlen Holder

unread,
Aug 11, 2018, 2:51:11 PM8/11/18
to
On 11 Aug 2018 02:02:44 GMT, B. R. 'BeAr' Ederson wrote:

>> The only step left is exporting those selected layers of the four
>> geospatial PDF quadrangles as a single larger geospatial PDF.
>
> I'm a bit surprised that you did not complain about the attribution.

You're far smarter than I am!
Plus, you are the only one who knows anything about this stuff.

So I'm going to stop posting to the other groups, and just stay here!
(see what you did!) :)

To tell you the blunt embarrassing truth, I must first say that almost
nothing you said did I understand at first, and then, when I ran into each
of the things you said I would run into, I realized (only then) what you
were talking about.

I have to say, for each of the things you warned me about that I ran into,
I ADMIRE you for your acumen (and that includes your accurate warning that
geospatial PDFs are slower than the WMS system).

*Everything you said that I ran into & recognized has been 100% correct!*

Hence, I know from that experience, that everything you say is a fact.

However ... two things are wrong with my understanding of the "attribution"
problem.
1. I don't think I ran into it, so,
2. I don't understand what to look for.

Does that make sense?
I'm not ignoring what you said - I just don't understand what you said.

At this point, you've proven yourself to be reliably accurate.
But I don't know what to look for to answer your question.

> Did you already create a suitable style set and apply it to the vector
> layers loaded from the GeoPdf files? Or are you content with "just
> lines of arbitrary colors"?

To answer your question, given I don't understand "styles" so my answer may
frustrate you, I haven't changed anything yet in the maps (other than to
turn off viewing of borders and the text on those borders).

I do notice that each quadrangle seems to default to a different (almost
arbitrarily seeming) color scheme, as you can see in this screenshot...
<http://s1.bild.me/bilder/110417/2805142layers10.jpg>
But at this point, I'm not worried about mere "colors" as I'm still working
on major basic functionality issues...
* Loading contiguous USGS quadrants offline into QGIS freeware (check)
* Viewing tracks & editing routes offline in QGIS freeware (check)
* Saving a larger geospatial PDF out of the four quadrants (still open)

> Anyway, back to Pdf export. The export filter to Pdf in the menu
> <Project><Import/Export><Export Map To Pdf...> doesn't write correct
> GeoPdf files at the moment.

Ah. Thanks. It's amazing, to me, how much you know.
Where you help a lot is when you tell me I'm going down the wrong path.

For example there seem to be (at least) 2 "export" mechanisms in QGIS:
1. Project export
<http://www.bild.me/bild.php?file=9861338layers07.jpg>
2. Feature export
<http://www.bild.me/bild.php?file=8710379layers11.jpg>

Of course, I explored both, and failed with both - which I'm sure you knew
would happen - which is why it is so important that I understand what you
say because you already know what I found out yesterday in trying to get
either one of them to create a geospatial larger PDF out of four smaller
contiguous geospatial PDFs.

I did run searches for how to create a combined geospatial PDF out of
individual geospatial PDFs, but what perplexes me is that almost nobody is
doing, it seems, what I consider to be the very basics:
a. Load given USGS quadrangles into QGIS, so that you can then
b. Spit out a custom area that a mobile device can track & route with

That's really my basic goal - which - I would think - anyone with a mobile
device who tracks and routes off trail would want to do.

> Therefore you need a little detour. Export
> the map first via menu <Project><Import/Export><Export Map To Image...>
> to a Tiff file. Be sure to have the "Save world file" option ticked
> /on/. (Set dimension, scale and resolution to your needs.)

Ah. TIFF. Yuck. But if TIFF is the 'detour', that's what I have to do!

I did try a few of the TIFF related steps you referenced from this site:
<https://bitangler.com/creating-maps.html>

Somehow, I screwed up my gdalinfo.exe by simply running it!
C:\>gdalinfo.exe CA_Loma_Prieta_20150226_TM_geo.pdf -mdd layers

All I did was reverse the options order so that the map could come last:
gdalinfo.exe -mdd layers CA_Loma_Prieta_20150226_TM_geo.pdf
Which, somehow, zeroed out (i.e., wiped out) my "gdalinfo.exe" file!

Don't worry about that though - as I'll just re-install QGIS to get the
gdalinfo.exe back - but that put an end to my testing of that web site's
suggestions since gdalinfo was a key component.

I had never wanted TIFF anyway... (I want geospatial PDFs).

But I will create whatever geospatial format I need to create that the iOS
nad Android mobile device freeware will accept. :)

Note that the oziExplorer approach I noted in the OP also used geospatial
TIFF, only in that case, I had to do all the georeferencing manually, which
allows errors to crop in since I only georeferenced the outside four
corners because I was lazy and didn't want to geoference a hundred points
in that TIFF file - especially given the original geospatial PDF file is
already perfectly georeferenced in the first place.

But, if TIFF is the only way ... then ... I guess.... I want TIFF. :)
(I don't care about intermediated formats but I want it to work in the
mobile device using all the map freeware that can accept custom maps.)
<http://www.bild.me/bild.php?file=8254289android01.jpg>

Here's what I just did (let me know if I goofed) to follow your advice:
. Starting at the four quadrangles loaded with unnecessary layers off
<http://www.bild.me/bild.php?file=8516317export01.jpg>
. QGIS:Project > Import/Export > Export Map to Image
<http://www.bild.me/bild.php?file=3641465export02.jpg>
. [Save]
<http://www.bild.me/bild.php?file=9286370export03.jpg>
. [TIFF format]
<http://www.bild.me/bild.php?file=4065741export04.jpg>
. [test1.tiff]
<http://www.bild.me/bild.php?file=4572834export05.jpg>

> The resulting Tiff file (including the *.tfw world file) /may/ already
> work in your target program.

. What's a tiff world file?
<https://www.file-extensions.org/twf-file-extension>
"The twf files provide real world coordinate information
that allows a corresponding .tif file to be correctly positioned
on a map or in a mapping system."

I agree with you that the output format that matters is whatever the
iOS/Android mobile device mapping/tracking/routing freeware accepts.

The main target, for now, is Avenza iOS and Android crippleware, simply
because the USGS recommends them in their tutorials, and they're cross
platform - but Avenza isn't all that powerful - plus the crippleware is
limited to three (3) "files".

So I'll try that when I'm done typing this up for you to document the steps
so that others can follow by standing on our shoulders.

Avenza sucks, so, after Avenza, I'll try better track/route cross-platform
iOS/Android mobile-device freeware as explained in detail here
<https://groups.google.com/forum/#!topic/comp.mobile.android/zNKD3jyeye4>

> If not, convert it to GeoPdf via QGIS
> menu <Raster><Conversion><Translate (Convert Format)...>.

Hmmmmmm... what is the starting point for that command?
a. The original four-quadrangle geospatial map project?
b. Or the just-now-saved TIFF file?

Starting with the four-quadrangle project
. QGIS:Raster > Conversion > Translate (Convert Format)
<http://www.bild.me/bild.php?file=3120195export06.jpg>
. [Run in Background]
<http://www.bild.me/bild.php?file=5508906export07.jpg>
. Error: Wrong or missing parameter values: Input layer
<http://www.bild.me/bild.php?file=2792188export08.jpg>

(Ooops. I see what you wrote below now which says to use the recently
created TIFF as the starting point and not the four-quadrangle project.)

> Choose the just exported *.tif(f) and select projection to the one
> used inside your original USGS GeoPdf files.

Hmmmmmm... I don't understand those words so let me try them.
. Start QGIS from scratch
<export09>
. Hmmmmmm... there is no menu to import a TIFF file??????

Can you get me past this stumbling block?

Starting from QGIS just opened, how do I import that TIFF file?
Maybe I use this method?
. Start QGIS from scratch
<http://www.bild.me/bild.php?file=4243145export09.jpg>
. QGIS:Layer > Add Layer > ???
<http://www.bild.me/bild.php?file=1855710export10.jpg>

I'm not sure how to import a TIFF file properly. ???

> (Right click on any layer
> loaded from one of your GeoPdf files and look up the CRS setting shown
> in the <Properties><Information> section of the "Layer Properties". It
> is most likely a NAD83/UTM zone. The EPSG number is sufficient to
> identify the CRS.) Now run the process (in background).

I selected a hydrology layer and right clicked on properties
and then Information to show this;
<http://www.bild.me/bild.php?file=5170747export11.jpg>

What does this result mean to you?
CRS = EPSG:26910 - NAD83 / UTM zone 10N - Projected

> The resulting GeoPdf will only contain a continuous image (no vector
> layers). This way, it can not be used as flexible as the original
> USGS GeoPdf files. OTOH, it should load considerably faster in most
> programs.

I wonder if there is a robust way with other free Windows or Linux software
perhaps to combine four existing USGS geospatial PDFs into a single
geospatial PDF?

B. R. 'BeAr' Ederson

unread,
Aug 11, 2018, 4:20:13 PM8/11/18
to
On Sat, 11 Aug 2018 18:51:07 -0000 (UTC), Arlen Holder wrote:

[Missing vector attribution / no style info]
> I do notice that each quadrangle seems to default to a different (almost
> arbitrarily seeming) color scheme, as you can see in this screenshot...

That's what I was talking about: If you have a printed map, contour lines
are always a special shade of brown. Not red, not yellow,... If you take
the Pdf files downloaded and look inside them with a Pdf viewer, you'll
see all contour lines and of course every other theme/layer with the
correct attribution.

When extracting the vector layers in QGIS, they are "just" lines without
the original attribution. Usually, that's not the visual somebody would
want. To circumvent this problem, one can take 1 example vector set and
adjust the attribution to look correct. This attribution information can
be exported as style file. The style file in turn can later on be applied
to vector sets from other GeoPdf files.

Somebody has to bite the bullet and create these style files. USGS did
so themselves for ArcGIS. (Probably, because they use this commercial
GIS software, themselves.) They did it in a way, that cannot be converted
easily to QGIS. Lots of handiwork... I don't think, this was intentionally.
It is just the way it is. So either way: Re-creating the style from scratch
or convert step by step from ArcGIS takes time.

> * Loading contiguous USGS quadrants offline into QGIS freeware (check)
> * Viewing tracks & editing routes offline in QGIS freeware (check)
> * Saving a larger geospatial PDF out of the four quadrants (still open)

IMHO, you're better off doing the conversation on command line using
the tools installed with QGIS. This would be quicker and could be
automated.

Some examples:

Notes:
- The tools mentioned can be found in the Bin subdirectory of the main
QGIS installation folder.
- a1.pdf, a2.pdf stand for 2 USGS Topo GeoPdf files (renamed for shorter
command lines)

(1) Extract the aerials from the pdf files to GeoTiff and stitch them
together. Afterwards convert them to a large GeoPdf:

gdal_translate a1.pdf a1_ortho.pdf -of Pdf --config GDAL_PDF_LAYERS "Images.Orthoimage"
gdal_translate a2.pdf a2_ortho.pdf -of Pdf --config GDAL_PDF_LAYERS "Images.Orthoimage"
gdalwarp -srcnodata 255 -dstnodata 255 a1_ortho.pdf a2_ortho.pdf a1a2_ortho.tif
gdal_translate a1a2_ortho.tif a1a2_ortho.pdf -of Pdf

(2) Extract the main vector layers to raster-Pdf. Combine them to GeoTiff
and convert it to GeoPdf. (Direct combine to GeoPdf doesn't work here.)
I addition to the layers disabled by default in the GeoPdf (like the
aerial image), the following disables the surplus border texts and so
on, as well:

gdal_translate a1.pdf a1_map.pdf -of Pdf --config GDAL_PDF_LAYERS_OFF "Map_Collar,Map_Frame.Projection_and_Grids,Barcode"
gdal_translate a2.pdf a2_map.pdf -of Pdf --config GDAL_PDF_LAYERS_OFF "Map_Collar,Map_Frame.Projection_and_Grids,Barcode"
gdalwarp -srcnodata 255 -dstnodata 255 a1_map.pdf a2_map.pdf a1a2_map.tif
gdal_translate a1a2_map.tif a1a2_map.pdf -of Pdf

(3) Enable layers that are disabled by default and keep several other
layers switched on. With the gdal_translate PDF config switches you
can only switch off /or/ list (all!) the layers to be displayed.
Therefore, the next command line is rather long. I only list the
first command as an example. All other steps work like shown in the
examples (1) and (2):

---Start: Everything from here on has to be on 1 line!---
gdal_translate a1.pdf a1_map_shaded.pdf -of Pdf --config GDAL_PDF_LAYERS "Map_Frame.Geographic_Names,
Map_Frame.Structures,
Map_Frame.Transportation,
Map_Frame.Transportation.Road_Names_and_Shields,
Map_Frame.Transportation.Road_Features,
Map_Frame.Transportation.Trails,
Map_Frame.Transportation.Railroads,
Map_Frame.Transportation.Airports,
Map_Frame.PLSS,
Map_Frame.Wetlands,
Map_Frame.Hydrography,
Map_Frame.Terrain,
Map_Frame.Terrain.Contours,
Map_Frame.Terrain.Shaded_Relief,
Map_Frame.Woodland,
Map_Frame.Boundaries,
Map_Frame.Boundaries.Jurisdictional_Boundaries,
Map_Frame.Boundaries.Jurisdictional_Boundaries.International,
Map_Frame.Boundaries.Jurisdictional_Boundaries.State_or_Territory,
Map_Frame.Boundaries.Jurisdictional_Boundaries.County_or_Equivalent,
Map_Frame.Boundaries.Federal_Administered_Lands,
Map_Frame.Boundaries.Federal_Administered_Lands.National_Cemetery,
Map_Frame.Boundaries.Federal_Administered_Lands.National_Park_Service,
Map_Frame.Boundaries.Federal_Administered_Lands.Department_of_Defense,
Map_Frame.Boundaries.Federal_Administered_Lands.Forest_Service"
---End: Everything until here has to be on 1 line!---

(4) Something similar like (3) is possible for aerial with overlay:

---Start: Everything from here on has to be on 1 line!---
gdal_translate a1.pdf a1_map_ortho.pdf -of Pdf --config GDAL_PDF_LAYERS "Map_Frame.Geographic_Names,
Map_Frame.Structures,
Map_Frame.Transportation,
Map_Frame.Transportation.Road_Names_and_Shields,
Map_Frame.Transportation.Road_Features,
Map_Frame.Transportation.Trails,
Map_Frame.Transportation.Railroads,
Map_Frame.Transportation.Airports,
Map_Frame.PLSS,
Map_Frame.Wetlands,
Map_Frame.Hydrography,
Map_Frame.Terrain,
Map_Frame.Terrain.Contours,
Map_Frame.Boundaries,
Map_Frame.Boundaries.Jurisdictional_Boundaries,
Map_Frame.Boundaries.Jurisdictional_Boundaries.International,
Map_Frame.Boundaries.Jurisdictional_Boundaries.State_or_Territory,
Map_Frame.Boundaries.Jurisdictional_Boundaries.County_or_Equivalent,
Map_Frame.Boundaries.Federal_Administered_Lands,
Map_Frame.Boundaries.Federal_Administered_Lands.National_Cemetery,
Map_Frame.Boundaries.Federal_Administered_Lands.National_Park_Service,
Map_Frame.Boundaries.Federal_Administered_Lands.Department_of_Defense,
Map_Frame.Boundaries.Federal_Administered_Lands.Forest_Service,
Images,
Images.Orthoimage"
---End: Everything until here has to be on 1 line!---

Additional note:
To get a list of all layers (and their names) present inside the GeoPdf
files, run the following command (that you already came across elsewhere)
on them:

gdalinfo -mdd LAYERS a1.pdf

Maybe these command line steps work better for you, than the earlier
described GUI approach? Please note: Every GeoTiff and GeoPdf created
in the steps above can be loaded in QGIS for visualization, afterwards.
This way you can overlay them with routes (and so on), as you see fit.
If you need to merge the rout into the GeoPdf, you either need to
follow the GUI approach listed in my earlier posting. Or you do it via
commandline. (Which is also possible...) Because, usually, routes are
managed independently from map layers inside navigational devices or
programs, I don't elaborate this here further.

The converted files (GeoTiff and the new GeoPdf) are already rendered
and therefore will load much quicker in QGIS.

B. R. 'BeAr' Ederson

unread,
Aug 12, 2018, 8:24:01 AM8/12/18
to
Following myself up. (I read my post again, today, and noticed, that I
left out several points which I originally wanted to address...)

If you intent to make use of the GDAL toolset, you ought to start the
OSGeo4W shell via QGIS section in the Windows Start menu. (This ensures,
that the necessary environment variables are set up, correctly.) You
could also start the tools from QGIS GUI, separately. Best way to do this
is to open the "Processing Toolbox" via <Processing> menu. The toolbox has
a main GDAL section, where you can start a GUI wrapper for these tools.
GDAL_Translate, for instance, can be found under:
<GDAL><Raster Conversion><Translate (convert format)>.

Drawback of the GUI versions is, that the whole process usually is
considerably slower. You can, for instance, load GeoPdf input files
directly from disk into the toolset input field(s). (I.e.: No need to
have them preloaded in QGIS.) Opposite to the command line tools the
GUI versions start a time-consuming file analysis even before the
processing begins. (Which may fail for completely valid files...)

When using the command line versions, you always start with the
program name. (Including its path, when it happens to /not/ being
found in the search path. - Which shouldn't happen when using the
OSGeo4W shell.)

| Somehow, I screwed up my gdalinfo.exe by simply running it!
|
| C:\>gdalinfo.exe CA_Loma_Prieta_20150226_TM_geo.pdf -mdd layers
|
| All I did was reverse the options order so that the map could come last:
| gdalinfo.exe -mdd layers CA_Loma_Prieta_20150226_TM_geo.pdf
| Which, somehow, zeroed out (i.e., wiped out) my "gdalinfo.exe" file!

The command above would have worked nicely, if you hadn't included the
shell prompt in your command. The "C:\>" you seemed to have copied from
some website is just the prompt of current drive and directory, which
you see when opening a command shell. If the active directory would
have been "C:\TEMP" then the prompt would look like "C:\TEMP>" if it
was configured in the standard look. If you include the ">" sign in
a "real" command issued behind the command prompt, it works as "standard
output" redirection. In your case the result of pressing <Enter> after
running the pseudo-command "C:\" was redirected to be the new content of
gdalinfo.exe. The command "C:\<Enter>" leads to an error, which will be
printed on the "standard error device" instead of the "standard output
device". Nothing will be written on "standard output". Hence gdalinfo.exe
was replaced by empty content. Please note: "standard error device" and
"standard output device" are usually configured to be the same, when
printing on console, but different when being redirected to file.)

The correct command would have been:

gdalinfo.exe CA_Loma_Prieta_20150226_TM_geo.pdf -mdd layers

Next problem with your command above would have been, that the *.pdf
file would probably have /not/ been found by the command, because it
neither was in the current directory nor in the search-path. Therefore,
the first step after opening the OSGeo4W shell is changing the active
directory. If your documents reside in D:\Maps\Topo you need to run
the following command first on the OSGeo4W shell prompt:

cd /d D:\Maps\Topo

The switch /d can be omitted, if the drive stays the same. If the path
includes spaces, the whole drive and path string needs to be included
in quotation marks.

Another point probably requiring more explanation:
> gdalwarp -srcnodata 255 -dstnodata 255 a1_ortho.pdf a2_ortho.pdf a1a2_ortho.tif

NoData sets the transparency color. When (like in above command) only
one color value is listed, it is applied to all color channels. The
above sets white to be transparent. Therefore, overlapping borders of
the map are ignored. Transparency isn't recognized for Pdf conversation
in any GDAL tool, at the moment. Therefore, the in-between-step of
Tiff-conversion is necessary.

When just using the converted (gdal_translate) Pdf files inside QGIS,
you can set the transparency for the loaded maps (e.g. a1_ortho.pdf)
via right mouse menu of that layer: <Properties><Transparency>. Set
the entry for "Additional no data value" to 255. So you don't need
to process the Pdf files further, if you just wish to display them.
Maybe your navigation program permits setting a transparency value,
too. Then again you can use all the Pdf files created by the first
conversation step in my examples from the previous posting. (No need
to merge them with in-between Tiff creation.)

The more files you merge, the more memory is required for displaying
them. This can be mitigated a bit by creating tiled GeoPdf files. The
last command of my second example from my previous post would then
change to:

gdal_translate a1a2_map.tif a1a2_map.pdf -of Pdf -co TILED=yes

It is possible to use the internal NEATLINE information of the GeoPdf
files to crop the information to the actual map area. I display the
necessary steps by changing my previous example (2), which will bring
you nearest to your original intentions without the need to actually
merge the files into a big one. (That's the reason why I omit the
second Pdf in the following conversation.):

(2a)
gdal_translate a1.pdf a1_map.pdf -of Pdf --config GDAL_PDF_LAYERS_OFF "Map_Collar,Map_Frame.Projection_and_Grids,Barcode"
@echo ID,Coordinates>crop.csv
for /f " usebackq tokens=2 delims==" %i in (`gdalinfo a1.pdf ^| find "NEATLINE"`) do @echo 1,"%i" >>crop.csv
gdalwarp -cutline crop.vrt -cl Crop -crop_to_cutline a1_map.pdf a1_map_cut.tif
gdal_translate a1_map_cut.tif a1_map_cut.pdf -of Pdf

Please note, that the crop area is retrieved from the original a1.pdf,
not the converted one. The latter has an altered NEATLINE spanning the
whole area. (The old one could have been redefined during the creation
of a1_map.pdf. But I though this as too much hassle...)

You need to pre-create the crop.vrt used in the fourth step. It can be
used unaltered for all conversions, as long as the coordinate system
stays the same. (Check the EPSG value and adjust it to your needs.)

;---<Start: crop.vrt>-------------------------------------------------
<OGRVRTDataSource>
<OGRVRTLayer name="Crop">
<SrcDataSource >crop.csv</SrcDataSource>
<GeometryType>wkbPolygon</GeometryType>
<FID>ID</FID>
<GeometryField encoding="WKT" field="CropArea"/>
<LayerSRS>EPSG:26910</LayerSRS>
</OGRVRTLayer>
</OGRVRTDataSource>
;---<End: crop.vrt>---------------------------------------------------

Arlen Holder

unread,
Aug 12, 2018, 10:53:01 AM8/12/18
to
On 11 Aug 2018 13:20:03 GMT, B. R. 'BeAr' Ederson wrote:

> That's what I was talking about: If you have a printed map, contour lines
> are always a special shade of brown.

Thanks for Explaining that as almost everything you say, I don't understand
at first, but then I understand, only because I "see" it in the flesh!

Bear in mind, I just wanted these things - nothing more:
a. Using freeware to create a "custom" quadrangle based on USGS maps
b. Tracking on that custom quadrangle on iOS/Android map freeware
c. Creating routes on desktop freeware & then routing on iOS/Android

Now that I know more about WMS/geoPDF, I realize that none of that requires
the net other than to download the original map so I'm ok if we use WMS or
geoPDF to create the custom map area.

> Not red, not yellow,... If you take
> the Pdf files downloaded and look inside them with a Pdf viewer, you'll
> see all contour lines and of course every other theme/layer with the
> correct attribution.
>
> When extracting the vector layers in QGIS, they are "just" lines without
> the original attribution. Usually, that's not the visual somebody would
> want. To circumvent this problem, one can take 1 example vector set and
> adjust the attribution to look correct. This attribution information can
> be exported as style file. The style file in turn can later on be applied
> to vector sets from other GeoPdf files.

Seems to me, as you note below, only one person has to "bite the bullet"
since USGS maps are pretty standard, and especially since all I'm
downloading from the USGS site is the *latest* maps, which is about as
standard as a thing anyone could possibly do.

> Somebody has to bite the bullet and create these style files. USGS did
> so themselves for ArcGIS. (Probably, because they use this commercial
> GIS software, themselves.) They did it in a way, that cannot be converted
> easily to QGIS. Lots of handiwork... I don't think, this was intentionally.
> It is just the way it is. So either way: Re-creating the style from scratch
> or convert step by step from ArcGIS takes time.

You can tell I'm all for standing on other people's shoulders and then
allowing them to stand on mine. If I have to create that "style file", then
I will (later) and I will give it to everyone - but I can't be the first
person on the planet who sues USGS files in QGIS.

So it must already exist. Somewhere.

> IMHO, you're better off doing the conversation on command line using
> the tools installed with QGIS. This would be quicker and could be
> automated.

I'm fine with the command line as I came from UNIX as did all of us.
I have to uninstall and reinstall QGIS though - as I accidentally screwed
up the bin directory.

It doesn't matter to me GUI or command line (as long as I know what the
steps are, of course). Besides, I'm not creating "custom" maps so much as
simply slapping together 4 to 6 existing USGS quadrangles into a single
larger map.

> - The tools mentioned can be found in the Bin subdirectory of the main
> QGIS installation folder.
> - a1.pdf, a2.pdf stand for 2 USGS Topo GeoPdf files (renamed for shorter
> command lines)

It's interesting that you're like me in that you "explain" things.

> (1) Extract the aerials from the pdf files to GeoTiff and stitch them
> together. Afterwards convert them to a large GeoPdf:
>
> gdal_translate a1.pdf a1_ortho.pdf -of Pdf --config GDAL_PDF_LAYERS "Images.Orthoimage"
> gdal_translate a2.pdf a2_ortho.pdf -of Pdf --config GDAL_PDF_LAYERS "Images.Orthoimage"
> gdalwarp -srcnodata 255 -dstnodata 255 a1_ortho.pdf a2_ortho.pdf a1a2_ortho.tif
> gdal_translate a1a2_ortho.tif a1a2_ortho.pdf -of Pdf

I'm re-installing QGIS now to try that as the command line is nice because
it's consistent and easy to apply to all situations so that others benefit
too.

> Maybe these command line steps work better for you, than the earlier
> described GUI approach? Please note: Every GeoTiff and GeoPdf created
> in the steps above can be loaded in QGIS for visualization, afterwards.
> This way you can overlay them with routes (and so on), as you see fit.
> If you need to merge the rout into the GeoPdf, you either need to
> follow the GUI approach listed in my earlier posting. Or you do it via
> commandline. (Which is also possible...) Because, usually, routes are
> managed independently from map layers inside navigational devices or
> programs, I don't elaborate this here further.
>
> The converted files (GeoTiff and the new GeoPdf) are already rendered
> and therefore will load much quicker in QGIS.

I had tried the previously saved geoTIFF (with the world file) in Avenza
freeware on Android - but Avenza complained that it wasn't georeferenced
(and Avenza didn't even "see" the world file either).

So I am going to re-install GQIS and try this anew & report back.
I like the command line for a few good reasons.

1. Since I'm using USGS maps, anyone can follow in our footsteps
2. All the maps are standard so the steps should be standard
3. What I want to do - anyone would want to do

So the leverage, if I can get it working, is perfect.

I will report back (I see another post from you where this last post took
about 20 hours elapsed time as yesterday I had an emergency repair to my
well pumps so that took me out of commission for a while).

Bear in mind I have to run the tests above so be patient with me.

Arlen Holder

unread,
Aug 12, 2018, 10:53:51 AM8/12/18
to
On 12 Aug 2018 05:23:57 GMT, B. R. 'BeAr' Ederson wrote:

> Following myself up. (I read my post again, today, and noticed, that I
> left out several points which I originally wanted to address...)

Yesterday I had a well-pump (actually booster pump) emergency (no water
pressure!) so I was unable to run the command-line stuff - but I can run
them today and report back so your update will be taken into account.

> If you intent to make use of the GDAL toolset, you ought to start the
> OSGeo4W shell via QGIS section in the Windows Start menu. (This ensures,
> that the necessary environment variables are set up, correctly.) You
> could also start the tools from QGIS GUI, separately. Best way to do this
> is to open the "Processing Toolbox" via <Processing> menu. The toolbox has
> a main GDAL section, where you can start a GUI wrapper for these tools.
> GDAL_Translate, for instance, can be found under:
> <GDAL><Raster Conversion><Translate (convert format)>.

I'm not quite sure of what you mean but I am re-installing QGIS so I'll go
through EVERY line of both your posts, line by line, which is how I do
things.

> Drawback of the GUI versions is, that the whole process usually is
> considerably slower.

Another drawback of the GUI is that it's harder for others to reproduce.
The nice thing about what you're showing me is that I'm using standard maps
which anyone can access for free, so, the command line should work fine.

The ONLY thing we would need to change for any other person is the list of
4 tp 6 maps to make a larger map. Everything else should be exactly the
same for everyone.

So the LEVERAGE is tremendous!

> When using the command line versions, you always start with the
> program name. (Including its path, when it happens to /not/ being
> found in the search path. - Which shouldn't happen when using the
> OSGeo4W shell.)

I usually don't modify the $PATH but if the shell does that, I'll use it as
I don't want to type a path that I don't have to type.

Most (almost all) of the remaining stuff was too deep for me at this point,
so please let me run the previous steps first so that I can document step
by step for everyone what you're kindly explaining for me.

I'll be back...

B. R. 'BeAr' Ederson

unread,
Aug 12, 2018, 1:46:51 PM8/12/18
to
On Sun, 12 Aug 2018 14:52:57 -0000 (UTC), Arlen Holder wrote:

> Now that I know more about WMS/geoPDF, I realize that none of that requires
> the net other than to download the original map so I'm ok if we use WMS or
> geoPDF to create the custom map area.

WMS works only online. Specific exceptions with locally cached content
aside, because it is not easy to set up. (Works with maintaining a local
server.) The GeoPdf solutions are, IMHO, second class in general. But
if you /need offline/ maps, they are the way to go.

> Seems to me, as you note below, only one person has to "bite the bullet"
> since USGS maps are pretty standard, and especially since all I'm
> downloading from the USGS site is the *latest* maps, which is about as
> standard as a thing anyone could possibly do.

The attribution is a non-issue, when you go the GDAL scripts way. This way
you get correctly rendered raster representations of the map. Although
vector variants usually are better (scalable, smaller size compared to
raster), the missing attribution styles making them less preferable.
If someone was creating suitable styles, the scales would tip back to
vector.

>> Somebody has to bite the bullet and create these style files. USGS did
>> so themselves for ArcGIS. (Probably, because they use this commercial
>> GIS software, themselves.) They did it in a way, that cannot be converted
>> easily to QGIS. Lots of handiwork... I don't think, this was intentionally.
>> It is just the way it is. So either way: Re-creating the style from scratch
>> or convert step by step from ArcGIS takes time.
>
> You can tell I'm all for standing on other people's shoulders and then
> allowing them to stand on mine. If I have to create that "style file", then
> I will (later) and I will give it to everyone - but I can't be the first
> person on the planet who sues USGS files in QGIS.
>
> So it must already exist. Somewhere.

If you find them, let us know. ;-)

> It's interesting that you're like me in that you "explain" things.

Better explained once than answering three inquiries for confirmation. ;-)

> I had tried the previously saved geoTIFF (with the world file) in Avenza
> freeware on Android - but Avenza complained that it wasn't georeferenced
> (and Avenza didn't even "see" the world file either).

The GeoTiff in such cases is (technically spoken) even georeferenced
/twice/. It carries internal georeferencing information /and/ has the
world file. Only thing left may be a projection file. But one would
need to check with Avenza documentation to narrow down the problem.
Maybe, this software doesn't support GeoTiff at all or needs the data
internally compressed with a specific compression scheme. (Tiff format
supports several.)

> I will report back (I see another post from you where this last post took
> about 20 hours elapsed time as yesterday I had an emergency repair to my
> well pumps so that took me out of commission for a while).
>
> Bear in mind I have to run the tests above so be patient with me.

Usenet is no real time media. Take all the time you need. Be sure to
also read some later explanations before running a command line. If you
don't create the *.vrt file before running the command line requiring
it, all you'll get is an error... ;-)

One note to a point from your other post:
| > When using the command line versions, you always start with the
| > program name. (Including its path, when it happens to /not/ being
| > found in the search path. - Which shouldn't happen when using the
| > OSGeo4W shell.)
|
| I usually don't modify the $PATH but if the shell does that, I'll use it as
| I don't want to type a path that I don't have to type.

The OSGeo4W shell starting script alters %PATH% to get access to all
GIS tools installed by QGIS and sets some additional variables. Both
settings are not available when running the Windows command or cmd
shell directly.
0 new messages