Determining a polygon as follows, and the points to check against, in ruby
@poly = GEOFACTORY.polygon(@line_string1)
@locations = Location.all
@valid_locations = Location.order("id").where("st_intersects(ST_GeomFromText(@poly), @locations.lonlat)").all
@poly
returns POLYGON ((9.0395777869 45.6141806128, 9.0395777869 45.3141806128, 9.3395777869 45.3141806128, 9.3395777869 45.6141806128, 9.0395777869 45.6141806128))
and Location.lonlat is defined with :srid => 3785
. Similar queries that check against database column data run properly, however this query states
PG::UndefinedColumn: ERROR: column "poly" does not exist
Is it possible to query postGIS with arbitrary data? If so, where is this query off track?