Skip to content

Commit

Permalink
Merge pull request #966 from transitland/operator-convex-hull-nil-guard
Browse files Browse the repository at this point in the history
Guard against nil geometry returned by convex_hull
  • Loading branch information
doublestranded authored Feb 14, 2017
2 parents 07ea850 + 1233ef0 commit 8e5258c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/services/gtfs_graph.rb
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,8 @@ def load_tl_operators
# ... or check if Operator exists, or another local Operator, or new.
operator = find_by_onestop_id(operator.onestop_id)
# Merge convex hulls
operator[:geometry] = Operator.convex_hull([operator, operator_original], as: :wkt, projected: false)
convex_hull = Operator.convex_hull([operator, operator_original], as: :wkt, projected: false)
operator[:geometry] = convex_hull if convex_hull

# Operator routes & stops
routes = entity.routes.map { |route| find_by_gtfs_entity(route) }.compact.to_set
Expand Down

0 comments on commit 8e5258c

Please sign in to comment.