Skip to content

Instantly share code, notes, and snippets.

@gannebamm
Created January 28, 2018 17:50
Show Gist options
  • Save gannebamm/5aa8cd856ce8a3d53848a39258a62df2 to your computer and use it in GitHub Desktop.
Save gannebamm/5aa8cd856ce8a3d53848a39258a62df2 to your computer and use it in GitHub Desktop.
Query for getting the number of red lines which are crossed by each black line
select SUM(red.n), black.*
from red, black
where st_crosses(red.geometry, black.geometry)
group by black.ID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment