Skip to main content
Post Closed as "Duplicate" by user2856, nmtoken, Andre Silva, artwork21, whuber
edited tags
Link
Ian Turton
  • 83.2k
  • 6
  • 89
  • 189
Source Link

error "pointer hDs is NULL in GDAL GetProjectionRef" when using gdal_rasterize

I want to convert a .shp to .tif. So I find the tool gdal_rasterize may help. But when I input the file it always meet this error:

pointer hDs is NULL in GDAL GetProjectionRef

screenshot

I have tried different versions of GDAL(1.11.0 and 2.1.0),same error. The test data is from http://qgis.org/downloads/data/qgis_sample_data.zip

1)Is this wrong because of the data?or the wrong syntax?

2)What is the correct syntax for using gdal_rasterize()?

3)Is there a better way to convert shp to png(or tif)?coding by myself is ok but I use Java.