Skip to content

Commit

Permalink
I added new option "-e", if you use this option, the script is going …
Browse files Browse the repository at this point in the history
…to update elevation. If you use script without this option, the script will skip to update elevation.
  • Loading branch information
Jin IGARASHI committed Oct 28, 2019
1 parent 1c8fedb commit c15cbbe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion epanet/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ def __init__(self, args):
self.main_dir = datetime.datetime.now().strftime('%Y%m%d_%H%M%S') + "_epanet_data"
self.exportdir_list = []
wss_list_obj = WaterSupplySystems()
wss_list_obj.update_elevations(self.db)
if args.elevation == True:
wss_list_obj.update_elevations(self.db)
self.wss_list = wss_list_obj.get_wss_list(self.db)

def get_tasks(self):
Expand Down
6 changes: 5 additions & 1 deletion postgis2epanet.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def create_argument_parser():
parser = argparse.ArgumentParser(
description="Create EPANET INP file each WSS/District from PostGIS database.",
epilog="Example usage: python postgis2epanet.py -d yourdatabase -H localhost - p 5432 "
"-u user -w securePassword -l list_of_distID(seperated by comma)"
"-u user -w securePassword -l list_of_distID(seperated by comma) -e(optional)"
)
parser.add_argument("-d", "--database", dest="database",
type=str, required=True,
Expand All @@ -38,6 +38,10 @@ def create_argument_parser():
default="", type=str,
help="List of district ID which you want to export. For example, '51,52,53'")

parser.add_argument("-e", "--elevation", action="store_true",
default=False,
help="If you use this option, the script is going to update elevation field of all layers.")

return parser.parse_args()


Expand Down

0 comments on commit c15cbbe

Please sign in to comment.