extents module¶
Functions with auxiliary info for implementing extent queries.
Function |
Description |
|---|---|
Misc |
|
Validates an extent name and returns its ID |
|
Returns a list of supported extent types |
|
Collections |
|
Info on all supported extents |
|
Info on all supported hydrologic unit code (HUC) extents |
|
Info on all supported named extents |
|
Named Extents |
|
Info on supported Canadian province extents |
|
Info on supported continent extents |
|
Info on supported country extents |
|
Info on supported Hawaiian island extents |
|
Info on supported Mexican state extents |
|
Info on supported national park unit extents |
|
Info on supported U.S. county extents |
|
Info on supported U.S. region extents |
|
Info on supported U.S. state extents |
|
HUC Extents |
|
Info on supported HUC-2 extents |
|
Info on supported HUC-4 extents |
|
Info on supported HUC-6 extents |
|
Info on supported HUC-8 extents |
Misc¶
- pwfdf_api.extents.id(extent, extent_type=None)¶
Returns the extent ID of the queried extent
id(extent) id(extent, extent_type)
Returns the extent ID of a queried extent. By default, scans for a matching name in the complete set of supported extents. Use
extent_typeto restrict the search to a specific extent type.- Inputs:
extent (str | int) –: The name of an extent
extent_type (str) – The type of the named extent
- Outputs:
int – The extent ID for the queried extent
- pwfdf_api.extents.types()¶
Returns the list of extent types
types()
Returns the list of all supported extent types.
- Outputs:
list[str] – A list of extent types that support for named/HUC extents
Collections¶
- pwfdf_api.extents.hucs(ids=False)¶
Returns a dict mapping huc extent types onto supported extents
hucs() hucs(ids=True)
Returns a dict mapping HUC extent types onto supported extents. The keys of the dict are “HUC-2”, “HUC-4”, “HUC-6”, and “HUC-8”. By default, each key’s value is a list of supported extent names for the associated HUC type. Setting
ids=Truewill change the key values to dicts mapping supported names (as strings) onto their extent IDs (ints).- Inputs:
ids (bool) – True for dict values to be dicts mapping extent names onto extent IDs. False (default) for dict values to be lists of supported extent names.
- Outputs:
dict – Maps HUC extent types onto supported extents
- pwfdf_api.extents.named(ids=False)¶
Returns a dict mapping named extent types onto supported extents
named() named(ids=True)
Returns a dict mapping named extent types onto supported extents. The keys of the dict are the different supported named extent types. By default, each key’s value is a list of supported extent names for the associated type. Setting
ids=Truewill change the key values to dicts mapping supported names (as strings) onto their extent IDs (ints).- Inputs:
ids (bool) – True for dict values to be dicts mapping extent names onto extent IDs. False (default) for dict values to be lists of supported extent names.
- Outputs:
dict – Maps named extent types onto supported extents
- pwfdf_api.extents.all(ids=False)¶
Returns a dict mapping extent types onto supported extents
all() all(ids=True)
Returns a dict mapping all extent types onto supported extents. The keys of the dict are the different extent types. By default, each key’s value is a list of supported extent names for the associated type. Setting
ids=Truewill change the key values to dicts mapping supported names (as strings) onto their extent IDs (ints).- Inputs:
ids (bool) – True for dict values to be dicts mapping extent names onto extent IDs. False (default) for dict values to be lists of supported extent names.
- Outputs:
dict – Maps extent types onto supported extents
Named Extents¶
- pwfdf_api.extents.canadian_provinces(ids=False)¶
Returns info on supported Canadian province extents
Extent Names
canadian_provinces()
Returns a list of supported Canadian province names.
Extent IDs
canadian_provinces(ids=True)
Returns a dict mapping supported Canadian province names onto their extent IDs.
- Inputs:
ids (bool) – True to return a dict mapping supported extent names onto their IDs. False (default) to return a list of supported extent names
- Outputs:
list | dict – A list of supported Canadian province names, or a dict mapping supported names onto their extent IDs
- pwfdf_api.extents.continents(ids=False)¶
Returns info on supported continent extents
Extent Names
continents()
Returns a list of supported continent names.
Extent IDs
continents(ids=True)
Returns a dict mapping supported continent names onto their extent IDs.
- Inputs:
ids (bool) – True to return a dict mapping supported extent names onto their IDs. False (default) to return a list of supported extent names
- Outputs:
list | dict – A list of supported continent names, or a dict mapping supported names onto their extent IDs
- pwfdf_api.extents.countries(ids=False)¶
Returns info on supported country extents
Extent Names
countries()
Returns a list of supported country names.
Extent IDs
countries(ids=True)
Returns a dict mapping supported country names onto their extent IDs.
- Inputs:
ids (bool) – True to return a dict mapping supported extent names onto their IDs. False (default) to return a list of supported extent names
- Outputs:
list | dict – A list of supported country names, or a dict mapping supported names onto their extent IDs
- pwfdf_api.extents.hawaiian_islands(ids=False)¶
Returns info on supported Hawaiian island extents
Extent Names
hawaiian_islands()
Returns a list of supported Hawaiian island names.
Extent IDs
hawaiian_islands(ids=True)
Returns a dict mapping supported Hawaiian island names onto their extent IDs.
- Inputs:
ids (bool) – True to return a dict mapping supported extent names onto their IDs. False (default) to return a list of supported extent names
- Outputs:
list | dict – A list of supported Hawaiian island names, or a dict mapping supported names onto their extent IDs
- pwfdf_api.extents.mexican_states(ids=False)¶
Returns info on supported Mexican state extents
Extent Names
mexican_states()
Returns a list of supported Mexican state names.
Extent IDs
mexican_states(ids=True)
Returns a dict mapping supported Mexican state names onto their extent IDs.
- Inputs:
ids (bool) – True to return a dict mapping supported extent names onto their IDs. False (default) to return a list of supported extent names
- Outputs:
list | dict – A list of supported Mexican state names, or a dict mapping supported names onto their extent IDs
- pwfdf_api.extents.national_parks(ids=False)¶
Returns info on supported national park unit extents
Extent Names
national_parks()
Returns a list of supported national park unit names.
Extent IDs
national_parks(ids=True)
Returns a dict mapping supported national park unit names onto their extent IDs.
- Inputs:
ids (bool) – True to return a dict mapping supported extent names onto their IDs. False (default) to return a list of supported extent names
- Outputs:
list | dict – A list of supported national park unit names, or a dict mapping supported names onto their extent IDs
- pwfdf_api.extents.us_counties(ids=False)¶
Returns info on supported U.S. county extents
Extent Names
us_counties()
Returns a list of supported U.S. county names.
Extent IDs
us_counties(ids=True)
Returns a dict mapping supported U.S. county names onto their extent IDs.
- Inputs:
ids (bool) – True to return a dict mapping supported extent names onto their IDs. False (default) to return a list of supported extent names
- Outputs:
list | dict – A list of supported U.S. county names, or a dict mapping supported names onto their extent IDs
- pwfdf_api.extents.us_regions(ids=False)¶
Returns info on supported U.S. region extents
Extent Names
us_regions()
Returns a list of supported U.S. region names.
Extent IDs
us_regions(ids=True)
Returns a dict mapping supported U.S. region names onto their extent IDs.
- Inputs:
ids (bool) – True to return a dict mapping supported extent names onto their IDs. False (default) to return a list of supported extent names
- Outputs:
list | dict – A list of supported U.S. region names, or a dict mapping supported names onto their extent IDs
- pwfdf_api.extents.us_states(ids=False)¶
Returns info on supported U.S. state extents
Extent Names
us_states()
Returns a list of supported U.S. state names.
Extent IDs
us_states(ids=True)
Returns a dict mapping supported U.S. state names onto their extent IDs.
- Inputs:
ids (bool) – True to return a dict mapping supported extent names onto their IDs. False (default) to return a list of supported extent names
- Outputs:
list | dict – A list of supported U.S. state names, or a dict mapping supported names onto their extent IDs
HUC Extents¶
- pwfdf_api.extents.huc2(ids=False)¶
Returns info on supported HUC-2 extents
Extent Names
huc2()
Returns a list of supported HUC-2 names.
Extent IDs
huc2(ids=True)
Returns a dict mapping supported HUC-2 names onto their extent IDs.
- Inputs:
ids (bool) – True to return a dict mapping supported extent names onto their IDs. False (default) to return a list of supported extent names
- Outputs:
list | dict – A list of supported HUC-2 names, or a dict mapping supported names onto their extent IDs
- pwfdf_api.extents.huc4(ids=False)¶
Returns info on supported HUC-4 extents
Extent Names
huc4()
Returns a list of supported HUC-4 names.
Extent IDs
huc4(ids=True)
Returns a dict mapping supported HUC-4 names onto their extent IDs.
- Inputs:
ids (bool) – True to return a dict mapping supported extent names onto their IDs. False (default) to return a list of supported extent names
- Outputs:
list | dict – A list of supported HUC-4 names, or a dict mapping supported names onto their extent IDs
- pwfdf_api.extents.huc6(ids=False)¶
Returns info on supported HUC-6 extents
Extent Names
huc6()
Returns a list of supported HUC-6 names.
Extent IDs
huc6(ids=True)
Returns a dict mapping supported HUC-6 names onto their extent IDs.
- Inputs:
ids (bool) – True to return a dict mapping supported extent names onto their IDs. False (default) to return a list of supported extent names
- Outputs:
list | dict – A list of supported HUC-6 names, or a dict mapping supported names onto their extent IDs
- pwfdf_api.extents.huc8(ids=False)¶
Returns info on supported HUC-8 extents
Extent Names
huc8()
Returns a list of supported HUC-8 names.
Extent IDs
huc8(ids=True)
Returns a dict mapping supported HUC-8 names onto their extent IDs.
- Inputs:
ids (bool) – True to return a dict mapping supported extent names onto their IDs. False (default) to return a list of supported extent names
- Outputs:
list | dict – A list of supported HUC-8 names, or a dict mapping supported names onto their extent IDs