Skip to content

Commit

Permalink
check if param is None
Browse files Browse the repository at this point in the history
  • Loading branch information
Claudio9701 committed Nov 10, 2023
1 parent b0aae31 commit c54b67e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions urbanpy/download/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ def nominatim_osm(query: str, expected_position: "int | None" = 0) -> GeoDataFra
response = requests.get(osm_url, params=osm_parameters)
all_results = response.json()
gdf = gpd.GeoDataFrame.from_features(all_results["features"], crs="EPSG:4326")
if expected_position:
return gdf.iloc[expected_position : expected_position + 1] # this returns a GeoDataFrame instead of GeoSeries

return gdf
if expected_position is None:
return gdf
return gdf.iloc[expected_position : expected_position + 1]


def overpass_pois(bounds, facilities=None, custom_query=None):
Expand Down

0 comments on commit c54b67e

Please sign in to comment.