<div dir="ltr"><div><div><div><div>Hi Andreas:<br><br></div>It is solved: you have to reproject your TEMP layer. I've tried with UTM-32N zone and raster calculator works fine.<br><br>Why raster calculator (and SAGA) doesn't work with your original CRS? Well, I don't know, perhaps devs group have the answer.<br><br>It was a good challenge.<br><br></div></div></div>Carlos<br></div><div class="gmail_extra"><br><div class="gmail_quote">2014-11-18 4:37 GMT-05:00 Andreas Neumann <span dir="ltr"><<a href="mailto:a.neumann@carto.net" target="_blank">a.neumann@carto.net</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Carlos,<br>
<br>
Thank you for your help!<br>
<br>
I tried with<br>
<br>
(TEMP@1=249)*255 + (TEMP@1<249)*TEMP@1 + (TEMP@1>249)*TEMP@1<br>
<br>
My layer is called "temp". However, the resulting file contains all 0.<br>
<br>
I tried in both QGIS 2.4 and 2.6.<br>
<br>
Is there something wrong with the input file? It was generated from a PDF with ghostscript. Here is the metadata:<br>
<br>
-----<br>
<br>
GDAL provider<br>
GTiff<br>
GeoTIFF<br>
Datensatzbeschreibung<br>
//gis/gis/mapserverdata/uep/<u></u>release_2014_11/temp.tif<br>
TIFFTAG_DATETIME=2014:11:17 09:50:08<br>
TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch)<br>
TIFFTAG_SOFTWARE=GPL Ghostscript 9.10<br>
TIFFTAG_XRESOLUTION=600<br>
TIFFTAG_YRESOLUTION=600<br>
Kanal 1<br>
STATISTICS_MAXIMUM=255<br>
STATISTICS_MEAN=247.<u></u>18714741724<br>
STATISTICS_MINIMUM=0<br>
STATISTICS_STDDEV=37.<u></u>198102288306<br>
Dimensionen<br>
X: 71575 Y: 70867 Kanäle: 1<br>
Leerwert<br>
*Leerwert nicht gesetzt*<br>
Datentyp<br>
Byte - Acht Bit vorzeichenlose Ganzzahl<br>
Pyramidenübersichten<br>
Räumliches Bezugssystem des Layers<br>
+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=600000 +y_0=200000 +ellps=bessel +towgs84=674.4,15.1,405.3,0,0,<u></u>0,0 +units=m +no_defs<br>
Layerausdehnung (in urspünglicher Projektion des Layers)<br>
0.0000000000000000,-70867.<u></u>0000000000000000 : 71575.0000000000000000,0.<u></u>0000000000000000<br>
Kanal<br>
Kanal 1<br>
Kanal Nr<br>
1<br>
Keine Statistik<br>
Noch keine Statistik gesammelt<br>
<br>
------------<br>
<br>
Thanks again if you have any idea what may be wrong with my file or the above listed raster calc statement.<br>
<br>
Andreas<br>
<br>
<br>
<br>
Am 2014-11-17 18:38, schrieb Carlos Cerdán:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hi Andreas:<br>
<br>
I think QGIS raster calculator can make this job. Conditional syntax<br>
is a little bit... different. The sentence that can do it is:<br>
<br>
(TIFF=249)*255 + (TIFF<249)*TIFF + (TIFF>249)*TIFF<br>
<br>
Where TIFF is your raster layer. The trick is: if the sentence in<br>
parentheses is true, it gets value 1, else zero; so we have to<br>
multiply by 255 to replace the 249 values. Next we have to add the<br>
other values.<br>
<br>
Good luck,<br>
<br>
Carlos Cerdán<br>
<br>
PD. Please let me know if i'm wrong with this suggestion<br>
<br>
2014-11-17 12:02 GMT-05:00 Andreas Neumann <<a href="mailto:a.neumann@carto.net" target="_blank">a.neumann@carto.net</a>>:<br>
<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hi,<br>
<br>
I have a very simple task (at least I thought it is simple), but am<br>
not able to do it properly.<br>
<br>
I have a grayscale tiff value where I would like to replace the<br>
value of 249 with 255 - all other values should stay as they are.<br>
<br>
I tried with gdal "nearblack", but nothing changed - I started a<br>
separate email-thread about that at the gdal list.<br>
<br>
Then I tried with the QGIS raster calculator - but it does not<br>
support conditional syntax.<br>
<br>
I tried with Processing and GRASS - but it would stop at 8% - the<br>
file is quite big.<br>
<br>
Finally I came across SAGA "Reclassify with grid value". The<br>
dialogue is very complicated and hard to understand. After a while<br>
it would stop with an error message telling me that Saga may not be<br>
properly configured - but it says that it is properly installed.<br>
Quite confusing ...<br>
<br>
I am trying on Win7 64bit.<br>
<br>
If the file wouldn't be so big I would try this task in The Gimp -<br>
where it is very simple to replace one pixel values with another -<br>
using "Select by color" and "fill with a specific color".<br>
<br>
Any idea how I could achieve my task with GDAL, QGIS, GRASS or<br>
Saga?<br>
<br>
Thanks,<br>
Andreas<br>
<br>
______________________________<u></u>_________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
</div></div><a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/qgis-user</a> [1]<br>
</blockquote>
<br>
<br>
<br>
Links:<br>
------<br>
[1] <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/qgis-user</a><span class=""><br>
<br>
______________________________<u></u>_________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/qgis-user</a><br>
</span></blockquote><div class="HOEnZb"><div class="h5">
______________________________<u></u>_________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/qgis-user</a></div></div></blockquote></div><br></div>