Created
December 4, 2014 13:54
-
-
Save kzaitsev/0ad1f2b6597af930db63 to your computer and use it in GitHub Desktop.
PostGIS search point in districts polygons
This file contains 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
scope :contains, -> (point) { where("ST_contains(polygon, ST_Transform(ST_GeomFromText('#{point}', 4326), 4326))") } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment