pysal / spaghetti

SPAtial GrapHs: nETworks, Topology, & Inference
http://pysal.org/spaghetti/
BSD 3-Clause "New" or "Revised" License
260 stars 69 forks source link

Error in using spaghetti.element_as_gdf #742

Closed adhamenaya closed 11 months ago

adhamenaya commented 11 months ago

Describe the bug Error while using _spaghetti.element_asgdf

To Reproduce

Run the following code that was tasked from the library tutorial:
%config InlineBackend.figure_format = "retina"
%load_ext watermark
%watermark

import esda
import libpysal
import matplotlib
import matplotlib_scalebar
from matplotlib_scalebar.scalebar import ScaleBar
import numpy
import spaghetti
import splot

%matplotlib inline
%watermark -w
%watermark -iv

ntw = spaghetti.Network(in_data=libpysal.examples.get_path("streets.shp"))
ntw

_, arc_df = spaghetti.element_as_gdf(ntw, vertices=True, arcs=True)
arc_df.head()

System & Versions

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.
jGaboardi commented 11 months ago

Thanks for the report!

This error has been fixed in the latest release of spaghetti. Please upgrade to spaghetti==1.7.4.

xref: https://github.com/pysal/spaghetti/issues/717, https://github.com/pysal/spaghetti/issues/718

adhamenaya commented 11 months ago

@jGaboardi yeah!! thank you soo much!!!