Class: GeoRuby::Base::MultiLineString
- Inherits:
-
GeometryCollection
- Object
- Geometry
- GeometryCollection
- GeoRuby::Base::MultiLineString
- Defined in:
- lib/geo_ruby/base/multi_line_string.rb
Overview
Represents a group of line strings (see LineString).
Instance Attribute Summary
Attributes inherited from GeometryCollection
Attributes inherited from Geometry
Class Method Summary collapse
-
.from_coordinates(point_sequences, srid = @@default_srid, with_z = false, with_m = false) ⇒ Object
Creates a new multi line string from sequences of points : (((x,y)…(x,y)),((x,y)…(x,y))).
-
.from_line_strings(line_strings, srid = @@default_srid, with_z = false, with_m = false) ⇒ Object
Creates a new multi line string from an array of line strings.
Instance Method Summary collapse
-
#binary_geometry_type ⇒ Object
:nodoc:.
-
#initialize(srid = @@default_srid, with_z = false, with_m = false) ⇒ MultiLineString
constructor
A new instance of MultiLineString.
-
#text_geometry_type ⇒ Object
WKT geometry type.
-
#text_representation(allow_z = true, allow_m = true) ⇒ Object
Text representation of a multi line string.
Methods inherited from GeometryCollection
#==, #binary_representation, #bounding_box, from_geometries, #georss_gml_representation, #georss_simple_representation, #georss_w3cgeo_representation, #kml_representation, #m_range, #method_missing
Methods inherited from Geometry
#as_ewkb, #as_ewkt, #as_georss, #as_hex_ewkb, #as_hex_wkb, #as_kml, #as_wkb, #as_wkt, #bounding_box, #envelope, from_ewkb, from_ewkt, from_georss, from_georss_with_tags, from_hex_ewkb, from_kml, kml_to_wkt, #m_range
Constructor Details
#initialize(srid = @@default_srid, with_z = false, with_m = false) ⇒ MultiLineString
Returns a new instance of MultiLineString.
7 8 9 |
# File 'lib/geo_ruby/base/multi_line_string.rb', line 7 def initialize(srid = @@default_srid,with_z=false,with_m=false) super(srid) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class GeoRuby::Base::GeometryCollection
Class Method Details
.from_coordinates(point_sequences, srid = @@default_srid, with_z = false, with_m = false) ⇒ Object
Creates a new multi line string from sequences of points : (((x,y)…(x,y)),((x,y)…(x,y)))
32 33 34 35 36 |
# File 'lib/geo_ruby/base/multi_line_string.rb', line 32 def self.from_coordinates(point_sequences,srid=@@default_srid,with_z=false,with_m=false) multi_line_string = new(srid,with_z,with_m) multi_line_string.concat(point_sequences.collect {|points| LineString.from_coordinates(points,srid,with_z,with_m) }) multi_line_string end |
.from_line_strings(line_strings, srid = @@default_srid, with_z = false, with_m = false) ⇒ Object
Creates a new multi line string from an array of line strings
25 26 27 28 29 |
# File 'lib/geo_ruby/base/multi_line_string.rb', line 25 def self.from_line_strings(line_strings,srid=@@default_srid,with_z=false,with_m=false) multi_line_string = new(srid,with_z,with_m) multi_line_string.concat(line_strings) multi_line_string end |
Instance Method Details
#binary_geometry_type ⇒ Object
:nodoc:
11 12 13 |
# File 'lib/geo_ruby/base/multi_line_string.rb', line 11 def binary_geometry_type #:nodoc: 5 end |
#text_geometry_type ⇒ Object
WKT geometry type
20 21 22 |
# File 'lib/geo_ruby/base/multi_line_string.rb', line 20 def text_geometry_type #:nodoc: "MULTILINESTRING" end |
#text_representation(allow_z = true, allow_m = true) ⇒ Object
Text representation of a multi line string
16 17 18 |
# File 'lib/geo_ruby/base/multi_line_string.rb', line 16 def text_representation(allow_z=true,allow_m=true) #:nodoc: @geometries.collect{|line_string| "(" + line_string.text_representation(allow_z,allow_m) + ")" }.join(",") end |