Skip to content

Instantly share code, notes, and snippets.

@glennpjones
Last active September 14, 2019 06:43
Show Gist options
  • Save glennpjones/7b44ad7ece0f3026d97bdb2508fb7dfa to your computer and use it in GitHub Desktop.
Save glennpjones/7b44ad7ece0f3026d97bdb2508fb7dfa to your computer and use it in GitHub Desktop.
irb(main):013:0> Land.in_area(s.area).to_sql
(0.5ms) SELECT * FROM lands WHERE ST_Contains(POLYGON ((4.949341 52.427548, 5.048218 52.347085, 4.924622 52.290003, 4.790039 52.288323, 4.779053 52.357151, 4.828491 52.420848, 4.949341 52.427548)), geom)
ActiveRecord::StatementInvalid (PG::SyntaxError: ERROR: syntax error at or near "52.427548")
LINE 1: ... WHERE ST_Contains(POLYGON ((4.949341 52.427548,...
^
: SELECT * FROM lands WHERE ST_Contains(POLYGON ((4.949341 52.427548, 5.048218 52.347085, 4.924622 52.290003, 4.790039 52.288323, 4.779053 52.357151, 4.828491 52.420848, 4.949341 52.427548)), geom)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment