【发布时间】:2021-03-31 18:21:10
【问题描述】:
【问题讨论】:
【问题讨论】:
我建议使用GeoPandas。 GeoPandas 将为您提供比 scipy 更多的地理空间数据选项。
您可以使用 GeoPandas 轻松计算船体并做一些 affine transformations 之类的操作,例如 scale。
下面是一个带有随机坐标的简短示例。
import plotly.express as px
import numpy as np
import geopandas as gp
from shapely.geometry import MultiPoint
def get_coordinates():
return [ np.random.uniform(160.3, 171.2),np.random.uniform(27.1, 36.3) ]
points = [ get_coordinates() for _ in range(50) ]
gdf = gp.GeoDataFrame(index=[0], crs= {'init':'epsg:4326'}, geometry=[MultiPoint(points)])
gdf_hull = gdf.convex_hull
gdf_hull_scaled = gdf_hull.scale(2,2,2,origin='center')
例如,您可以使用plotly 绘制数据。该图显示了比例因子为 2 的结果。
【讨论】: