Monday, December 16, 2019

Additional Python Modules

russian-notes-pythondataanalysis-2-40.ipynb


import pandas,geopandas,pylab,warnings,fiona
fiona._env.set_gdal_config('OGR_GEOMETRY_ACCEPT_UNCLOSED_RING','YES')
fiona._env.logging.disable(level='WARNING')
warnings.filterwarnings('ignore',category=FutureWarning)
pylab.style.use('fivethirtyeight')
fpath='https://raw.githubusercontent.com/OlgaBelitskaya/'+\
      'OlgaBelitskaya.github.io/master/map.geojson'
df=geopandas.GeoDataFrame.from_file(fpath)
ax=df.boundary.plot(
    figsize=(12,7),markersize=0,linewidth=.1,edgecolor='gray')
footways=df['geometry'][df['highway']=='footway'].loc[2176:]
geopandas.plotting.plot_linestring_collection(
    ax,footways,linewidth=.8,
    color='steelblue',label='footways')
df[df['highway']=='street_lamp'].plot(
    ax=ax,edgecolor='g',markersize=10,label='lamps')
df[df['highway']=='traffic_signals'].plot(
    ax=ax,edgecolor='r',markersize=20,label='traffic signals') 
pylab.xlim(37.613,37.636); pylab.ylim(55.752,55.762)
pylab.legend(); pylab.tight_layout(); pylab.show()

No comments:

Post a Comment