Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a multipolygon layer in PostGIS and I would like to use gdal_rasterize to generate a raster. I cannot find the correct syntax to specify PostGIS as the data source.

$ gdal_rasterize -a labor_force_2013_12 -l unemployment_by_county PG:'host=localhost user=usernamehere' out.tif
ERROR 4: `out.tif' does not exist in the file system, and is not recognised as a supported dataset name.`

All the gdal_rasterize examples I can find online use a shapefile as the data source but the gdal_rasterize man page says that the src_datasource parameter can be "Any OGR supported readable datasource"

share|improve this question

closed as unclear what you're asking by underdark Apr 26 at 22:11

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

2  
it looks like you're missing the dbname in your PG connection string. It should be something like: PG:'host=localhost dbname=yourDBname user=usernamehere' –  dmci May 31 '13 at 7:55
    
What version of GDAL? (gdalinfo --version ?). Before 1.8, gdal_rasterize ould not create a new raster at all. You could only burn into an existing *.tif. –  Micha Jun 1 '13 at 11:17
add comment