[Qgis-developer] Query building for rasters, too
Mark Coletti
mcoletti at lychnobite.org
Fri Apr 20 14:44:26 EDT 2007
On Wed, Apr 18, 2007 at 08:35:04PM +0100, Barry Rowlingson wrote:
> >One of the great new features is the ability to create entirely new
> >vector layers from existing ones based on certain criteria. I was
> >surprised that there didn't exist similar functionality for rasters.
> >E. g., it should be possible to create a new raster layer containing
> >specific themal values from an existing one that had categorized pixel
> >values [...]
>
> Have you seen my RasterAlgebra plugin?
>
> http://www.maths.lancs.ac.uk/~rowlings/Software/RasterAlgebra/
> I knocked it up pretty quickly in order to play with QtDesigner and
> python plugins. It only does simple algebra, but the code might serve as
> a useful starting point for any other raster processing.
It sounds exactly like the functionality I'm looking for.
Unfortunately this happens when I apply it to a simple USGS DEM:
An error has occured while executing Python code:
Traceback (most recent call last):
File "/home/mcoletti/share/qgis/python/plugins/rasteralgebra/rasteralgebra.py", line 90, in run
rastercompute.createRaster(a.ui.outFileName.text(),formula)
File "/home/mcoletti/share/qgis/python/plugins/rasteralgebra/rastercompute.py", line 120, in createRaster
writeGeoTiff(result, extent, str(filePath))
File "/home/mcoletti/share/qgis/python/plugins/rasteralgebra/rasterutils.py", line 92, in writeGeoTiff
dst_ds.SetGeoTransform( [
AttributeError: 'NoneType' object has no attribute 'SetGeoTransform'
I haven't RTFS, so I dunno if the problem is maybe that it is hard
coded to expect all rasters to be GeoTIFFs.
I was thinking that a more powerful implementation would be to have
the GUI set up the variables and then let the user enter the body of
a freeform python lambda function with those variables that would be
used as a kind of raster filter. Admittedly this is just an
inchoate idea.
Meanwhile, I'll poke through the python source to see if I can get
it to play nicely with the USGS DEM.
Cheers,
Mark
More information about the Qgis-developer
mailing list