[gdal-dev] ogr.VectorTranslate to json appears to be incomplete

Even Rouault even.rouault at spatialys.com
Fri May 26 10:48:05 PDT 2023


Le 26/05/2023 à 19:40, Laurențiu Nicola via gdal-dev a écrit :
> It's a bit strange, I can reproduce it when pasting into the REPL, but not when running from a file.

yes, the issue must come from the fact that gdal.VectorTranslate() 
returns a gdal.Dataset handle that is still active, and you could 
potentially add new features to it, hence the closing "] }" are emitted 
just when it is closed. In an interactive shell, for some reason the 
gdal.Dataset handle is not immediately closed when 
gdal.VectorTranslate() returns.

A safer way would be to explicitly do:

out_ds = gdal.VectorTranslate(...)

del out_ds

before getting the file content

>
> Laurentiu
>
> On Fri, May 26, 2023, at 20:27, Michael Smith wrote:
>> Well, a new install of gdal from conda-forge and now it works fine.
>> Sorry for the noise.
>>
>> Mike
>>
>>
>> -- 
>>
>> Michael Smith
>> Remote Sensing/GIS Center
>> US Army Corps of Engineers
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.



More information about the gdal-dev mailing list