一个简单的python模块,将光栅转换为pandas数据帧。
rastertodataframe的Python项目详细描述
光栅到数据帧
一个简单的python模块,将光栅转换为pandas数据帧。
fromrastertodataframeimportraster_to_dataframeraster_path='/some/gdal/compatible/file.tif'vector_path='/some/ogr/compatible/file.geojson'# Extract all image pixels (no vector).df=raster_to_dataframe(raster_path)# Extract only pixels the vector touches and include the vector metadata.df=raster_to_dataframe(raster_path,vector_path=vector_path)
- 自由软件:麻省理工学院许可证
- 文档:https://rastertodataframe.readthedocs.io。
功能
- 将任何与gdal兼容的光栅转换为pandas数据帧。
- 或者,如果给定了任何与ogr兼容的矢量文件,则仅从光栅中提取矢量接触的像素。输出数据帧包括这些像素以及向量文件中的任何属性。
安装
pipinstallrastertodataframe
- 需要工作的GDAL/OGR安装。这最好用conda来完成。
conda install -c conda-forge numpy gdal geopandas pandas pyproj
学分
这个包是用Cookiecutter和audreyr/cookiecutter-pypackage项目模板创建的。
历史记录
0.2.1(2019-02-13)
- 添加对单波段光栅的支持。
0.2.0(2018-07-12)
- 实现平铺以减少大型光栅的内存使用。
0.1.3(2018-07-09)
- 删除依赖项以修复非生成安装。
0.1.2(2018-07-09)
- 修复在Windows上创建临时文件的问题。
0.1.1(2018-07-08)
- 所有逻辑都通过单元测试实现。准备释放pypi。
0.1.0(2018-07-07)
- 项目开始。