我目前正在使用 python 和 geopandas、shapely 和 pyshp 研究 shapefile 的数据结构。要最小化 shapefile 的总大小,几何列的数据类型应为 float32。我已经尝试过多次使用 shapely 和 pyshp 将 flot64 转换为 float32,但我找不到任何方法。有什么方法可以更改 shapefile 中几何的数据类型?
当我使用 shapely 库编写 2D 多边形 shapefile 时,即使我使用 2 个 float32 numpy 数组作为输入坐标,它也会自动将多边形的数据类型更改为 float64。和 pyshp 也是。
我用谷歌搜索找到方法,找不到任何解决方案。可能是因为根据 ESRI shapefile Technical Description,shapefile 使用 float64 作为默认多边形数据类型。