Module: RGeo::Geos::ZMLineStringMethods

Included in:
ZMLineImpl, ZMLineStringImpl, ZMLinearRingImpl
Defined in:
lib/rgeo/geos/zm_feature_methods.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#coordinatesObject


251
252
253
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 251

def coordinates
  points.map(&:coordinates)
end

#end_pointObject


221
222
223
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 221

def end_point
  point_n(num_points - 1)
end

#is_closed?Boolean

Returns:

  • (Boolean)

225
226
227
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 225

def is_closed?
  @zgeometry.is_closed?
end

#is_ring?Boolean

Returns:

  • (Boolean)

229
230
231
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 229

def is_ring?
  @zgeometry.is_ring?
end

#lengthObject


213
214
215
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 213

def length
  @zgeometry.length
end

#num_pointsObject


233
234
235
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 233

def num_points
  @zgeometry.num_points
end

#point_n(n) ⇒ Object


237
238
239
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 237

def point_n(n)
  @factory.create_feature(ZMPointImpl, @zgeometry.point_n(n), @mgeometry.point_n(n))
end

#pointsObject


241
242
243
244
245
246
247
248
249
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 241

def points
  result_ = []
  zpoints_ = @zgeometry.points
  mpoints_ = @mgeometry.points
  zpoints_.size.times do |i_|
    result_ << @factory.create_feature(ZMPointImpl, zpoints_[i_], mpoints_[i_])
  end
  result_
end

#start_pointObject


217
218
219
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 217

def start_point
  point_n(0)
end