提问人:Amelie 提问时间:11/17/2023 更新时间:11/17/2023 访问量:4
大型 LINESTRING 地理数据的聚类或累积
Clustering or accumulations of big LINESTRING geodata
问:
我有一个近 30,000 行的建筑物的大型 LINESTRING 地理数据。当我试图用情节(去。Scattermapbox) 通过创建跟踪和布局,它不会在地图上显示任何内容,因为数据很大并且加载很长时间,直到它停止响应。
我决定对线串数据进行聚类,只想像边界(多边形)一样绘制。我试图将 LINESTRING 数据分解为 POINT 并执行 POLYGON,但没有成功。
# Function to extract the x and y coordinates from a point
def extract_x(point):
return point[0]
def extract_y(point):
return point[1]
x1 = building_coords.apply(lambda line: [extract_x(point) for point in line.coords])
y1 = building_coords.apply(lambda line: [extract_y(point) for point in line.coords])
#x1p,y1p = transform(inProj,outProj,x1,y1)
x_coordinates = x1.tolist()
y_coordinates = y1.tolist()
# Create a polygon using the x and y coordinates
coordinates = list(zip(x_coordinates, y_coordinates))
# Create a polygon using the coordinates
polygon = Polygon(coordinates)
的类型是 geopandas.geoseries.GeoSeries 数据。如果有人可以指导我并为我的问题推荐一些材料,那将会很有帮助。我是 Python 的新手,任何类型的建议和贡献都会有很大帮助。building_coords
答: 暂无答案
评论