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



321
322
323
324
325
326
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 321

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



308
309
310
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 308

def geometry_type
  Feature::Point
end

#hashObject



317
318
319
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 317

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

#mObject



304
305
306
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 304

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

#rep_equals?(rhs) ⇒ Boolean

Returns:

  • (Boolean)


312
313
314
315
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 312

def rep_equals?(rhs)
  rhs.instance_of?(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



292
293
294
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 292

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

#yObject



296
297
298
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 296

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

#zObject



300
301
302
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 300

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