I'm building a consolidated map of all transit systems in my area in QGIS. I have a GTFS dataset of bus lines, and it includes shapes for every trip on every route in the system (as it should), but that's far more detail than I need, and very slow to render.

I'd like to filter the data to map only the longest possible trip on each route in each direction (inbound/outbound). What's the best way to do this? Line number, route direction, and shape length are all separate columns. I'd prefer to keep the underlying dataset intact if possible.


You could

  1. use Group Stats plugin to calculate the max length per bus route.
  2. Save the result as CSV
  3. Join the CSV back to the line layer
  4. Select those features/lines where length = max length
  5. Export those to a new dataset
| improve this answer | |
  • Apparently the dataset has already the shape length already so that step can be avoided – Antonio Locandro Jun 7 '14 at 20:37
  • @AntonioLocandro There is no step in my instructions to calculate the length. Using group stats, one can calculate the max value of all lines belonging to a bus route. – underdark Jun 7 '14 at 20:38
  • This worked for me. Once I filtered, however, I discovered several routes take multiple paths, so I just selected the missing variants manually and merged them into the reduced set. Thank you! – Victoria Jun 10 '14 at 20:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.