Module: RGeo::Feature::LineString

Overview

SFS 1.1 Description

A LineString is a Curve with linear interpolation between Points. Each consecutive pair of Points defines a Line segment.

Notes

LineString is defined as a module and is provided primarily for the sake of documentation. Implementations need not necessarily include this module itself. Therefore, you should not depend on the kind_of? method to check type. Instead, use the provided check_type class method (or === operator) defined in the Type module.

Instance Method Summary collapse

Methods included from Type

add_subtype, check_type, each_immediate_subtype, extended, subtype_of?, supertype, type_name

Methods included from Curve

#closed?, #end_point, #length, #ring?, #start_point

Methods included from Geometry

#*, #+, #-, #==, #as_binary, #as_text, #boundary, #buffer, #contains?, #convex_hull, #coordinate_dimension, #crosses?, #difference, #dimension, #disjoint?, #distance, #empty?, #envelope, #eql?, #equals?, #factory, #geometry_type, #intersection, #intersects?, #is_3d?, #locate_along, #locate_between, #measured?, #overlaps?, #relate?, #rep_equals?, #simple?, #spatial_dimension, #srid, #sym_difference, #touches?, #transform, #unary_union, #union, #within?

Instance Method Details

#num_pointsObject

SFS 1.1 Description

The number of Points in this LineString.

Notes

Returns an integer.



35
36
37
# File 'lib/rgeo/feature/line_string.rb', line 35

def num_points
  raise Error::UnsupportedOperation, "Method #{self.class}#num_points not defined."
end

#point_n(_idx) ⇒ Object

SFS 1.1 Description

Returns the specified Point N in this LineString.

Notes

Returns an object that supports the Point interface, or nil if the given N is out of range. N is zero-based. Does not support negative indexes.



49
50
51
# File 'lib/rgeo/feature/line_string.rb', line 49

def point_n(_idx)
  raise Error::UnsupportedOperation, "Method #{self.class}#point_n not defined."
end

#pointsObject

Returns the constituent points as an array of objects that support the Point interface.



56
57
58
# File 'lib/rgeo/feature/line_string.rb', line 56

def points
  raise Error::UnsupportedOperation, "Method #{self.class}#points not defined."
end