# ---
# jupyter:
#   jupytext:
#     text_representation:
#       extension: .py
#       format_name: light
#       format_version: '1.5'
#       jupytext_version: 1.14.4
#   kernelspec:
#     display_name: Python 3
#     language: python
#     name: python3
# ---

# %matplotlib inline
import intake
catalog = intake.open_catalog("./catalog.yml")
open_data = catalog.la_open_data

service_requests = open_data.search('Small Cell')
for entry_id, entry in service_requests.items():
    display(entry)

small_cells = service_requests['https://data.lacity.org/api/views/3nrm-mq6k'].read()

small_cells.head()

# ## Making a Map using Geopandas
#
# Now that we have a dataframe, we can turn it into a Geodataframe and plot it using geopandas. 
#
# However, this is pretty hard to use as a map. 

import geopandas as gpd
from ipyleaflet import Map, GeoData, basemaps, LayersControl
gdf = gpd.GeoDataFrame(small_cells)
gdf.plot()

# # Point Map using ipyleaflet
#
# Using ipyleaflet, we can add a geodataframe layer

m = Map(center=(33.8711,-117.8628), zoom = 9, basemap= basemaps.Esri.WorldTopoMap)

small_cell_layer = GeoData(geo_dataframe = gdf,
                   name = 'Small Cells')


m.add_layer(small_cell_layer)

m

# # Heatmap, instead



StarcoderdataJupyterScriptsDedupFiltered