diff --git a/scripts/util/dump_flowpaths.py b/scripts/util/dump_flowpaths.py new file mode 100644 index 00000000..35f0ab8d --- /dev/null +++ b/scripts/util/dump_flowpaths.py @@ -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()