Welcome, Guest. Please login or register.

Login with username, password and session length
Forums Search:  


Author Topic: Snags and workarounds w Garmin tutorial  (Read 192 times)

unlost

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Snags and workarounds w Garmin tutorial
« on: August 16, 2020, 06:43:29 AM »
I have pretty much zero experience w/ gis or python etc, so I hit this about as cold as you can get.  Trying to make a custom map for an eTrex Vista HCx which won't take images like the current crop of units.

(may be more I fill into this post at a later time)

Highly recommend just working a small map at first as you work out the kinks.  I ended up using a single contour section, made a vector layer where I drew a polygon to fit the contours, and cropped all the other data using that polygon.

Setup
Windows10
QGIS 3.14
Plugins Table Manager and Gridsplitter are not a thing anymore.  The Table Manager stuff you can do in the Toolbox (gear icon) and going into Vector Tables.  "Drop Fields" item got used a lot.

PostGIS/PostgreSQL 12
The shapefile/DBF Loader/exporter is installed as a separate program (i.e. Start menu "PostGIS Bundle 3 for ....").  Works pretty much the same as in the tutorial.  Youtube would lead you believe you have to enter an SRID/EPSG number (which defines the projection spacial reference stuff) for each file prior to hitting Import, but as long as you're going to export them back into the same folder, you don't need to sweat that.

Contour Data
Try as I might, I couldn't get the batch file for FWTools to work.  Ended up editing the batch file from the Transportation section.

The National Map Viewer d/l gave me both DBF and Shapefile options even when Shapefile is selected.  Just keep an eye out--don't need the DBF ones (unless I guess you're building your own contours).

Water Data
NHDFlowline
NHD file form the National Map Viewer gave me 3 NHDFlowline files.  Need all of them to get the smaller creeks and stuff.  Modified the SQL query in the tutorial accordingly to assign MP_Types (e.g. "ALTER TABLE nhdflowline..." --> "ALTER TABLE nhdflowline3...")

Had problems where when I zoomed in, stuff would disappear.  Related issue was QGIS putting up a fight when cropping the layer--go clean it up before you crop.  Before you go into the PostGIS stuff, load them into QGIS.  Then Vector/Geometry Tools/Check Validity.  Let it spew into the temp diagnostic layers.  If the dialog box indicates you have errors/invalid, select the original layer (e.g. NHDflowline2) and click the Edit (pencil) button.  Then the Vertex Tool.  Find all the dots on your map (mine were all coastal puddle looking things).  Either drag across swaths of the offending area and hit delete or select the offending circle and delete.  Either works.  Selecting more than a pretty tiny area may choke out the computer.  Be sure you delete points such that you don't have lines that will snap across another line when the error is removed.  Save the original file, and delete the 3 diagnostic output layers.  If there's more than a couple issues, you may need to run it again (mine had dozens each).  If you can't fix the original file, you can fix the Invalid layer and merge it with the valid layer to get a shapefile that works.

NHDArea
Same thing as above with zooming in and stuff disappears.  Check Validity tool.  QGIS doesn't like polygons with holes at the edges.  Select the NHDArea layer, Edit, Vertex Tool.  Select the offending vertex and move it slightly, then save.

NHDWaterbody
Same thing.  Couldn't fix the original file b/c I couldn't select anything to work on.  Ended up fixing the issues on the temporary layer (Invalid) and merging it with the other temporary layer (Valid).

Looking at my map in QGIS, it looked like I decided to tweak the NHDArea query to keep the fcode for rapids, so I adjusted the query by deleting the "or fcode = '43100'" from the DELETE FROM line and added a new UPDATE line for that fcode and mapped it to MP_TYPE '0x48' (one of the RIVER types).

Points of Interest
When importing the text file, I used the NAD83 coordinate ref system w/ the same epsg number (4269) that it shows in the bottom right corner of QGIS with the other National Map Viewer files.  There are lots of NAD83 options, and this seemed to make sense.

Federal Lands and Borders
I didn't need borders since my test chunk was in the middle of the state.  Skipped a bunch of Federal Lands things since some of that is not much of a thing here in the northeast US.

Combining
Step 3 has you delete the extra fields from the tables of each file.  Toolbox/Vector Tables/Drop Fields.

Merging Layers
MMQGIS didn't work out.  It needs all the geometry types (e.g. MultiLineStringZM) to be the same.  I used Toolbox/Vector General/Merge Vector Layers.

(more to come in this post)
« Last Edit: August 17, 2020, 03:02:54 PM by unlost »

unlost

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
    • View Profile
Re: Snags and workarounds w Garmin tutorial
« Reply #1 on: August 16, 2020, 06:32:13 PM »
I may have lost track of which files were which but had troubles getting GPSFDshp2mp to run.  Two things eventually seemed to work:
Drop Z/M Values (Toolbox/Vector Geneneral) from all three combined files
Multipart to Singleparts for all three combined files (tutorial doesn't mention doing points, but it has to be done).
« Last Edit: August 17, 2020, 12:32:23 PM by unlost »

 

anything