[gdal-dev] Rendering/rasterizing GeoPackage vector to grayscale

2023-04-13 Thread Martin Häggström
Hello all, I am trying to read vector GeoPackage files in order to render a custom map suitable to display on a 3bpp e-ink screen (8 grayscales per pixel). I am a complete noob in anything related to GIS and mapping and all terminology, but I have managed to use GDALRasterizeLayers to burn

Re: [gdal-dev] Java-GDAL binding:How to convert gdal dataset to byte array

2023-04-13 Thread Laurențiu Nicola via gdal-dev
Hi, VSIUnlink is https://gdal.org/java/org/gdal/gdal/gdal.html#Unlink(java.lang.String), but I can't find VSIGetMemFileBuffer or VSIFOpenEx2L and VSIFReadL, which you could use instead. FileFromMemBuffer is there, but it goes in the wrong direction. So sorry, I have no idea. I've never used

Re: [gdal-dev] Intermittent failure with Python mocks

2023-04-13 Thread Sean Gillies
Hi Jon, The number one gotcha with patching is documented here https://docs.python.org/3/library/unittest.mock.html#where-to-patch. In a nutshell, you have to patch your own module. I see you're patching gdal in your tests. Patching gdal from your test doesn't do anything, it's too late. Hope

[gdal-dev] Intermittent failure with Python mocks

2023-04-13 Thread Jon Morris
I'm getting intermittent fails with our Python unit tests and I wondered if anyone has seen the same issue. I think it's a race condition where a mock patch is either not applied at all or maybe applied too slowly so the patched function still has its original return value. It might be a pytest

Re: [gdal-dev] Java-GDAL binding:How to convert gdal dataset to byte array

2023-04-13 Thread Laurențiu Nicola via gdal-dev
Hi, I don't think ReadAsArray is the API you're looking for. If you do that, you'll end up with a buffer of pixel values, not with a proper TIFF or PNG tile. Instead, you can either use the MEM driver or the /vsimem/ prefix (like in

Re: [gdal-dev] VRT file: Recursion detected

2023-04-13 Thread Ari Jolma
Even Rouault kirjoitti 13.4.2023 klo 12.44: Le 13/04/2023 à 11:02, Laurențiu Nicola via gdal-dev a écrit : Hi, Just a guess, but maybe your VRT is including itself? That's indeed the purpose of this check (or detecting a VRT A including a VRT B including a VRT A, etc.). But the check is a

Re: [gdal-dev] VRT file: Recursion detected

2023-04-13 Thread Even Rouault
Le 13/04/2023 à 11:02, Laurențiu Nicola via gdal-dev a écrit : Hi, Just a guess, but maybe your VRT is including itself? That's indeed the purpose of this check (or detecting a VRT A including a VRT B including a VRT A, etc.). But the check is a bit tricky, and that might be just a bug in

Re: [gdal-dev] VRT file: Recursion detected

2023-04-13 Thread Laurențiu Nicola via gdal-dev
Hi, Just a guess, but maybe your VRT is including itself? Laurentiu On Thu, Apr 13, 2023, at 11:45, Ari Jolma wrote: > What can cause "Recursion detected" error when opening a VRT-file? > > Is there something I can do in gdal.BuildVRT (I'm using gdal python > bindings) to avoid that? > > Ari >

[gdal-dev] VRT file: Recursion detected

2023-04-13 Thread Ari Jolma
What can cause "Recursion detected" error when opening a VRT-file? Is there something I can do in gdal.BuildVRT (I'm using gdal python bindings) to avoid that? Ari ___ gdal-dev mailing list gdal-dev@lists.osgeo.org