Thread: [Gpsbabel-misc] Garmin Mapsource routes
Brought to you by:
robertl
From: Scott K. E. <st...@st...> - 2004-07-29 17:12:00
|
I'm looking for a way to take a route generated in Mapsource and extract all the coordinates along that route for an arc filter or similar (not just the normal waypoints on the route, Mapsource generates a long list of intermediate points I'm interested in [at least it does when you have maps installed with routing data]). Every attempt I've made to run such a conversion has resulted in gpsbabel hanging for an undetermined period of time (I've never waited it out). As a completely unrelated question, can gpsbabel combine 2 polygon filters into one larger one (to combine multiple county polygons for example)? |
From: Ron P. <ro...@pa...> - 2004-07-29 17:29:09
|
At 01:11 PM 7/29/2004 -0400, Scott K. Ellis wrote: >As a completely unrelated question, can gpsbabel combine 2 polygon filters >into one larger one (to combine multiple county polygons for example)? Can't answer your first question, but the answer to this one is a not-quite-unqualified yes. You can always do this: gpsbabel -i gpx -f in.gpx -x polygon,file=county1.txt -o gpx -F out1.gpx gpsbabel -i gpx -f in.gpx -x polygon,file=county2.txt -o gpx -F out2.gpx gpsbabel -i gpx -f out1.gpx -f out2.gpx -o gpx -F out.gpx That's the safest approach. If the polygons don't touch each other, you can append the two text files together and treat them as a single polygon. Polygons that touch each other might do stupid things in this case; that hasn't been tested. They shouldn't, mind you, but they might: cat county1.txt county2.txt >bothcounties.txt gpsbabel -i gpx -f in.gpx -x polygon,file=bothcounties.txt -o gpx -F out.gpx On Windows, that first command would be copy county1.txt + county2.txt bothcounties.txt And then there's the mad scientist approach: gpsbabel -i gpx -f in.gpx \ -x polygon,file=county1.txt,exclude \ -x polygon,file=county2.txt,exclude \ -i gpx -f in.gpx \ -x duplicate,shortname,all \ -o gpx -F out.gpx (Read in GPX file, delete all points in county 1, delete all points in county 2. This leaves all points not in either county. Read in GPX file again, causing all points that we didn't previously delete to be duplicated. Remove all instances of anything that's duplicated, leaving only points that are either in county 1 or in county 2.) |
From: Ron P. <ro...@pa...> - 2004-07-29 17:35:35
|
At 12:28 PM 7/29/2004 -0500, Ron Parker wrote: >gpsbabel -i gpx -f in.gpx -x polygon,file=county1.txt -o gpx -F out1.gpx >gpsbabel -i gpx -f in.gpx -x polygon,file=county2.txt -o gpx -F out2.gpx >gpsbabel -i gpx -f out1.gpx -f out2.gpx -o gpx -F out.gpx You might want to change this to gpsbabel -i gpx -f out1.gpx -f out2.gpx -x duplicate,shortname \ -o gpx -F out.gpx in case the polygons overlap. >If the polygons don't touch each other, you can append the two text files >together and treat them as a single polygon. Polygons that touch each other >might do stupid things in this case; that hasn't been tested. They >shouldn't, mind you, but they might: If the polygons overlap, points in the overlapping region will be treated as if they weren't in either polygon. This is obviously Not What You Want. |
From: Robert L. <rob...@us...> - 2004-07-29 17:43:31
|
Scott K. Ellis wrote: > I'm looking for a way to take a route generated in Mapsource and extract > all the coordinates along that route for an arc filter or similar (not > just the normal waypoints on the route, Mapsource generates a long list of > intermediate points I'm interested in [at least it does when you have maps > installed with routing data]). Every attempt I've made to run such a > conversion has resulted in gpsbabel hanging for an undetermined period of > time (I've never waited it out). Send a test case (including version information of which gpsbabel was used, the mapsource that generated it, etc.) to the -code list so it can be studied. > As a completely unrelated question, can gpsbabel combine 2 polygon filters > into one larger one (to combine multiple county polygons for example)? Are the two counties contiguous? If so, "reshape" the polygon to be inclusive of both. If not, you'll have to make two invocations and then merge them when you're done. I've flirted with ways to make this easier but not really put fingers on keyboards to make it happen. RJL |
From: Scott K. E. <st...@st...> - 2004-07-29 18:54:03
|
>> As a completely unrelated question, can gpsbabel combine 2 polygon >> filters >> into one larger one (to combine multiple county polygons for example)? > > Are the two counties contiguous? If so, "reshape" the polygon to be > inclusive of both. If not, you'll have to make two invocations and then > merge them when you're done. > > I've flirted with ways to make this easier but not really put fingers on > keyboards to make it happen. In my specific case, the counties are contiguous, but since I'm using "prepackaged" filters (off the SourceForge files area for gpsbabel in fact), combining them is an interesting proposition at least. I haven't yet checked to see if the points listed along their borders match or not. I'm trying to combine said county files into the larger area I live/work/play in of course. I may just take the advice of other posters and create a batch file to run them one at a time. Managing to combine them would be a nicer solution though, since then I could just plug it into GSAK and not have to worry about it. |
From: Robert L. <rob...@us...> - 2004-07-29 20:07:16
|
> I'm trying to combine said county files into the larger area I > live/work/play in of course. You may find the radius filter to be a simpler way to reach a similar objective. > I may just take the advice of other posters > and create a batch file to run them one at a time. A mental guideline I use is that GPSBabel takes about 1/100'th of a second per waypoint on my system with a typical PQ. (Yeah, it's more complicated than that, but that's the number I keep in my head.) Of course, crazy filtering and such only adds to that. So I don't personally spend tens of minutes figuring out the "best" way to do things like this. If I can automate the the process with brute force in less time than it takes me to experiment with a "cooler" approach, I'll throw computer power at it instead of brain cells. But that's just my approach... > Managing to combine > them would be a nicer solution though, since then I could just plug it > into GSAK and not have to worry about it. Another manual option is to take the arcfile for the two counties, slurp them into your favorite mapping program, play connect-the-dots to build a route, then use that combined polygon as your filter. RJL |