Module: RGeo::Geos::FFIPointMethods

Included in:
FFIPointImpl
Defined in:
lib/rgeo/geos/ffi_feature_methods.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#coordinatesObject


364
365
366
367
368
369
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 364

def coordinates
  [x, y].tap do |coords|
    coords << z if @factory.property(:has_z_coordinate)
    coords << m if @factory.property(:has_m_coordinate)
  end
end

#geometry_typeObject


351
352
353
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 351

def geometry_type
  Feature::Point
end

#hashObject


360
361
362
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 360

def hash
  @hash ||= Utils.ffi_coord_seq_hash(@fg_geom.coord_seq, [@factory, geometry_type].hash)
end

#mObject


347
348
349
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 347

def m
  @fg_geom.coord_seq.get_z(0) if @factory.property(:has_m_coordinate)
end

#rep_equals?(rhs) ⇒ Boolean

Returns:

  • (Boolean)

355
356
357
358
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 355

def rep_equals?(rhs)
  rhs.class == self.class && rhs.factory.eql?(@factory) &&
    Utils.ffi_coord_seqs_equal?(rhs.fg_geom.coord_seq, @fg_geom.coord_seq, @factory._has_3d)
end

#xObject


335
336
337
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 335

def x
  @fg_geom.coord_seq.get_x(0)
end

#yObject


339
340
341
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 339

def y
  @fg_geom.coord_seq.get_y(0)
end

#zObject


343
344
345
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 343

def z
  @fg_geom.coord_seq.get_z(0) if @factory.property(:has_z_coordinate)
end