Skip to content

Instantly share code, notes, and snippets.

@jmif
Created June 13, 2013 18:44
Show Gist options
  • Save jmif/5776256 to your computer and use it in GitHub Desktop.
Save jmif/5776256 to your computer and use it in GitHub Desktop.
select('d1.*, d2.*, ST_INTERSECTION(d1.shape, d2.shape) AS intersection')
.from('data d1')
.joins('JOIN data d2 ON ST_INTERSECTS(d1.shape, d2.shape)')
.where { d1.batch_id == batch }
.where { d2.batch_id == batch }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment