eo-box:使用矢量数据提取栅格值

时间:2020-06-12 17:19:26

标签: python gdal nonetype

我正在尝试使用我的数据复制此(code)。但是,运行此命令时出现以下错误。我遵循了教程中的所有步骤,但是我不确定错误是什么意思:

extraction.extract(src_vector=src_vector,
                   burn_attribute=burn_attribute,
                   src_raster=src_raster,
                   dst_names=dst_names,
                   dst_dir=extraction_dir)

错误

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-150-c680857fea94> in <module>
      3                    src_raster=src_raster,
      4                    dst_names=dst_names,
----> 5                    dst_dir=extraction_dir)

~/anaconda3/envs/eobox/lib/python3.6/site-packages/eobox/raster/extraction.py in extract(src_vector, burn_attribute, src_raster, dst_names, dst_dir, dist2pb, dist2rb, src_raster_template, gdal_dtype, n_jobs)
    105                   src_raster_template=src_raster_template,
    106                   dst_rasterized=path_rasterized,
--> 107                   gdal_dtype=gdal_dtype)
    108 
    109     # if any of the destination files do not exist we need the locations of the pixels to be

~/anaconda3/envs/eobox/lib/python3.6/site-packages/eobox/raster/gdalutils.py in rasterize(src_vector, burn_attribute, src_raster_template, dst_rasterized, gdal_dtype)
    203                                                      gdal_dtype)  # gdal.GDT_Byte
    204     # import osr
--> 205     target_ds.SetGeoTransform((geo_transform[0],  # x_min
    206                                geo_transform[1],  # pixel_width
    207                                0,

AttributeError: 'NoneType' object has no attribute 'SetGeoTransform'

0 个答案:

没有答案