marceloprates / prettymaps

A small set of Python functions to draw pretty maps from OpenStreetMap data. Based on osmnx, matplotlib and shapely libraries.
GNU Affero General Public License v3.0
11.02k stars 516 forks source link

[BUG] Fatal Python error: Segmentation fault #123

Open swiss-knight opened 6 months ago

swiss-knight commented 6 months ago

Hello,

I'm trying to use prettymaps (installed from PyPi on Ubuntu 22.04.3 LTS with Python 3.10.12) but I encounter a fatal error.

Here is the code:

import prettymaps
prettymaps.plot('my address')

It runs into this error and a kernel reboot:

/usr/local/lib/python3.10/dist-packages/pygeos/set_operations.py:129: RuntimeWarning: invalid value encountered in intersection
  return lib.intersection(a, b, **kwargs)
/usr/local/lib/python3.10/dist-packages/osmnx/geometries.py:358: FutureWarning: You are adding a column named 'geometry' to a GeoDataFrame constructed without an active geometry column. Currently, this automatically sets the active geometry column to 'geometry' but in the future that will no longer happen. Instead, either provide geometry to the GeoDataFrame constructor (GeoDataFrame(... geometry=GeoSeries()) or use `set_geometry('geometry')` to explicitly set the active geometry column.
  gdf["geometry"] = np.nan
/usr/local/lib/python3.10/dist-packages/osmnx/geometries.py:358: FutureWarning: You are adding a column named 'geometry' to a GeoDataFrame constructed without an active geometry column. Currently, this automatically sets the active geometry column to 'geometry' but in the future that will no longer happen. Instead, either provide geometry to the GeoDataFrame constructor (GeoDataFrame(... geometry=GeoSeries()) or use `set_geometry('geometry')` to explicitly set the active geometry column.
  gdf["geometry"] = np.nan

Fatal Python error: Segmentation fault

Main thread:
Current thread 0x00007fc083ff51c0 (most recent call first):
  File "/usr/local/lib/python3.10/dist-packages/shapely/ops.py", line 160 in unary_union
  File "/usr/local/lib/python3.10/dist-packages/prettymaps/draw.py", line 380 in graph_to_shapely
  File "/usr/local/lib/python3.10/dist-packages/prettymaps/draw.py", line 454 in gdf_to_shapely
  File "/usr/local/lib/python3.10/dist-packages/prettymaps/draw.py", line 228 in plot_gdf
  File "/usr/local/lib/python3.10/dist-packages/prettymaps/draw.py", line 951 in plot
  File "/tmp/ipykernel_3619932/1479754582.py", line 1 in <cell line: 1>

Restarting kernel...