Hi,
I want to set an image PNG background to transparent. I do using gdalwarp,
but the image flips horizontally.
I am using a workaround, executing the gdalwarp command twice to flip back.
Can I set the background to transparent using just one command without flip
?
IMAGE ORIGINAL:
Hi,
Third approach, convert the image into VRT format into a temporary directory
and both the SRS and statistics will go into the VRT file:
gdal_translate -of VRT -stats input.tif \temp_dir\for_metadata.vrt.
I guess that the temp_dir can be in memory if it feels good.
-Jukka Rahkonen-
Another more common way to address the problem is to perform a log
transform on the image see
https://theailearner.com/2019/01/01/log-transformation/
I am not aware of any ootb log transform libraries. That link above does
show how to do it in OpenCV and numpy. I would probably use Pillow my self
Hi,
Another approach, also involving a copy, is to read the raster data as
numpy arrays and compute the statistics of those arrays. The GDAL method
also has to read the raster data to compute statistics, of course, but
doesn't store the entirety of it in memory.
On Mon, Oct 10, 2022, 6:51 AM
Hi Mats,
This won't help you, but I wanted to suggest you make a temporary directory,
copy the .aux.xml file there, then set GDAL_PAM_PROXY_DIR. Unfortunately, at
least in my test, GDAL still seems to save the file next to the input, even
when calling SetConfigOption before doing anything
Hello!
I'm writing a Python program which reads raster data. The program uses the
ComputeStatistics() function on the dataset, which automatically attempts to
write the result to an .aux.xml next to the raster file. I do not under any
circumstance want to try to write to the source directory,
Hi,
I tried first only with gdalinfo. Now I tried Python (v. 3.9 with GDAL 3.4.1
from OSGeo4W) and for me the script stops into another error
ERROR 4:
(To follow my own advice, I've tried with a fresh environment with GDAL
3.4.1 and Python 3.9!)
On Mon, 10 Oct 2022 at 09:02, Daniel Evans
wrote:
> Hi Jukka,
>
> Can you, or the original poster, give some more information on what Python
> and GDAL versions you're using that cause trouble? I've
Hi Jukka,
Can you, or the original poster, give some more information on what Python
and GDAL versions you're using that cause trouble? I've not immediately hit
404 errors on trying - with CPL_DEBUG=ON, I can see GDAL successfully
opening tiles (HTTP 206).
With something like 13,000 tiles in a
Hi all,
I'm still tinkering on my
automatic-download-satellite-data-and-create-images-from-my-area scripts
and I was wondering if anybody could help me out or point me to some math.
I'm currently using percentiles in a little Python script to compress
the contrast of my images. The result
Hi,
See this question
https://gis.stackexchange.com/questions/442512/python3-download-soilgrid-http-error
where the user is obviously trying to use the code from
https://git.wur.nl/isric/soilgrids/soilgrids.notebooks/-/blob/master/markdown/webdav_from_Python.md.
The tutorial is well written
11 matches
Mail list logo