In [2]:
import emapy as epy
In [4]:
T = epy.getDatabase('barris', 'geojson','../data/raw/barris.geojson', '',True, 0, 1, 'neighbourhood')
map = epy.mapCreation(41.388790,2.158990)
cluster = epy.mapWithMarkerCluster(map, "Restaurants Barcelona")
In [8]:
maxP = len(T[1])
porc = 0
x = 0
maxSee = 10
for barri in T[1]: #all barcelona polygons
if x < maxSee:
data = epy.getDatabaseFromOSM('restaurantes', 'amenity', True, True, T[1][barri],'restaurant')
for d in data:
epy.mapAddMarkerToCluster(cluster, d["geometry"][0], d["geometry"][1], 'glyphicon-glass', 'green', "")
porc +=1
print ( porc * 1.0 / min(maxP, maxSee) * 1.0) * 100
x += 1
In [6]:
map
epy.mapSave(map, '../reports/maps/mapOfRestaurantsBCNByPolygon.html')
Out[6]:
In [ ]:
In [ ]:
In [ ]:
In [ ]:
In [ ]: