Welcome, Guest. Please login or register.

Login with username, password and session length
Forums Search:  


Author Topic: Converting dashed lines to long GPX tracks  (Read 3031 times)

Pooneil

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 1
    • View Profile
Converting dashed lines to long GPX tracks
« on: February 10, 2017, 06:49:54 AM »
I am extracting the hiking trails data from USGS 2016 Topo PDF maps for an area in Colorado using QGIS.  The extracted information is then saved as a KML.  The KML file contains a series of short lines, with numbers for names, that make up the dashed trails on the map. 

In Basecamp, one can manually join these into a long string for individual trials, but the process is slow and tedious.  The difficulty has several reasons including inconsistent numbering of the segment names and Basecamp's not recognising the numeric order. (ex. 2101 shows between 210 and 211)

I have used the IMGfromGPX program to convert a GPX of the data into a map that shows the dashed lines.  It works OK but each dash has a name displayed, making for an unusably cluttered map.

My goal is have trail linestrings for a Garmin map on my 62ST. 

Ideally, I would like to have a shapefile, GPX or KML of the trail linestrings and be done with it.  The US Forest Service has a shapefile with trails from the Western US but it does not include Colorado and other areas, like Texas.

Short of that, I am looking for suggestions on how to speed up the process, of making a GPX for the map.

jolly47roger

  • Mapper
  • ***
  • Posts: 68
  • Karma: 6
    • View Profile
Re: Converting dashed lines to long GPX tracks
« Reply #1 on: February 10, 2017, 08:56:22 AM »
One possibility....

Try loading the KML into GPSU (www.gpsu.co.uk) - I guess it will appear as a series of broken tracks. If so, you can click on the start of each chunk and use Tools>Join/split track.

And save the result as a GPX.

If there is a large number of pieces, save as a PLT, use a text editor to convert all but the first ",1," to ",0," then reload the PLT and save as a GPX.

Pooneil

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 1
    • View Profile
Re: Converting dashed lines to long GPX tracks
« Reply #2 on: February 10, 2017, 09:40:33 AM »
Thanks. 

I updated to the latest version and ran a test. The first problem is I am not a registered user so GPSU caps my input at a small fraction of the individual dashes that make up the whole map.  There are thousands per file. 

GPSU does rename them on saving a GPX in a somewhat more orderly way, but maintains the broken nature of the original KML names,  in that a trail may be made of of a series of dashes with non-sequential numbers.  And a series of numbers suddenly goes from one trail to another, sometimes for only one dash.

THe USGS clearly did not design these for reverse engineering. 

I'll look at the options some more.  I don't regularly use the program so I welcome any suggestion on how to make sense of it. 

Thanks again. 

Boyd

  • Expert Advisor
  • *****
  • Posts: 3837
  • Karma: 43
    • View Profile
Re: Converting dashed lines to long GPX tracks
« Reply #3 on: February 10, 2017, 11:51:10 AM »
THe USGS clearly did not design these for reverse engineering.

That is true, as explained here: https://www2.usgs.gov/faq/categories/9797/3590

Quote
Topo maps are derived from GIS data sets and are formatted as PDF for the benefit of non-specialist users. We consider the product to be primarily an output of, rather than an input to, GIS.

But you should be able to download the raw data that was used to create these maps. Have not looked at it recently, but I think you can go to the National Map Viewer and select an area to download. You should then be able to choose road/trail data in the form of shapefiles.

Another possibility would be to look at OpenStreetMap and see if they have the data you want. You can also download it as shapefiles.

Pooneil

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 1
    • View Profile
Re: Converting dashed lines to long GPX tracks
« Reply #4 on: February 10, 2017, 01:09:30 PM »
Thanks Boyd for those suggestions.

It is not apparent at first look how to download from the National Map.  My experience with the USGS site is that it is slow, balky and the error messages are not very helpful.

OSM has some trails on the visual map but it did not appear in my initial downloads. There are many ways to download data, so I'll keep trying. 

If you have any pointers I'd appreciate anything you can do. 

I'll keep poking around on both sites to find the solution, because anything is better than extracting data from the USGS geopdfs for a large area.   

Boyd

  • Expert Advisor
  • *****
  • Posts: 3837
  • Karma: 43
    • View Profile
Re: Converting dashed lines to long GPX tracks
« Reply #5 on: February 10, 2017, 02:12:20 PM »
I swear they keep changing the interface every time I go there.  ;D But this is what I would do. Go to the Map Viewer https://viewer.nationalmap.gov/basic/

Zoom in on the area you want. There are various ways to choose your area of interest, the simplest would be the default, "current extent", which covers whatever you see on the screen.

In the left panel, check the Transportation box and shapefile format. You can also add USFS roads if you want. Now click "find products" at the top of the left panel. You will see a list of available data. Clicking the footprint link will show the area that it covers.

Click the shopping cart + symbol for anything you want, then click "View Cart". There will be a download button next to each item in the cart. As I understand it, this is the raw road data that the USGS uses to create those topo maps, so just extract whatever trails/roads you want with qGIS, it will not have any styles associated but there will be attributes that indicate what each line represents.

If you want to use OpenStreetMap, shapefiles for each state can be downloaded here: http://download.geofabrik.de/north-america.html

I have only played briefly with qGIS so I can't help much there, I use GlobalMapper for everything.
« Last Edit: February 10, 2017, 02:17:39 PM by Boyd »

Pooneil

  • Jr. Member
  • **
  • Posts: 19
  • Karma: 1
    • View Profile
Re: Converting dashed lines to long GPX tracks
« Reply #6 on: February 10, 2017, 03:31:30 PM »
Thanks again Boyd.


I found the way to get the shapefile from the USGS.  It is not identical to the information contained in the 2016 topos but it is a big help.  I can fill in any needed trails manually rather than do the whole area of interest.

This beats scraping from the topos or Google maps. 

The OSM downloads I made lump trails and streets into one XML file.  I'll look at your link for further clarity on the offerings. 



QGIS is a great free program for occasional, recreational map makers.  Recreational meaning those that make maps for fun, rather than for work.  It just so happens that my recreational map making is for recreational use.  It is a major learning curve, in both terminology and functionality.  Thankfully there is a helpful forum on Stack Exchange.

Now I can look at Texas to see if there are any regional trials my group hasn't hiked. 

Thanks again. 


 

anything