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

#closed?Boolean

Returns:

  • (Boolean)

235
236
237
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 235

def closed?
  @zgeometry.closed?
end

#coordinatesObject


271
272
273
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 271

def coordinates
  points.map(&:coordinates)
end

#end_pointObject


231
232
233
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 231

def end_point
  point_n(num_points - 1)
end

#is_closed?Boolean

Returns:

  • (Boolean)

239
240
241
242
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 239

def is_closed?
  warn "The is_closed? method is deprecated, please use the closed? counterpart, will be removed in v3" unless ENV["RGEO_SILENCE_DEPRECATION"]
  closed?
end

#is_ring?Boolean

Returns:

  • (Boolean)

248
249
250
251
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 248

def is_ring?
  warn "The is_ring? method is deprecated, please use the ring? counterpart, will be removed in v3" unless ENV["RGEO_SILENCE_DEPRECATION"]
  ring?
end

#lengthObject


223
224
225
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 223

def length
  @zgeometry.length
end

#num_pointsObject


253
254
255
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 253

def num_points
  @zgeometry.num_points
end

#point_n(n) ⇒ Object


257
258
259
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 257

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

#pointsObject


261
262
263
264
265
266
267
268
269
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 261

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

#ring?Boolean

Returns:

  • (Boolean)

244
245
246
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 244

def ring?
  @zgeometry.ring?
end

#start_pointObject


227
228
229
# File 'lib/rgeo/geos/zm_feature_methods.rb', line 227

def start_point
  point_n(0)
end