Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose silent arg in get_geodata #261

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions pynsee/geodata/get_geodata.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def get_geodata(
update: bool = False,
crs: Any = "EPSG:3857",
constrain_area: Optional[GeoDataFrame] = None,
silent: bool = False,
) -> GeoFrDataFrame:
"""Get geographical data with identifier and from IGN API

Expand All @@ -25,6 +26,8 @@ def get_geodata(

constrain_area (:class:`~geopandas.GeoDataFrame`, optional): GeoDataFrame used to constrain the area of interest. Defaults to None.

silence (bool, optional): whether to print warnings or not. Defaults to False.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add a .. versionadded:: 0.3.0 with "added silent parameter"?

.. versionchanged: 0.2.0

Changed `polygon` and `crsPolygon` into a `constrain_area` :class:`~geopandas.GeoDataFrame`.
Expand All @@ -40,20 +43,21 @@ def get_geodata(

"""
polygon = None
crsPolygon = "EPSG:4326"
crs_polygon = "EPSG:4326"

if constrain_area is not None:
if constrain_area.crs.to_string() not in ("EPSG:3857", "EPSG:4326"):
constrain_area = constrain_area.to_crs("EPSG:4326")

polygon = constrain_area.union_all()
crsPolygon = constrain_area.crs.to_string()
crs_polygon = constrain_area.crs.to_string()

return _get_geodata(
dataset_id=dataset_id,
update=update,
crs=crs,
ignore_error=False,
polygon=polygon,
crs_polygon=crsPolygon,
crs_polygon=crs_polygon,
silent=silent,
)