Class: Chouette::AccessLink

Inherits:
TridentActiveRecord show all
Defined in:
app/models/chouette/access_link.rb

Constant Summary collapse

nil
nil

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TridentActiveRecord

#build_objectid, #clean_object_id, #default_values, #fix_uniq_objectid, model_name, object_id_key, #objectid, #objectid_format_compliance, #prefix, #prepare_auto_columns, #reset_auto_columns, #timestamp_attributes_for_create, #timestamp_attributes_for_update, #uniq_objectid

Methods inherited from ActiveRecord

#human_attribute_name, #nil_if_blank, nullable_attributes

Instance Attribute Details

Returns the value of attribute access_link_type.



6
7
8
# File 'app/models/chouette/access_link.rb', line 6

def access_link_type
  @access_link_type
end

Returns the value of attribute link_key.



6
7
8
# File 'app/models/chouette/access_link.rb', line 6

def link_key
  @link_key
end

Returns the value of attribute link_orientation_type.



6
7
8
# File 'app/models/chouette/access_link.rb', line 6

def link_orientation_type
  @link_orientation_type
end

Class Method Details



31
32
33
# File 'app/models/chouette/access_link.rb', line 31

def self.access_link_types
  @@access_link_types ||= Chouette::ConnectionLinkType.all
end


56
57
58
59
60
61
62
# File 'app/models/chouette/access_link.rb', line 56

def self.build_link_key(access_point,stop_area,link_orientation_type)
  if link_orientation_type == "access_point_to_stop_area"
    "A_#{access_point.id}-S_#{stop_area.id}"
  else  
    "S_#{stop_area.id}-A_#{access_point.id}"
  end
end


44
45
46
# File 'app/models/chouette/access_link.rb', line 44

def self.link_orientation_types
  @@link_orientation_types ||= Chouette::LinkOrientationType.all
end

Instance Method Details

#geometryObject



48
49
50
# File 'app/models/chouette/access_link.rb', line 48

def geometry
  GeoRuby::SimpleFeatures::LineString.from_points( [ access_point.geometry, stop_area.geometry], 4326) if access_point.geometry and stop_area.geometry
end

#geometry_presenterObject



64
65
66
# File 'app/models/chouette/access_link.rb', line 64

def geometry_presenter
  Chouette::Geometry::AccessLinkPresenter.new self
end