Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard against nil geometry returned by convex_hull #966

Merged
merged 1 commit into from
Feb 14, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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