-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
raster export with non-usual RGB values #168
Comments
So to handle this, we need to do two things:
|
1 is rasterlayer.rasterType(), which returns: GrayOrUndefined |
I'll close #133 and paste the last comment here as this one is vital:
|
there seems no easy way to save a raster as rendered via the API ATM. I added a hint in the instruction to do this by hand. |
I wonder if Nathan's qgis2img achieves this: https://github.com/DMS-Aus/qgis2img |
I also got an answer on StackExchange: Is this compatible with the new raster code? |
The proposed solution will work. will do this this week! Geolicious GbR Riccardo Klinger mobil: 0176 63437298 Geolicious GbR Gesellschafter: Sitz der Gesellschaft: Berlin On Mon, Apr 20, 2015 at 10:56 AM, Tom Chadwin notifications@github.com
|
I have received a tiff file with DEM-values (file: https://www.dropbox.com/s/adfa62i6rcbhd9w/mdt_clipped.tif?dl=0) which are more or less higher than 255... when it exports it treats each value as RGB-values which results in this:
when saved as a new file with check "save as shown" and exported using the plugin it shows well on the screen:
this alsco counts for values below 1 in the raster image and non-integer values.
the line that does the storage is:
if str(i.dataProvider().metadata()[0:4]) == 'JPEG' and str(i.crs().authid()) == 'EPSG:4326':
shutil.copyfile(in_raster+".aux.xml", out_raster + ".aux.xml")
shutil.copyfile(in_raster, out_raster)
else:
processing.runalg("gdalogr:warpreproject",str(in_raster),str(i.crs().authid()),"EPSG:4326",0,1,"",prov_raster)
format = "jpeg"
driver = gdal.GetDriverByName( format )
src_ds = gdal.Open(prov_raster)
dst_ds = driver.CreateCopy( out_raster, src_ds, 0 )
dst_ds = None #free the dataset
src_ds = None #free the dataset
The text was updated successfully, but these errors were encountered: