Re: [gdal-dev] Python RasterizeLayer and gdal_rasterize

2019-07-24 Thread Ivan Lucena
Mike Taves Sent: Wednesday, July 24, 2019 4:40 PM To: Ivan Lucena Cc: gdal-dev@lists.osgeo.org Subject: Re: [gdal-dev] Python RasterizeLayer and gdal_rasterize On Thu, 25 Jul 2019 at 01:19, Ivan Lucena wrote: > mem_ds.SetGeoTransform((xmin, xResolut, 0, ymax, 0, yResolut,)) Check yo

Re: [gdal-dev] Python RasterizeLayer and gdal_rasterize

2019-07-24 Thread Mike Taves
On Thu, 25 Jul 2019 at 01:19, Ivan Lucena wrote: > mem_ds.SetGeoTransform((xmin, xResolut, 0, ymax, 0, yResolut,)) Check your value for yResolut, as it should be negative. In my experience, a raster full of zeros is when the geometry is outside the raster window, so be sure to manually ch

Re: [gdal-dev] Python RasterizeLayer and gdal_rasterize

2019-07-24 Thread Kai Mühlbauer
_ >From: Even Rouault >Sent: Wednesday, July 24, 2019 10:57 AM >To: gdal-dev@lists.osgeo.org >Cc: Ivan Lucena >Subject: Re: [gdal-dev] Python RasterizeLayer and gdal_rasterize > >Ivan, > >what comes to mind is a SRS mismatch issue. From what I can see >gd

Re: [gdal-dev] Python RasterizeLayer and gdal_rasterize

2019-07-24 Thread Ivan Lucena
sformation operation to fix the problem. I am going to work on that. Thank you again so very much, Ivan From: Even Rouault Sent: Wednesday, July 24, 2019 10:57 AM To: gdal-dev@lists.osgeo.org Cc: Ivan Lucena Subject: Re: [gdal-dev] Python Rasteriz

Re: [gdal-dev] Python RasterizeLayer and gdal_rasterize

2019-07-24 Thread Even Rouault
Ivan, what comes to mind is a SRS mismatch issue. From what I can see gdal.RasterizeLayer() takes a pfnTransformer / pTransformArg for that, but I'm not sure if they are probably mapped to SWIG to something practical. You might try instead with the gdal.Rasterize() "utility as a C function" tha

Re: [gdal-dev] Python RasterizeLayer and gdal_rasterize

2019-07-24 Thread Kai Muehlbauer
Hi Ivan, I'm doing something similar in my application. I remember that there were some issues with all black images, but I do not recall the details. One thing, though, from comparing your snipped with my code, I'm explicitely flushing the rasterband of the target dataset: band = mem_ds.GetRast

[gdal-dev] Python RasterizeLayer and gdal_rasterize

2019-07-24 Thread Ivan Lucena
Hi there, I am having a problem with gdal.RasterizeLayer() in Python. I look at the documentation and code example in forums and tutorial but I can't find a solution to my problem. My code is supposed to loops thru a shape files, with countries for example, and create a boolean image of each c