小编use*_*702的帖子

计算整个 GeoDataFrame 点的质心

我想从 geojson 文件导入一些航点/标记。然后确定所有点的质心。我的代码计算每个点的质心,而不是该系列中所有点的质心。如何计算系列中所有点的质心?

import geopandas

filepath = r'Shiloh.json'

gdf = geopandas.read_file(filepath)

xyz = gdf['geometry'].to_crs('epsg:3587')

print(type(xyz))
print(xyz)

# xyz is a geometry containing POINT Z

c = xyz.centroid


# instead of calculating the centroid of the collection of points
# centroid has calculated the centroid of each point. 
# i.e. basically the same X and Y data as the POINT Z.

Run Code Online (Sandbox Code Playgroud)

print(type(xyz)) 和 print(xyz) 的输出

<class 'geopandas.geoseries.GeoSeries'>
0    POINT Z (2756810.617 248051.052 0.000)
1    POINT Z (2757659.756 247778.482 0.000)
2    POINT …
Run Code Online (Sandbox Code Playgroud)

python geojson geopandas

7
推荐指数
1
解决办法
5419
查看次数

蓝牙外观图标

我正在研究BLE设备的固件,需要定义一个外观值.现在,我选择了"通用计算机".但是,外观值的完整列表https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.characteristic.gap.appearance.xml 具有一些可能更合适的值.在Windows 10中,"通用计算机"显示为桌面PC的图标.是否有可用资源允许我查看任何/所有支持的外观值的图标?我想避免多次编译,加载和浏览循环只是为了观察图标.

bluetooth bluetooth-lowenergy bluetooth-gatt

6
推荐指数
1
解决办法
499
查看次数