Skip to content

Commit

Permalink
Order by area when dumping
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmartinelli committed Aug 27, 2016
1 parent 6c03847 commit 91afc5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/export-shapefile/export-shapefile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -o nounset

function export_shp() {
local lake_shapefile="/data/osm_lake_polygon.shp"
local query="SELECT osm_id, ST_SimplifyPreserveTopology(geometry, 100) AS geometry FROM osm_lake_polygon WHERE area > 2 * 1000 * 1000 AND ST_GeometryType(geometry)='ST_Polygon' AND name <> ''"
local query="SELECT osm_id, ST_SimplifyPreserveTopology(geometry, 100) AS geometry FROM osm_lake_polygon WHERE area > 2 * 1000 * 1000 AND ST_GeometryType(geometry)='ST_Polygon' AND name <> '' ORDER BY area DESC"
pgsql2shp -f "$lake_shapefile" \
-h "$POSTGRES_PORT_5432_TCP_ADDR" \
-u "$POSTGRES_ENV_POSTGRES_USER" \
Expand Down

0 comments on commit 91afc5d

Please sign in to comment.