UDST / pandana

Pandas Network Analysis by UrbanSim: fast accessibility metrics and shortest paths, using contraction hierarchies :world_map:
http://udst.github.io/pandana
GNU Affero General Public License v3.0
385 stars 84 forks source link

query the OSM API for the street network within the specified bounding box error #188

Closed Viktoriiqa closed 1 year ago

Viktoriiqa commented 1 year ago

If you encounter a bug in Pandana please: 1) first search the previously opened issues to see if the problem has already been reported; 2) If not, fill in the template below and tag with the appropriate Type label. You can delete any sections that do not apply.

ValueError: Assigning CRS to a GeoDataFrame without a geometry column is not supported. Use GeoDataFrame.set_geometry to set the active geometry column during quering the osm api

Network data (optional)

If the issue is related to specific network data please provide a link to download the data or the function used to download the data.

Environment

Paste the code that reproduces the issue here:

#network = osm.pdna_network_from_bbox(lat_min=bbox[0],lng_min=bbox[1], lat_max=bbox[2], lng_max=bbox[3])

Paste the error message (if applicable):

# /usr/local/lib/python3.10/dist-packages/geopandas/geodataframe.py:205: UserWarning: Pandas doesn't allow columns to be created via a new attribute name - see https://pandas.pydata.org/pandas-docs/stable/indexing.html#attribute-access
  super().__setattr__(attr, val)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/geopandas/geodataframe.py](https://localhost:8080/#) in crs(self)
    435         try:
--> 436             return self.geometry.crs
    437         except AttributeError:

13 frames
AttributeError: You are calling a geospatial method on the GeoDataFrame, but the active geometry column to use has not been set. 
There are no existing columns with geometry data type. You can add a geometry column as the active geometry column with df.set_geometry. 

During handling of the above exception, another exception occurred:

AttributeError                            Traceback (most recent call last)
AttributeError: The CRS attribute of a GeoDataFrame without an active geometry column is not defined. Use GeoDataFrame.set_geometry to set the active geometry column.

During handling of the above exception, another exception occurred:

ValueError                                Traceback (most recent call last)
[/usr/local/lib/python3.10/dist-packages/geopandas/geodataframe.py](https://localhost:8080/#) in crs(self, value)
    446         """Sets the value of the crs"""
    447         if self._geometry_column_name is None:
--> 448             raise ValueError(
    449                 "Assigning CRS to a GeoDataFrame without a geometry column is not "
    450                 "supported. Use GeoDataFrame.set_geometry to set the active "

ValueError: Assigning CRS to a GeoDataFrame without a geometry column is not supported. Use GeoDataFrame.set_geometry to set the active geometry column.
sablanchard commented 1 year ago

Thanks @Viktoriiatomnyuk , this is the same issue as this one: https://github.com/UDST/pandana/issues/181 and has a work around here: https://github.com/UDST/pandana/issues/181#issuecomment-1402839437 its an issue with a Pandana dependency, not Pandana itself.