Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
smnorris committed Dec 11, 2024
1 parent ec97cc8 commit e496d00
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/bcdata/wfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ def ensure_single_geometry_type(df):
]
return df


class ServiceException(Exception):
pass

Expand Down Expand Up @@ -379,9 +380,7 @@ def make_requests(
# if specified, lowercasify all properties
if lowercase:
for feature in outjson["features"]:
feature["properties"] = {
k.lower(): v for k, v in feature["properties"].items()
}
feature["properties"] = {k.lower(): v for k, v in feature["properties"].items()}

# load to geodataframe, standardize data slightly
if len(outjson["features"]) > 0:
Expand Down Expand Up @@ -422,7 +421,7 @@ def get_data(
sortby=None,
as_gdf=False,
lowercase=False,
clean=True
clean=True,
):
"""Request features from DataBC WFS and return GeoJSON featurecollection or geodataframe"""
dataset = self.validate_name(dataset)
Expand All @@ -435,7 +434,9 @@ def get_data(
count=count,
sortby=sortby,
)
return self.make_requests(dataset, urls, as_gdf=as_gdf, crs=crs, lowercase=lowercase, clean=clean)
return self.make_requests(
dataset, urls, as_gdf=as_gdf, crs=crs, lowercase=lowercase, clean=clean
)

def get_features(
self,
Expand Down Expand Up @@ -516,7 +517,7 @@ def get_data(
sortby=None,
as_gdf=False,
lowercase=False,
clean=True
clean=True,
):
WFS = BCWFS()
return WFS.get_data(
Expand All @@ -529,7 +530,7 @@ def get_data(
sortby=sortby,
as_gdf=as_gdf,
lowercase=lowercase,
clean=clean
clean=clean,
)


Expand Down

0 comments on commit e496d00

Please sign in to comment.