Skip to content

Commit

Permalink
Add Yukon watersheds, game management subzones, and fire districts.
Browse files Browse the repository at this point in the history
  • Loading branch information
cstephen authored and BobTorgerson committed Dec 14, 2024
1 parent eccd8c4 commit 23b4c9e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fetch_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def get_poly_3338_bbox(poly_id, crs=3338):
fetch_data(
[
generate_wfs_places_url(
"all_boundaries:all_areas", "the_geom", poly_id, "id"
"playground:all_areas_test5", "the_geom", poly_id, "id"
)
]
)
Expand Down
9 changes: 9 additions & 0 deletions luts.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,18 @@

place_type_labels = {
"huc": "HUC",
"yt_watershed": "Yukon Watershed",
"protected_area": "Protected Area",
"borough": "Borough",
"census_area": "Census Area",
"fire_zone": "Fire Management Unit",
"yt_fire_district": "Yukon Fire District",
"corporation": "Corporation",
"climate_division": "Climate Division",
"ethnolinguistic_region": "Ethnolinguistic Region",
"first_nation": "Canadian First Nation",
"game_management_unit": "Game Management Unit",
"yt_game_management_subzone": "Yukon Game Management Subzone",
}

cached_urls = [
Expand All @@ -86,12 +89,15 @@
all_jsons = [
"communities",
"hucs",
"yt_watersheds",
"protected_areas",
"corporations",
"climate_divisions",
"ethnolinguistic_regions",
"fire_zones",
"yt_fire_districts",
"game_management_units",
"yt_game_management_subzones",
"first_nations",
"boroughs",
"census_areas",
Expand All @@ -106,9 +112,12 @@
"corporation": "corporations_near",
"ethnolinguistic_region": "ethnolinguistic_regions_near",
"fire_zone": "fire_management_units_near",
"yt_fire_district": "yt_fire_districts_near",
"game_management_unit": "game_management_units_near",
"yt_game_management_subzone": "yt_game_management_subzones_near",
"first_nation": "ca_first_nations_near",
"huc": "hucs_near",
"yt_watershed": "yt_watersheds_near",
"protected_area": "protected_areas_near",
}

Expand Down
10 changes: 7 additions & 3 deletions routes/vectordata.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def find_via_gs(lat, lon):

# WFS request to Geoserver for all polygon areas.
nearby_areas = asyncio.run(
fetch_data([generate_wfs_search_url("all_boundaries:all_areas", lat, lon)])
fetch_data([generate_wfs_search_url("playground:all_areas_test5", lat, lon)])
)["features"]

# Create the JSON section for each of the area types.
Expand Down Expand Up @@ -126,7 +126,11 @@ def get_total_bounds(nearby_areas, communities=None):
areas_gdf = gpd.GeoDataFrame.from_features(nearby_areas)

# Make a new GeoPandas GeoDataFrome which contains only the HUCs and protected areas
huc_pa_gdf = areas_gdf[areas_gdf["type"].isin(["huc", "protected_area"])].copy()
huc_pa_gdf = areas_gdf[
areas_gdf["type"].isin(
["huc", "protected_area", "yt_watershed", "yt_game_management_zone"]
)
].copy()

# If there were any nearby communities, we want to ensure our
# bounding box includes them.
Expand Down Expand Up @@ -227,7 +231,7 @@ def get_json_for_type(type, recurse=False):
fetch_data(
[
generate_wfs_places_url(
"all_boundaries:all_areas", "id,name,type,area_type", type
"playground:all_areas_test5", "id,name,type,area_type", type
)
]
)
Expand Down
2 changes: 1 addition & 1 deletion validate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def place_name_and_type(place_id):
fetch_data(
[
generate_wfs_places_url(
"all_boundaries:all_areas", "name,alt_name,type", place_id, "id"
"playground:all_areas_test5", "name,alt_name,type", place_id, "id"
)
]
)
Expand Down
6 changes: 5 additions & 1 deletion validate_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ def validate_var_id(var_id):

var_id_check = asyncio.run(
fetch_data(
[generate_wfs_places_url("all_boundaries:all_areas", "type", var_id, "id")]
[
generate_wfs_places_url(
"playground:all_areas_test5", "type", var_id, "id"
)
]
)
)

Expand Down

0 comments on commit 23b4c9e

Please sign in to comment.