PerryB2 Posted August 30, 2007 Share Posted August 30, 2007 I got some trail information for the forest service in the form of shape files, actually a set of files: trails.shx, trails.prj, trails.sbn, trails.sbx, trails.shp, trails.shp.xml, trails.dbf. I want to get this data onto my National Geographic Topo map files. NG Topo can import .gpx files. Any suggestions on how to convert this shape file data into a .gpx file? Thanks, Perry Quote Link to comment
+imajeep Posted August 30, 2007 Share Posted August 30, 2007 Try GPS Babel software--it may convert them. Quote Link to comment
+Indotguy Posted August 30, 2007 Share Posted August 30, 2007 Shape files can used on mapping software such as "Global_Mapper". I believe a version of Global_Mapper is available for free but with restrictions. Quote Link to comment
rws Posted August 30, 2007 Share Posted August 30, 2007 (edited) GPS TrackMaker will do the job for you...and it's free. An unregistered Global Mapper will not convert shapefiles. start GPS TrackMaker click File...Open...point to the *.shp file choose the correct datum and coordinate system (find this info in the .xml file included in the shapefile pack) click OK the shapefile will load onto the screen click File...Save File as...select a name for your file with a .gpx extension...click Save Edited August 30, 2007 by rws Quote Link to comment
+Timpat Posted August 30, 2007 Share Posted August 30, 2007 Another method I use is a free ArcView extension called DNR Garmin. It will convert shapefiles to .gpx format, and works great to transfer GIS data between Garmin GPSrs. Quote Link to comment
rws Posted August 30, 2007 Share Posted August 30, 2007 (edited) Another method I use is a free ArcView extension called DNR Garmin. It will convert shapefiles to .gpx format, and works great to transfer GIS data between Garmin GPSrs. DNRGarmin will work fine if your shapefile has less than 32,767 records. Edited August 30, 2007 by rws Quote Link to comment
SiliconFiend Posted August 30, 2007 Share Posted August 30, 2007 I got some trail information for the forest service in the form of shape files, actually a set of files: trails.shx, trails.prj, trails.sbn, trails.sbx, trails.shp, trails.shp.xml, trails.dbf. I want to get this data onto my National Geographic Topo map files. NG Topo can import .gpx files. Any suggestions on how to convert this shape file data into a .gpx file? Thanks, Perry Where did you get the source data? I'm trying to compile a comprehensive set of trail maps. By the way, ogr2ogr (part of FWTools) is a great tool for converting/manipulating vector data. The -where option can create a filtered data set. Quote Link to comment
PerryB2 Posted August 30, 2007 Author Share Posted August 30, 2007 I downloaded GPS TrackMaker. It opened one .shp file fine. Another one I got the error message: "Datatype 23 not supported, please contact the author" and it locked up. The author's web site says the free version is not supported. Suggestions? Quote Link to comment
rws Posted August 30, 2007 Share Posted August 30, 2007 I downloaded GPS TrackMaker. It opened one .shp file fine. Another one I got the error message: "Datatype 23 not supported, please contact the author" and it locked up. The author's web site says the free version is not supported. Suggestions? email me the shapefile you had trouble with cf-700 at hotmail dot com Quote Link to comment
+Timpat Posted August 30, 2007 Share Posted August 30, 2007 I downloaded GPS TrackMaker. It opened one .shp file fine. Another one I got the error message: "Datatype 23 not supported, please contact the author" and it locked up. The author's web site says the free version is not supported. Suggestions? It may be projected in a coordinate system and not in Lat/Lon WGS84 (NAD83). Quote Link to comment
SiliconFiend Posted August 30, 2007 Share Posted August 30, 2007 I downloaded GPS TrackMaker. It opened one .shp file fine. Another one I got the error message: "Datatype 23 not supported, please contact the author" and it locked up. The author's web site says the free version is not supported. Suggestions? It may be projected in a coordinate system and not in Lat/Lon WGS84 (NAD83). If that is the case, ogr2ogr can fix that, too. You'll need to install the FWTools package to get that functionality, though, because it links to the Proj.4 library to do projections. Then you just run ogr2ogr on the shapefile with the argument "-t_srs WGS84" (without the quotes) and it will give you the shapefile set in WGS84 lat/lon coordinates. The FWTools package is free/open source; I just find it very useful. Quote Link to comment
+Redwoods Mtn Biker Posted August 30, 2007 Share Posted August 30, 2007 OziExplorer will convert shapefiles to tracks. if you use the blank map you can use the free version. Quote Link to comment
rws Posted August 30, 2007 Share Posted August 30, 2007 I downloaded GPS TrackMaker. It opened one .shp file fine. Another one I got the error message: "Datatype 23 not supported, please contact the author" and it locked up. The author's web site says the free version is not supported. Suggestions? OK The lone trail.shp file you sent me produced the same error you got. GPS TrackMaker probably needs one of the other files that was included in the Trail shapefile package. Be sure these other files are in the same folder as the trail.shp file when you open it in TrackMaker. If you have all the files in the same folder and it still comes up with the error try downloading the Trail shapefiles again from the source...they could have been corrupted. After trying the above and you still have trouble email me all the files from the Trail Shapefile package cf-700 at hotmail dot com Quote Link to comment
fieldkat Posted August 30, 2007 Share Posted August 30, 2007 I downloaded GPS TrackMaker. It opened one .shp file fine. Another one I got the error message: "Datatype 23 not supported, please contact the author" and it locked up. The author's web site says the free version is not supported. Suggestions? OK The lone trail.shp file you sent me produced the same error you got. GPS TrackMaker probably needs one of the other files that was included in the Trail shapefile package. Be sure these other files are in the same folder as the trail.shp file when you open it in TrackMaker. If you have all the files in the same folder and it still comes up with the error try downloading the Trail shapefiles again from the source...they could have been corrupted. After trying the above and you still have trouble email me all the files from the Trail Shapefile package cf-700 at hotmail dot com That error is most likely because the shapefile is probably using UTM coords. ... Quote Link to comment
rws Posted August 31, 2007 Share Posted August 31, 2007 I downloaded GPS TrackMaker. It opened one .shp file fine. Another one I got the error message: "Datatype 23 not supported, please contact the author" and it locked up. The author's web site says the free version is not supported. Suggestions? OK The lone trail.shp file you sent me produced the same error you got. GPS TrackMaker probably needs one of the other files that was included in the Trail shapefile package. Be sure these other files are in the same folder as the trail.shp file when you open it in TrackMaker. If you have all the files in the same folder and it still comes up with the error try downloading the Trail shapefiles again from the source...they could have been corrupted. After trying the above and you still have trouble email me all the files from the Trail Shapefile package cf-700 at hotmail dot com That error is most likely because the shapefile is probably using UTM coords. ... I can open shapefiles using UTM coordinates in GPS TrackMaker without error. Quote Link to comment
PerryB2 Posted August 31, 2007 Author Share Posted August 31, 2007 All the files associated with trail.shp were in the same folder when I tried GPS TrackMaker. ArcGIS Explorer will load and display trail.shp which suggests it’s not a corrupt file issue. Other than verifying that file will load, this is not very useful to me. I tried DNRGarmin 5.2.25. It will not load the trail.shp file. I get “Error5, Invalid procedure call or argument” I tried the Demo version of OziExplorer. The Import ESRI Shape file dialog prompts for track number to import. It appears it will only import one track at a time and the trails file has many, so it appears to be not very helpful. It does say it imported a Track, but nothing shows on the screen. I welcome more suggestions. Thanks, Perry Quote Link to comment
+Timpat Posted August 31, 2007 Share Posted August 31, 2007 Just a thought, but it may be that the original shapefile contains several segments vs. a single polyline, or a many segmented polyline? When you opened it in ArcGIS Explorer what did it look like? And when you scroll around can you get a read on the coordinate range? In other words is it Lat/Lon or UTM, or some regional base? Quote Link to comment
+myotis Posted August 31, 2007 Share Posted August 31, 2007 I have delat with many shapefiles from the Forest Service to make Garmin Maps. All FS shape files are in UTM and NAD83 datum. Use a file viewer to look at the file with the prj extenstion to see what UTM Zone to use. ExpertGPS with the GIS pack will open and convert to gpx the files from the FS. Quote Link to comment
rws Posted August 31, 2007 Share Posted August 31, 2007 All the files associated with trail.shp were in the same folder when I tried GPS TrackMaker. ArcGIS Explorer will load and display trail.shp which suggests it’s not a corrupt file issue. Other than verifying that file will load, this is not very useful to me. I tried DNRGarmin 5.2.25. It will not load the trail.shp file. I get “Error5, Invalid procedure call or argument” I tried the Demo version of OziExplorer. The Import ESRI Shape file dialog prompts for track number to import. It appears it will only import one track at a time and the trails file has many, so it appears to be not very helpful. It does say it imported a Track, but nothing shows on the screen. I welcome more suggestions. Thanks, Perry Thanks for sending the additional files...I can load the trail map in other GIS software packages but for some reason I get the error in GPS TrackMaker. I converted the shapefile to .gpx for you and emailed it to you...you will receive a Trails.zip file attached to the message. Quote Link to comment
rws Posted August 31, 2007 Share Posted August 31, 2007 (edited) I have delat with many shapefiles from the Forest Service to make Garmin Maps. All FS shape files are in UTM and NAD83 datum. Use a file viewer to look at the file with the prj extenstion to see what UTM Zone to use. ExpertGPS with the GIS pack will open and convert to gpx the files from the FS. ...his .prj file PROJCS["NAD_1927_UTM_Zone_10N",GEOGCS["GCS_North_American_1927",DATUM["D_North_American_1927",SPHEROID["Clarke_1866",6378206.4,294.9786982]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-123.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["Meter",1.0]] Edited August 31, 2007 by rws Quote Link to comment
PerryB2 Posted August 31, 2007 Author Share Posted August 31, 2007 A few additional notes: I looked at the FWTools information. It appears it will read ESRI Shape files but I did not see mention of converting to GPX files or NG Topo files. In GPS Babel’s online documentation I did not see any mention of converting ESRI Shape files. SiliconFiend asked where I got the data. I have a friend who works for the Forest Service. However, It’s my understanding that the data is public information. If you can find out who does the mapping / cartography / GIS work for the National Forest you are interested in and talk with them; they will probably send it to you; if they are not too busy. rws, Thanks! How did you convert the shape file? I want to find a solution for when I get more shape files in the future. Perry Quote Link to comment
SiliconFiend Posted August 31, 2007 Share Posted August 31, 2007 A few additional notes: I looked at the FWTools information. It appears it will read ESRI Shape files but I did not see mention of converting to GPX files or NG Topo files. In GPS Babel’s online documentation I did not see any mention of converting ESRI Shape files. SiliconFiend asked where I got the data. I have a friend who works for the Forest Service. However, It’s my understanding that the data is public information. If you can find out who does the mapping / cartography / GIS work for the National Forest you are interested in and talk with them; they will probably send it to you; if they are not too busy. rws, Thanks! How did you convert the shape file? I want to find a solution for when I get more shape files in the future. Perry I actually did a little looking and found the data on a website here. I think I went through the metadata gateway; it seemed to work better than the vector data gateway. I wish the National Park Service had data that good. (For some reason I can't find any trail data for Redwoods National Park; maybe I'll send an email.) Anyway, the reason I mentioned FWTools is that it can easily convert the coordinates and datum to WGS84. It can also output to KML (Google Earth file), too, which I believe GPSBabel can deal with. GPSBabel works great for GPS tracks, waypoints, etc. but it doesn't convert to any map-compatible format easily, so I haven't used it much. OGR2OGR is just a really powerful tool. I'm considering writing a couple drivers for it (one for geonames.org POI data and another for cGPSMapper .MP files). I don't know anything about the NG Topo format, though, sorry. Quote Link to comment
Grasscatcher Posted August 31, 2007 Share Posted August 31, 2007 I believe you're going to be disappointed, if what you want to transfer is tracks ......because TOPO will only import waypoints from a gpx file....not tracks. Also, note that it takes all three files (dbf,shx,shp) to make a shapefile. As stated above.....use Expert GPS with the GIS option. Will import and export as Shapefile and save as gpx file. Or wait for v5 TOPO...they are supposed to "do something" about the way TOPO handles tracks ......due sometime within the next year. Quote Link to comment
+geognerd Posted August 31, 2007 Share Posted August 31, 2007 I have successfully used shp2text to convert shapefiles to GPX files. However, the shapefiles had to be unprojected and using the WGS84 datum for them to come up in the right location when viewing the GPX files in Google Earth. Quote Link to comment
+Redwoods Mtn Biker Posted August 31, 2007 Share Posted August 31, 2007 I believe you're going to be disappointed, if what you want to transfer is tracks ......because TOPO will only import waypoints from a gpx file....not tracks. Can't you transfer a .gpx file to your GPS, then transfer from the GPS to TOPO? Quote Link to comment
rws Posted August 31, 2007 Share Posted August 31, 2007 rws, Thanks! How did you convert the shape file? I want to find a solution for when I get more shape files in the future. Perry Global Mapper If you are using a Garmin and your end result is to get these shapefile trails onto your GPS it is fairly easy to make a custom map. Here's a screenshot of the map I made from the shapefiles...zoomed in to show trails over Garmin US Topo. Quote Link to comment
PerryB2 Posted September 1, 2007 Author Share Posted September 1, 2007 rws, Thanks, at this point my primary purpose is to get data onto printed Topo maps to use along with my GPS. The NF data I’ve seen shows trails which don’t show up on any other maps, including NF published maps. Grasscatcher, NG Topo 4.2.7 will import tracks as either a series of waypoints or ‘freehand routes’. I’ve transferred a number of tracks made on my Garmin GSP 60CSx into MapSource, reviewed /fixed them there, saved them to GPX files and imported the GPX file into Topo. Another question: Any suggestions on where I could learn more about what’s in the various shapefiles (dbf, shx, sbn, sbx, shp, prj) and how to extract / use the info? Thanks, Perry Quote Link to comment
SiliconFiend Posted September 1, 2007 Share Posted September 1, 2007 (edited) rws, Thanks, at this point my primary purpose is to get data onto printed Topo maps to use along with my GPS. The NF data I’ve seen shows trails which don’t show up on any other maps, including NF published maps. Grasscatcher, NG Topo 4.2.7 will import tracks as either a series of waypoints or ‘freehand routes’. I’ve transferred a number of tracks made on my Garmin GSP 60CSx into MapSource, reviewed /fixed them there, saved them to GPX files and imported the GPX file into Topo. Another question: Any suggestions on where I could learn more about what’s in the various shapefiles (dbf, shx, sbn, sbx, shp, prj) and how to extract / use the info? Thanks, Perry The shp file has the actual geometry in it. The shx file is an index. The prj file is a text file that contains the projection information (datum, spheroid, etc.) The dbf file is a dBase database table that associates attributes to the geometry. That's the one that will help you the most, probably. It can have names, types, whatever. Excel can open the dbf files. I'm not sure about the sbn and sbx files. The problem with shapefiles is in importing them into another format. Shapefiles have no built-in type association for a given point, polyline or polygon (that is, to distinguish that a particular polyline is a stream vs. a city border)--that's what the dbf file is generally used for, but it's dataset-specific. So, if you have a shapefile that has lots of different types of geometry in it (for example, trails mixed in with roads and you want to separate out the trails), you can look in the DBF file and see if the trails have a particular value (e.g., a type code or name) in one of the columns. Then you can use ogr2ogr to extract only those elements into a new shapefile set. For example, ogr2ogr -f "ESRI Shapefile" -t_srs WGS84 -where "TYPE_COL='trail'" outputdir infile.shp Specifying -t_srs WGS84 will read the projection in the prj file and convert it to WGS84, which GPS devices use. This information may not help you directly, but I wanted to share what I discovered so that other people could take advantage of it. Sorry, I typed that fast this morning and forgot the -where clause originally... Edited September 1, 2007 by SiliconFiend Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.