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

Regarding projection system(crs) for graph generation #95

Open
rockbusteriitk opened this issue Dec 5, 2023 · 2 comments
Open

Regarding projection system(crs) for graph generation #95

rockbusteriitk opened this issue Dec 5, 2023 · 2 comments

Comments

@rockbusteriitk
Copy link

Hi,

I tried theEPSG:3857 Projection.

"from geograph import GeoGraph
data= r'D:\Geograph\lulc_test\lulc_2021.tif'
graph = GeoGraph(data,crs="EPSG:3857")"

and

"from geograph.visualisation.geoviewer import GeoGraphViewer
viewer = GeoGraphViewer()
viewer.add_graph(graph, name='my_graph')
#viewer.enable_graph_controls()
viewer"

and I received the error:
"AttributeError Traceback (most recent call last)
Cell In[5], line 3
1 from geograph.visualisation.geoviewer import GeoGraphViewer
2 viewer = GeoGraphViewer()
----> 3 viewer.add_graph(graph, name='my_graph')
4 #viewer.enable_graph_controls()
5 viewer

File ~\anaconda3\envs\geograph-local\lib\site-packages\geograph\visualisation\geoviewer.py:231, in GeoGraphViewer.add_graph(self, graph, name, with_components)
226 self.logger.debug("Creating graph geometries layer (graph_geo_data).")
227 nodes, edges = graph_utils.create_node_edge_geometries(
228 current_graph, crs=self.gpd_crs_code
229 )
230 graph_geo_data = ipyleaflet.GeoData(
--> 231 geo_dataframe=edges.append(nodes)
232 .to_frame(name="geometry")
233 .reset_index(),
234 name=current_name + "_graph",
235 **self.layer_style["graph"]
236 )
238 # Creating choropleth layer for patch polygons
239 self.logger.debug("Creating patch polygons layer (pgon_choropleth).")

File ~\anaconda3\envs\geograph-local\lib\site-packages\geopandas\geoseries.py:235, in GeoSeries.append(self, *args, **kwargs)
234 def append(self, *args, **kwargs):
--> 235 return self._wrapped_pandas_method("append", *args, **kwargs)

File ~\anaconda3\envs\geograph-local\lib\site-packages\geopandas\geoseries.py:622, in GeoSeries._wrapped_pandas_method(self, mtd, *args, **kwargs)
620 def _wrapped_pandas_method(self, mtd, *args, **kwargs):
621 """Wrap a generic pandas method to ensure it returns a GeoSeries"""
--> 622 val = getattr(super(), mtd)(*args, **kwargs)
623 if type(val) == Series:
624 val.class = GeoSeries

AttributeError: 'super' object has no attribute 'append"

What might be the problem and is there a wayaround?

@lucbettaieb
Copy link

I'm also getting this error.

@lucbettaieb
Copy link

lucbettaieb commented Apr 12, 2024

Looks like it's related to the append function being deprecated in pandas.

Similar issue: https://stackoverflow.com/questions/75956209/error-dataframe-object-has-no-attribute-append

Can get around it by updating functions similar to this:
geopandas/geopandas#2606

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants