In [1]:
import geopandas as gpd
from shapely.geometry import Polygon
In [ ]:
lat_point_list = [70.815, 67.202, 67.695, 70.995]
lon_point_list = [16.835, 19.450, 23.185, 18.945]
polygon_geom = Polygon(zip(lon_point_list, lat_point_list))
crs = {'init': 'epsg:4326'}
polygon = gpd.GeoDataFrame(index=[0], crs=crs, geometry=[polygon_geom])
print(polygon.geometry)
In [ ]:
# polygon.to_file(filename='polygon.geojson', driver='GeoJSON')
polygon.to_file(filename='polygon.shp', driver="ESRI Shapefile")
Plot the polygon with folium.
In [ ]:
import folium
In [ ]:
m = folium.Map([50.854457, 4.377184], zoom_start=5, tiles='cartodbpositron')
folium.GeoJson(polygon).add_to(m)
folium.LatLngPopup().add_to(m)
m