Class: SpatialAdapter::RawGeomInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/spatial_adapter/common/raw_geom_info.rb

Overview

:nodoc:

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Instance Attribute Details

- (Object) dimension

Returns the value of attribute dimension

Returns:

  • (Object)

    the current value of dimension



2
3
4
# File 'lib/spatial_adapter/common/raw_geom_info.rb', line 2

def dimension
  @dimension
end

- (Object) srid

Returns the value of attribute srid

Returns:

  • (Object)

    the current value of srid



2
3
4
# File 'lib/spatial_adapter/common/raw_geom_info.rb', line 2

def srid
  @srid
end

- (Object) type

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



2
3
4
# File 'lib/spatial_adapter/common/raw_geom_info.rb', line 2

def type
  @type
end

- (Object) with_m

Returns the value of attribute with_m

Returns:

  • (Object)

    the current value of with_m



2
3
4
# File 'lib/spatial_adapter/common/raw_geom_info.rb', line 2

def with_m
  @with_m
end

- (Object) with_z

Returns the value of attribute with_z

Returns:

  • (Object)

    the current value of with_z



2
3
4
# File 'lib/spatial_adapter/common/raw_geom_info.rb', line 2

def with_z
  @with_z
end

Instance Method Details

- (Object) convert!



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/spatial_adapter/common/raw_geom_info.rb', line 3

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