Skip to content

Commit

Permalink
add dumper of flowpaths to shapefile
Browse files Browse the repository at this point in the history
  • Loading branch information
akrherz committed Oct 4, 2019
1 parent 81c5ec1 commit 0d596f8
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions scripts/util/dump_flowpaths.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""Dump flowpaths to a shapefile."""

from geopandas import read_postgis
from pyiem.util import get_dbconn


def main():
"""Go Main Go."""
pgconn = get_dbconn('idep')
df = read_postgis("""
SELECT f.fpath, f.huc_12, ST_Transform(f.geom, 4326) as geo from
flowpaths f, huc12 h WHERE h.scenario = 0 and f.scenario = 0
and h.huc_12 = f.huc_12 and h.states ~* 'IA'
""", pgconn, index_col=None, geom_col='geo')
df.to_file("ia_flowpaths.shp")


if __name__ == '__main__':
main()

0 comments on commit 0d596f8

Please sign in to comment.