Questions tagged [gdal-rasterize]

Burns vector geometries (points, lines, and polygons) into the raster band(s) of a raster image. Vectors are read from OGR supported vector formats.

5
votes
1answer
6k views

Rasterizing shapefiles with GDAL and Python?

I am trying to rasterize a shapefile, and write values from a specific column of the shapefile into the resulting GTiff. Here is what I've done so far, but that only creates a GTiff of zeros. from ...
5
votes
5answers
4k views

How do I create blank geotiff with same spatial properties as existing geotiff?

How do I use gdal to create a blank geotiff with the same spatial properties (size, resolution, extent, projection) as an existing geotiff? (The reason that I want to do this is that I'm using ...
4
votes
1answer
839 views

How to set opacity with gdal_rasterize

I am using gdal_rasterize to create a raster of a huge file containing polygons. I managed to generate the raster file with the right color and with the minimum size to tile it after with the ...
3
votes
3answers
5k views

How to convert file .shp to .tif using ogr or python or gdal

I need to convert files. I'm trying to use gdal_rasterize gdal_rasterize -b 1 -burn 0 -l file file.shp work.tif and the output is the following: ERROR 10: Pointer 'hDS' is NULL in '...
2
votes
1answer
1k views

How gdal_rasterize works - how it interpolates / resample values?

I have huge number of points saved as shapefile. I created an empty raster file with low spatial resolution. Next, I applied gdal_rasterize on mentioned .shp and used low resolution raster as ...
5
votes
2answers
929 views

Create MBTiles from geojson in raster format

I am trying to create raster file in the Mbtiles format. I tried , $ gdal_rasterize -ot Byte -burn 255 -burn 0 -burn 0 -ts 4950 4090 -of MBTiles station.geojson station.mbtiles I'm using, $...
4
votes
2answers
729 views

Get minimum, maximum, average, mean with gdal_rasterize?

I am not 100% sure but it seems like gdal_rasterize takes value of first found feature by default. Is there a way to tell I would like to get minimum / maximum / average / mean (/ count / sum just to ...
3
votes
1answer
363 views

Reversing the order of features in a layer using OGR

I'm working on rasterizing some polygons using gdal_rasterize. This works great, but I want the rasterize command to place features with lower FIDs on top of those with higher FIDs. (Gdal_rasterize ...
2
votes
1answer
841 views

Python and GDAL: NoneType error while reading shapefile

I am a newbie to GDAL. I have a shapefile of Britain which I want to rasterize. This file can be obtained from here selecting United Kingdom as Country and Administrative areas as Subject. Following ...
2
votes
1answer
913 views

error “pointer hDs is NULL in GDAL GetProjectionRef” when using gdal_rasterize [duplicate]

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 I have tried different ...
1
vote
1answer
66 views

Convert a shapefile with variable values to a raster and distribute the values spatially in each grid cell

I want to convert a shapefile (polygons in WGS84) which contains 3 variables (float values) for each municipality of an area. In fact it contains 1035 municipalities. I want to convert it to a raster ...
1
vote
1answer
1k views

How to use gdal_rasterize with postgis vector?

I'm trying to convert a multipolygon vector layer to a raster using the GDAL tool gdal_rasterize. The command I am using is: gdal_rasterize -b 1 -burn -9999 PG:"dbname=db password=password" \ ...