Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'File "C:Python27libsite-packagesfoliumfolium.py", line 606, in choropleth
- geo_data = open(geo_path)
- IOError: [Errno 2] No such file or directory: '{"type": "FeatureCollection", "features": [{"geometry": {"type": "Polygon", "coordinates": [[[-8719814.090035686,'
- import geopandas as gpd
- import pandas as pd
- import matplotlib.pyplot as plt
- from matplotlib import style
- import shapely as sh
- import numpy as np
- import random
- import folium
- lotes = gpd.read_file("shapefiles/reProj/Lotes_Datos_epsg3857_SM.shp")
- lotes.crs = {'init' : 'epsg:3857'}
- geoPath = lotes.geometry.to_json()
- data1 = lotes.Area_Total.to_json()
- mapa = folium.Map([0, -78], zoom_start=3, tiles='Stamen Toner',API_key='wrobstory.map-12345678')
- mapa.choropleth(geo_path=geoPath, data=data1,
- columns=['Lote', 'data1'],
- key_on='feature.id',
- fill_color='YlGn',
- fill_opacity=0.7, line_opacity=0.2,
- legend_name='data1')
- mapa
- mapa.save(outfile = 'shapefiles/reProj/test.html')
- mapa.choropleth(geo_str=geoPath, data=data1,
- columns=['Lote', 'data1'],
- key_on='feature.id',
- fill_color='YlGn',
- fill_opacity=0.7, line_opacity=0.2,
- legend_name='data1')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement