Class: ActiveRecord::ConnectionAdapters::RawGeomInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/postgis_adapter/init.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dimensionObject

Returns the value of attribute dimension

Returns:

  • (Object)

    the current value of dimension



335
336
337
# File 'lib/postgis_adapter/init.rb', line 335

def dimension
  @dimension
end

#sridObject

Returns the value of attribute srid

Returns:

  • (Object)

    the current value of srid



335
336
337
# File 'lib/postgis_adapter/init.rb', line 335

def srid
  @srid
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



335
336
337
# File 'lib/postgis_adapter/init.rb', line 335

def type
  @type
end

#with_mObject

Returns the value of attribute with_m

Returns:

  • (Object)

    the current value of with_m



335
336
337
# File 'lib/postgis_adapter/init.rb', line 335

def with_m
  @with_m
end

#with_zObject

Returns the value of attribute with_z

Returns:

  • (Object)

    the current value of with_z



335
336
337
# File 'lib/postgis_adapter/init.rb', line 335

def with_z
  @with_z
end

Instance Method Details

#convert!Object



336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
# File 'lib/postgis_adapter/init.rb', line 336

def convert!
  self.type = "geometry" if self.type.nil? #if geometry the geometrytype constraint is not present : need to set the type here then

  if dimension == 4
    self.with_m = true
    self.with_z = true
  elsif dimension == 3
    if with_m
      self.with_z = false
      self.with_m = true
    else
      self.with_z = true
      self.with_m = false
    end
  else
    self.with_z = false
    self.with_m = false
  end
end