You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
here are two queries, both of which are intended to select coordinates, but one returns SphericalPointImpl and other CAPIPointImpl.
rb(main):018:0> Address.select('coordinates::geometry').first.coordinates
Address Load (1.3ms) SELECT coordinates::geometry FROM "addresses" ORDER BY "addresses"."id" ASC LIMIT 1
=> #<RGeo::Geographic::SphericalPointImpl:0x3fe3d3af1d64 "POINT (106.0 10.0)">
rb(main):017:0> Realty.joins(:address).select('realties.id, addresses.coordinates::geometry').first.coordinates
Realty Load (2.4ms) SELECT realties.id, addresses.coordinates::geometry FROM "realties" INNER JOIN "addresses" ON "addresses"."addressable_id" = "realties"."id" AND "addresses"."addressable_type" = $1 ORDER BY "realties"."id" ASC LIMIT 1 [["addressable_type", "Realty"]]
=> #<RGeo::Geos::CAPIPointImpl:0x3fe3d486985c "POINT (106.0 10.0)">
Might it be a bug?
The text was updated successfully, but these errors were encountered:
lessless
changed the title
Joined select returns instead of SphericalPointImpl
Joined select returns CAPIPointImpl instead of SphericalPointImpl
Feb 8, 2016
This has been partially fixed by #334. In order to properly cast a geometry from a join, an attribute must be registered on the target table. In this example, you would have to do this.
Hello,
here are two queries, both of which are intended to select coordinates, but one returns
SphericalPointImpl
and otherCAPIPointImpl
.Might it be a bug?
The text was updated successfully, but these errors were encountered: