Created
March 15, 2021 18:52
-
-
Save tetrashine/171d167d1636875dbbd6a3cacf26b9b1 to your computer and use it in GitHub Desktop.
Cluster.sql
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
SELECT B.geom, COUNT(A.id) as count FROM | |
( | |
SELECT (ST_SquareGrid(0.1, | |
ST_GeomFromText('POLYGON((103.605655941305 1.15876249278089,103.605655941305 1.47078321442792,104.088483621717 1.47078321442792,104.088483621717 1.15876249278089,103.605655941305 1.15876249278089))', 4326) | |
)).*) B | |
LEFT JOIN cluster_locations A ON ST_Intersects(A.geom, B.geom) | |
GROUP BY B.geom |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment