[gdal-dev] gdal_rasterize usage problems

Andrew Brooks arb at sat.dundee.ac.uk
Fri Nov 21 10:41:25 EST 2008


On Fri, 14 Nov 2008 23:49:59 -0000, Jamie Adams <jaadfoo at gmail.com> wrote:

> The datum change isn't sufficient, as they are using different coordinate
> systems.  They actually have to have the same SRS, otherwise gdal_rasterize
> will see 2 very different ranges of coordinates (meter vs latlong).

This is the reason why I am getting the problems which can be seen in the
first image here:   http://www.sat.dundee.ac.uk/~arb/gdal-bugs/

The "reprojection" of the vectors using ogr2ogr is badly breaking them, so
when I burn them using gdal_rasterize I get spurious lines overlaid (the
smear images on the above page).

Is this a fault of ogr2ogr, or am I using it wrongly, or is there a better
way of burning a coastline onto a raster?

Andrew

P.S. This probably won't solve the current problem but could gdal_rasterise
be enhanced with something like this:

        poCT = OGRCreateCoordinateTransformation( hSrcSRS, hDstSRS );

and then

        hGeom = OGR_G_Clone( OGR_F_GetGeometryRef( hFeat )->transform( poCT ) );

or similar ?



More information about the gdal-dev mailing list