利用PYTHON创建楼宇或建筑物Shapefile文件

import geopandas as gpd
from shapely.geometry import Polygon

创建楼宇面的坐标点(此处为示例数据)

points =[(113.2815958440001,23.140979446000074),(113.28158917700011,23.140823261000037),(113.28135503800002,23.14083325400003),(113.28136170500011,23.140989440000055),(113.2815958440001,23.140979446000074)]

创建Polygon对象

polygon = Polygon(points)

将Polygon对象转换为GeoDataFrame

gdf = gpd.GeoDataFrame(index=[0], crs=‘EPSG:4326’, geometry=[polygon])

将GeoDataFrame保存为Shapefile文件

gdf.to_file(filename=‘./buildings.shp’, driver=‘ESRI Shapefile’)

你可能感兴趣的:(python)