[gdal-dev] gdal_rasterize usage problems

Andrew Brooks arb at sat.dundee.ac.uk
Fri Nov 14 18:19:14 EST 2008


Thanks for the help everyone, I'll summarise when I get it all working ;-)

Jamie Adams <jaadfoo at gmail.com> wrote:
> 
> Are your files in the same projection?  I know gshhs is projected in wgs84
> by default, and I see your raster is in British National Grid.

To what extent do they need to be in the same projection?  Isn't a change
of datum sufficient?

Firstly, is gdal_rasterize not capable of performing the change of SRS
internally itself?  That would save having to use ogr2ogr to write a new
vector file for every image.

Secondly, how closely do the vector and raster SRS need to match?  Surely
as long as both are WGS84 (for example) that should suffice?  But when I
try to rasterise a WGS84 vector onto a WGS84 Mercator raster it complains
and doesn't work.

Thirdly, when I "reproject" the vector to Mercator first and then rasterize
it does work, to an extent, but it smears random extra vectors across the
raster :-(  It does this for both gshhs_land and v0_landmass so I don't
think the vector itself is the problem.

Andrew



More information about the gdal-dev mailing list