[Qgis-user] Re: Batch conversion of rasters
giannis Nj
netsagief at hotmail.com
Fri May 18 02:34:10 PDT 2012
What I want is [1] and it becomes more complicated because the "Convert 1-band raster to 1-band paletted or 3-band RGB raster" plugin doesn't work with grayscale maps. Anyway, thanks for the answer.
>
> Hi,
>
> On 17.05.2012 11:52, giannis Nj wrote:
>
> > I want to convert
> a directory with .asc files to .tiffs, but I need the output files to
> have the same colour analysis, as when they are already loaded in qgis
> display. I try Raster->Conversion->Translate (Convert format) but it
> gives each file with different colours. Is there any other way to make
> it? Maybe a batch convert somehow after the files are loaded on
> screen?
>
> (1) Do you want to embed the colour table into the tiff files?
> Or
>
> (2) Do you want to carry over (keep) the 'true' values of the asc
> files in the tiff files?
>
> Answer for (2):
>
> If you want to keep the
> true values, then I suggest that you save a .qml file (raster properties
> -> Save Style...) for each .asc file displayed in QGIS (use the same
> filename as the asc file). Then, use the same file name for the tiff
> files as well, and put them in the same folder as the qml files and open
> them in QGIS.
>
> e.g. file1.asc -> file1.qml, then convert "file1.asc" to
> "file1.tiff" and make sure both .tiff and .qml files are in the same
> folder.
> When you load the .tiff file in QGIS it will also load the style
> from the .qml so that the .tiff and .asc files will display identically.
>
>
> Note: to save a full bunch of qml at once you can use the "Save
> default QML" plugin available from GIS-Lab repo at [0], or,
> alternatively, the "Save QML" plugin available from [2].
>
> Answer for
> (1): This is far more complicated!
>
> Two leads to possibly solve this
> problem:
>
> - Tim Sutton's blog about using GDAL to embed colour table in
> raster at [1].
>
> - Use the "One-band raster to paletted or RGB" plugin
> (V0.3.0) from this repo [2].
> See the help page at [3].
>
> Anyway, you
> will have to use scripting if you have many files to process.
>
> [0]:
> http://gis-lab.info/programs/qgis/qgis-repo.xml
> [1]:
> http://linfiniti.com/2011/12/creating-coloured-rasters-with-gdal/
> [2]:
> http://www.bc-consult.com/free/plugins.xml
> [3]:
> http://www.bc-consult.com/free/bccAddRColor.html
>
> HTH,
> Benoit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20120518/1329a0f0/attachment.html>
More information about the Qgis-user
mailing list