[gdal-dev] Assertion json_type_object failed on gdb

Emanuel Jaimes ej at emjames.com
Tue Jul 22 13:11:25 PDT 2025


Hi there,



I was hoping to get some guidance on where I need to look/read or what other options I could use to extract a JSON from a GDB.



Here's the issue: 

For some reason, when I unzip an archive that has a GDB, `ogrinfo` doesn't produce the JSON with metadata (what columns, types, layers and spatial columns it has). When I run ogrinfo I get: ogrinfo: ./json_object.c:640: json_object_object_del: Assertion `json_object_get_type(jso) == json_type_object' failed. 



Here's what I've done:


"manually" unzip and open [1,2] with QGIS and try ogrinfo-> Doesn't work

Use Python to unzip and open with QGIS and try ogrinfo -> Doesn't work

Use the zipped file and open with QGIS -> Works

Use a similar data set [5], unzip and open with QGIS (works) then run ogrinfo on it (doesn't work, same error)

Open with Fiona, works (but I would prefer to stick with ogrinfo)




More details:

I thought it could be an ogrinfo version thing so I tried a different data set [3, 4] (NYS tax parcel data) and it worked as expected (I'm able to get a JSON).


When I tried to open the unzipped file with QGIS I get: Invalid Data Source: SAM_Master_Statewide_Database.gdb is not a valid or recognized data source.  .


When I use ogrinfo against it, it mostly works:


$ ogrinfo ../Data/SAM-Address/SAM_Master_Statewide_Database.gdb -so
INFO: Open of `../Data/SAM-Address/SAM_Master_Statewide_Database.gdb'
      using driver `OpenFileGDB' successful.
Layer: AddressPoints_SAM (Point)


But when I try to get a JSON from it (the issue):

$  ogrinfo ../Data/SAM-Address/SAM_Master_Statewide_Database.gdb -so -json
ogrinfo: ./json_object.c:640: json_object_object_del: Assertion `json_object_get_type(jso) == json_type_object' failed.
[1]    240230 IOT instruction (core dumped)  ogrinfo ../Data/SAM-Address/SAM_Master_Statewide_Database.gdb -so -json




Version stuff:

I'm on WSL:

$  cat /etc/os-release 

PRETTY_NAME="Ubuntu 24.04.2 LTS"

...

$ ogrinfo --version 

GDAL 3.8.4, released 2024/02/08




I have to stick to 24.04 so I can't install the latest gdal





Does anyone have thoughts on how I should proceed? What could I try? I went through the manual but nothing really pops, perhaps using the summary but without -json is an option but that just adds more code paths to my project.



I would be happy to contribute but I don't know where to look nor how to make a smaller test to reproduce the issue. Any pointers are appreciated.


Thank you for your time!



Best,

EJ






[1]  https://gis.ny.gov/streets-addresses 

[2]  https://gisdata.ny.gov/GISData/State/Address_Points/SAM_Master_Statewide_Database.gdb.zip 

[3]  https://gis.ny.gov/parcels 

[4]  https://gisdata.ny.gov/GISData/State/Parcels/NYS-Tax-Parcels.zip  

[5]  https://data.gis.ny.gov/datasets/dfa176b4cf284539812c05478dc028d2/about
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20250722/5762e784/attachment.htm>


More information about the gdal-dev mailing list