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
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

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.