Example #1
0
if not os.path.isfile(elevfile):

    print(('\nerror: file {} does not exist!'.format(elevfile)))
    print('double-check that the path is correct\n')
    raise

# create an instance of the delineator and supply the path to the source files

delineator = NHDPlusDelineator(VAAfile, flowfile, cfile, elevfile)

# longitude, latitude of the point to delineate (the delineator looks for the
# closest flowline to this point)

longitude = -76.6056
latitude  =  38.5839

# location to place the output (put it inside the existing HUC8 directory)

gageoutput = '{}/01594670'.format(output)

# file name plot of the output

plot = '{}/hunting_watershed'.format(gageoutput)

# extracts the catchments and flowlines for the gage's watershed and merge
# the shapes together to make a boundary file

delineator.delineate_watershed(longitude, latitude, output = gageoutput,
                               plot = plot)
Example #2
0
# paths to the different source files for the model data

flowfile  = '{}/flowlines'.format(output)      # HUC8 flowline shapefile
cfile     = '{}/catchments'.format(output)     # HUC8 catchment shapefile
VAAfile   = '{}/flowlineVAAs'.format(output)   # NHDPlus value added attributes
elevfile  = '{}/elevations.tif'.format(output) # NED raster file
watershed = '{}/delineated'.format(output)     # directory for delineated files

# create an instance of the delineator and supply the path to the source files

delineator = NHDPlusDelineator(VAAfile, flowfile, cfile, elevfile)

# longitude, latitude of the point to delineate (the delineator looks for the
# closest flowline to this point)

longitude = -76.6056
latitude  =  38.5839

# extracts the catchments and flowlines for the gage's watershed and merge
# the shapes together to make a boundary file

gagewatershed = '{}/01594670'.format(output)
delineator.delineate_watershed(longitude, latitude, output = gagewatershed)

# make a plot of the watershed

point = longitude, latitude
plot  = 'hunting_watershed'
delineator.plot_delineated_watershed(point = point, output = plot)
Example #3
0
if not os.path.isfile(elevfile):

    print('\nerror: file {} does not exist!'.format(elevfile))
    print('double-check that the path is correct\n')
    raise

# create an instance of the delineator and supply the path to the source files

delineator = NHDPlusDelineator(VAAfile, flowfile, cfile, elevfile)

# longitude, latitude of the point to delineate (the delineator looks for the
# closest flowline to this point)

longitude = -76.6056
latitude  =  38.5839

# location to place the output (put it inside the existing HUC8 directory)

gageoutput = '{}/01594670'.format(output)

# file name plot of the output

plot = '{}/hunting_watershed'.format(gageoutput)

# extracts the catchments and flowlines for the gage's watershed and merge
# the shapes together to make a boundary file

delineator.delineate_watershed(longitude, latitude, output = gageoutput,
                               plot = plot)