Module: Chouette::Geometry::GeneralPresenter
- Included in:
- AccessLinkPresenter, AccessPointPresenter, ConnectionLinkPresenter, LinePresenter, RoutePresenter, StopAreaPresenter
- Defined in:
- app/presenters/chouette/geometry/general_presenter.rb
Instance Method Summary collapse
- #to_line_string_feature(stop_areas) ⇒ Object
- #to_multi_point_feature(stop_areas) ⇒ Object
- #to_point_feature(stop_area) ⇒ Object
Instance Method Details
#to_line_string_feature(stop_areas) ⇒ Object
3 4 5 6 |
# File 'app/presenters/chouette/geometry/general_presenter.rb', line 3 def to_line_string_feature( stop_areas) points = stop_areas.collect(&:geometry).compact GeoRuby::SimpleFeatures::LineString.from_points(points) end |
#to_multi_point_feature(stop_areas) ⇒ Object
8 9 10 11 |
# File 'app/presenters/chouette/geometry/general_presenter.rb', line 8 def to_multi_point_feature( stop_areas) points = stop_areas.collect(&:geometry).compact GeoRuby::SimpleFeatures::MultiPoint.from_points( points ) end |
#to_point_feature(stop_area) ⇒ Object
13 14 15 16 |
# File 'app/presenters/chouette/geometry/general_presenter.rb', line 13 def to_point_feature( stop_area) return nil unless stop_area.longitude && stop_area.latitude GeoRuby::SimpleFeatures::Point.from_lon_lat( stop_area.longitude, stop_area.latitude, 4326) end |