Created
January 21, 2015 15:48
-
-
Save knutole/5b7713849ccce50e31de to your computer and use it in GitHub Desktop.
inefficient query
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
SELECT row_to_json(fc) FROM ( SELECT ST_AsGeoJSON(ST_Transform(ST_Intersection(ST_MakeValid(lg.geometry), bbox.geom), 4326))::json As geometry, ( SELECT row_to_json(t) FROM ( SELECT "name","type","area") t ) As properties FROM osm_waterareas As lg, (SELECT ST_Transform(ST_MakeEnvelope(-7.031250000000009,36.59788913307019,-5.625000000000013,37.718590325588146, 4326),3857) as geom) as bbox WHERE ST_Intersects(ST_MakeValid(lg.geometry), bbox.geom) AND (area > 12500000) ) fc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment