rgeo/activerecord-postgis-adapter

3D not possible with geometry

Closed this issue · 1 comments

I am having issues with the z-coordinate in geometry columns.
My testing migration is the following:

class CreateMarkers < ActiveRecord::Migration
  def change
    create_table :markers do |t|
      t.string :name
      t.st_point :position
      t.st_point :positionheight, has_z: true
      t.st_point :lonlat, geographic: true
      t.st_point :lonlatheight, geographic: true, has_z: true
      t.timestamps null: false
    end
  end
end

The positionheight column will be like that:

positionheight: &5 !ruby/object:ActiveRecord::ConnectionAdapters::PostGIS::OID::Spatial
    sql_type: geometry(PointZ)
    geo_type: PointZ
    srid: 0
    has_z: false
    has_m: false
    spatial_factory: !ruby/object:RGeo::Geos::CAPIFactory
      has_z_coordinate: false
      has_m_coordinate: false
      srid: 0
      buffer_resolution: 1
      lenient_multi_polygon_assertions: false
      wkt_generator:
        tag_format: wkt11
        emit_ewkt_srid: 
        square_brackets: false
        convert_case: upper
      wkb_generator:
        type_format: wkb11
        emit_ewkb_srid: 
        hex_format: false
        little_endian: false
      wkt_parser:
        support_ewkt: false
        support_wkt12: false
        strict_wkt11: false
        ignore_extra_tokens: false
        default_srid: 
      wkb_parser:
        support_ewkb: false
        support_wkb12: false
        ignore_extra_bytes: false
        default_srid: 
      auto_prepare: simple

If I understand the documentation correctly, I do not need to specify anything in the model in the current versions. Is that correct?
The strange thing - at least for me - is that I do not have this kind of problem when using a geography column, but unfortunately I can't use one in my case.

Thanks for your help,
Tobi

fixed by applying #280 patch