Re: [Gpsbabel-misc] Using points inside polygon filter
Brought to you by:
robertl
From: brett h. <bhe...@ma...> - 2008-09-08 18:19:37
|
I'm slightly confused now, so I started from scratch :) The original GPX file (080810-B2-162_1minute.gpx on http://idisk.mac.com/bheliker) contains exclusively trkpt information with associated time values for each point. Using GPS babel to convert this file into KML results in a large KML file (080810-B2-162_1minute.kml), which contains that track information as a folder of points, made up of hundreds of Placemarks and each placemark includes great extra information like the timestamp and the interpolated values such as velocity and heading between the points. There is also a folder called Path, including a LineString. (You know this better than I do, I'm certain, but I'm trying to get it all straight for myself). I know that the Polygon filter will not work on the Linestring, and I don't need it to, but in this case, it does not appear to work well on the Points folder, either. Perhaps the filter is getting confused by the presence of the tracks? It certainly attempts to filter it, resulting in the kml described before, but it doesn't ever complete (and gives no error, is there a verbose flag I can set?). Trying to work around this, I attempted to run the "nuketypes" filter so that I could work only on the Placemarks and remove all track information: gpsbabel -i kml -f 080810-B2-162_1minute.kml -x nuketypes,tracks -o kml -F 080810-B2-162_1min_nukeTrk.kml However, this filter not only nukes all track information, it also nukes all KML Description, LookAt, Timestamp, and Snippet information. Is this the intended behavior of this filter, or is there another flag to set to preserve this information? In good news, after nuking the tracks, the Poly filter works well on the remaining data (but without the timestamp information it becomes useless to me). In another attempt, I tried running the "transform" filter: gpsbabel -i gpx 080810-B2-162_1minute.gpx -x transform,wpt=trk -o kml - F 080810-B2-162_1min_wpt.kml But this also deletes all "Extra" information such as time stamps contained within the GPX. This seems atypical from the rest of the program, when compared to converting from GPX straight to KML as above, where it converts every trkpt into a Waypoint with all that great extra information. Do you have any suggestions? I'm thinking it will have to be manually processed at this point, as frightening as that sounds to me. Thanks for all the help, -Brett On Sep 7, 2008, at 8:03 PM, Robert Lipe wrote: > > > On Sat, Sep 6, 2008 at 9:58 PM, brett heliker <bhe...@ma...> > wrote: > I think you have answered my question: I was attempting to run the > filter on KML data, unaware that this is unsupported. Is this > documented anywhere? I will next convert the tracks into points in > GPX, then run the filter again on that new file, hopefully that will > work. > > I think we're talking past each other. The polygon filter requires > whitespace-separated coordinates to define the polygons as described > in http://www.gpsbabel.org/htmldoc-1.3.5/filter_polygon.html > > It doesn't know what format the data being operated upon actually > came from. > > > However, it does appear that the KML is somewhat read and filtered. > As I mentioned, the filter appears > > Our polygon filter operates on waypoints (a single location) . It > does not operate on tracks (an ordered sequence of points). The kml > files you provided consist predominantly of tracks, so GPSBabel is > not going to operate on those. > > RJL > > > > to modify the name of every point in the file, then duplicate the > points within the polygon, but without the Velocity, Heading, and > Lat/Long extra info they had before. Very strange behavior. > > If you would like to reproduce this behavior, download the (larger) > KML files mentioned previously. Then run the standard command: > > gpsbabel -i kml -f 080810-B2-162_1min_poly.kml -x > polygon,file=habibPoly.txt -o kml -F 080810- > B2-162_1min_polyFilter.kml > > This results in the oddities I am seeing. > > > Thank you for your help, > -Brett > > > > On Sep 5, 2008, at 7:49 PM, Robert Lipe wrote: > > Our poly filter doesn't read KML files. Without knowing the > sequence of the data, we don't know what your polygon looks like. > > Please provide a complete, reproducable test case. Show the command > you issued. Describe what happened that shouldn't have or what > didn't happen that should have. I don't see waypoints in either of > the files that I looked at; I saw tracks with a large number of > trackpoints. So I'm not really sure what you're hoping to filter > in these data sets. > > RJL > > On Wed, Sep 3, 2008 at 6:22 PM, brett heliker <bhe...@ma...> > wrote: > Ok, I have filtered the file down to 1 minute, resulting in a 380kb > GPX file. I have uploaded a variety of files here: > > http://public.me.com/bheliker > > The files _1minute.gpx and _10minutes.gpx are the raw data, made up > only of trkseg points. I've included these because they are so much > smaller than the equivalent KML. The .kml versions of these files > are the versions I'm trying to run the poly filter on, as they > contain both waypoints and tracks. These are raw KML, created using > GPSBabel's GPX to KML function. The poly filter has not yet been run > on them. > > Something I've just now noticed: The filter appears to create a > second waypoint at every point within the AOI, and change the name > (but not duplicate or delete) every waypoint outside of the AOI. > Interesting... > > > Thank you for your help, > Brett > > > > > > On Sep 3, 2008, at 1:46 PM, Robert Lipe wrote: > > Please reduce it to a reproducible test case so we can look at it. > > I'm way more likely to investigate a 2KB problem than a 200MB one. > > RJL > > On Wed, Sep 3, 2008 at 3:21 PM, brett heliker <bhe...@ma...> > wrote: > It contains both, tracks and waypoints, but there are many, many > waypoints outside this polygon that do not get filtered. Should I > break the tracks and points into two separate files before running > this filter? > > Thanks, > Brett > > > > On Sep 2, 2008, at 11:24 PM, Robert Lipe wrote: > > > gpsbabel -i gpx -f 080810-0800.gpx -x polygon,file=habibPoly.txt -o > kml -F 080810-0800_polyFilter.kml > > And here is the habibPoly.txt file: > > # Habib polygon > 43.1600 -116.0000 > 43.1600 -115.9700 > 43.1300 -115.9700 > 43.1300 -116.0000 > 43.1600 -116.0000 > > Seems right. Does the GPX file in question contain points (which > are supported by the polygon filter) or does it contain tracks > (which are not?) > > http://www.gpsbabel.org/capabilities.html > > > > > > |