Selon "Simon (Vsevolod) Ilyushchenko" <[email protected]>: Yes, your proposal is better and deals with non-square pixel. So I've changed the wiki page accordingly. Thanks!
> Hi, > > I'm new to gdal, so I could be very wrong about this. > > When I tried to follow the example in > http://trac.osgeo.org/gdal/wiki/FAQRaster#HowcanIcreateablankrasterbasedonavectorfilesextentsforusewithgdal_rasterize > to generate a blank geotiff based on a shapefile, I got incorrect > results. Here's what I had to change to generate the correct geotiff. > > Instead of: > > raster_transform = [src_extent[0], px, 0.0, src_extent[3], 0.0, -px] > > I used: > > x_scale = (src_extent[1] - src_extent[0]) / tiff_width > y_scale = (src_extent[3] - src_extent[2]) / tiff_height > raster_transform = [src_extent[0], x_scale, 0.0, src_extent[3], 0.0, > -y_scale] > > I'm not using the px variable at all. > > Should the answer be changed, or am I misunderstanding something? > > Thanks, > Simon > _______________________________________________ > gdal-dev mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/gdal-dev > _______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
