Advertisement
Guest User

Untitled

a guest
Aug 21st, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. 'File "C:Python27libsite-packagesfoliumfolium.py", line 606, in choropleth
  2. geo_data = open(geo_path)
  3. IOError: [Errno 2] No such file or directory: '{"type": "FeatureCollection", "features": [{"geometry": {"type": "Polygon", "coordinates": [[[-8719814.090035686,'
  4.  
  5. import geopandas as gpd
  6. import pandas as pd
  7. import matplotlib.pyplot as plt
  8. from matplotlib import style
  9. import shapely as sh
  10. import numpy as np
  11. import random
  12. import folium
  13.  
  14.  
  15.  
  16. lotes = gpd.read_file("shapefiles/reProj/Lotes_Datos_epsg3857_SM.shp")
  17. lotes.crs = {'init' : 'epsg:3857'}
  18.  
  19. geoPath = lotes.geometry.to_json()
  20. data1 = lotes.Area_Total.to_json()
  21.  
  22. mapa = folium.Map([0, -78], zoom_start=3, tiles='Stamen Toner',API_key='wrobstory.map-12345678')
  23.  
  24. mapa.choropleth(geo_path=geoPath, data=data1,
  25. columns=['Lote', 'data1'],
  26. key_on='feature.id',
  27. fill_color='YlGn',
  28. fill_opacity=0.7, line_opacity=0.2,
  29. legend_name='data1')
  30. mapa
  31.  
  32. mapa.save(outfile = 'shapefiles/reProj/test.html')
  33.  
  34. mapa.choropleth(geo_str=geoPath, data=data1,
  35. columns=['Lote', 'data1'],
  36. key_on='feature.id',
  37. fill_color='YlGn',
  38. fill_opacity=0.7, line_opacity=0.2,
  39. legend_name='data1')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement