rgeo/activerecord-postgis-adapter

Arel::Visitors::UnsupportedVisitError: Unsupported argument type: RGeo::Geographic::SphericalPointImpl. Construct an Arel node instead.

Closed this issue · 1 comments

Hello, I have the following problem:

Arel::Visitors::UnsupportedVisitError: Unsupported argument type: RGeo::Geographic::SphericalPointImpl. Construct an Arel node instead.

STEP:

lo = c.lonlat.lon.to_i
la = c.lonlat.lat.to_i
query = 'ST_Distance(ST_GeographyFromText("POINT(? ?)"), ?)', lo, la, c.lonlat
distance = Resource.select(query)

Rails applicaton with postgis adapter, lonlat is t.st_point :lonlat, geographic: true and in the schema.rb I got t.geography "lonlat", limit: {:srid=>4326, :type=>"st_point", :geographic=>true}

Where's the problem? Thanks