Created
November 9, 2017 08:44
-
-
Save rlisowski/16e8a93192c071456f3d2b1b79595c61 to your computer and use it in GitHub Desktop.
MapFIlter filter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Location. | |
where('ST_Covers(?, coordinates)', Shapefile.where(area_name: 'BR2').first.geometry.to_s). | |
size | |
# produces two SQL queries, the filter query look like | |
# SELECT Count(*) | |
# FROM "location" | |
# WHERE ( | |
# St_covers( | |
# 'MULTIPOLYGON (((0.004218521268697022 51.38840811418139, ... , 0.004218521268697022 51.38840811418139)))' | |
# , coordinates | |
# ) | |
# ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment