0

Good evening, I am currently trying to download data from a polygon and I can't compile the code because kernel keeps dying. Here is the code:

import geopandas as gpd 
import pandas as pd 
from shapely.geometry import Point, LineString, Polygon 
import networkx as nx 
import osmnx as ox 
import matplotlib.pyplot as plt 
from descartes import PolygonPatch 
from IPython.display import IFrame 
ox.config(log_console=True, use_cache=True)

place = 'Portugal'

G = ox.gdf_from_place(place)

exploded_G = G.explode()

exploded_G['area'] = exploded_G.area
exploded_G.sort_values(by='area', inplace=True)

Portugal= exploded_G.iloc[-1]['geometry']

g = ox.graph_from_polygon(polygon = Portugal, network_type = 'drive')

Kernel dies in the last line of code I have shared. I don't know why, I have created a new environment in anaconda and ran the code again and once again kernel died. I have uninstalled and installed anaconda and several packages. And yet my efforts have been unsuccessful.

Thank you in advance for the help.

Best regards.

DPM
  • 845
  • 7
  • 33
  • 1
    can you add the error message to your post? that would help pinpoint the error. – RickyA May 07 '20 at 00:13
  • Kernel Restarting The kernel for Desktop/osmnx_project.ipynb appears to have died. It will restart automatically. – DPM May 07 '20 at 09:55

1 Answers1

0

It turns out that it is a RAM problem, plus Jupyter is not the appropriate compiler. Try using PyCharm or spyder or ohter.

DPM
  • 845
  • 7
  • 33