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

#geometry_typeObject


381
382
383
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 381

def geometry_type
  Feature::Point
end

#hashObject


392
393
394
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 392

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

#mObject


372
373
374
375
376
377
378
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 372

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

#rep_equals?(rhs_) ⇒ Boolean


386
387
388
389
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 386

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


353
354
355
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 353

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

#yObject


358
359
360
# File 'lib/rgeo/geos/ffi_feature_methods.rb', line 358

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

#zObject


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

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