Skip to content

Commit

Permalink
Add more comments to init
Browse files Browse the repository at this point in the history
  • Loading branch information
rhugonnet committed Aug 15, 2023
1 parent ea78ef3 commit e48d293
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions geoutils/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ def __init__(self, filename_or_dataset: str | pathlib.Path | gpd.GeoDataFrame |
:param filename_or_dataset: Path to file, or GeoPandas dataframe or series, or Shapely geometry.
"""

# If filename is passed
if isinstance(filename_or_dataset, (str, pathlib.Path)):
with warnings.catch_warnings():
# This warning shows up in numpy 1.21 (2021-07-09)
warnings.filterwarnings("ignore", ".*attribute.*array_interface.*Polygon.*")
ds = gpd.read_file(filename_or_dataset)
self._ds = ds
self._name: str | gpd.GeoDataFrame | None = filename_or_dataset
# If GeoPandas or Shapely object is passed
elif isinstance(filename_or_dataset, (gpd.GeoDataFrame, gpd.GeoSeries, shapely.Geometry)):
self._name = None
if isinstance(filename_or_dataset, gpd.GeoDataFrame):
Expand Down

0 comments on commit e48d293

Please sign in to comment.