<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style="font-family: Tahoma, Arial, Helvetica, sans-serif; font-size: 12pt;"><div>Hi there,<br></div><div><br></div><div>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.<br></div><div><br></div><div><b>Here's the issue: </b><br></div><div><div>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: <code data-stringify-type="code" class="c-mrkdwn__code" style="box-sizing: inherit; --saf-0: rgba(29,28,29,.13); border-color: rgba(29, 28, 29, 0.13); border-style: solid; border-width: 0.666667px; border-image: none 100% / 1 / 0 stretch; background-color: rgba(29, 28, 29, 0.04); color: rgb(192, 19, 67); font-variant-ligatures: none; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 4; border-radius: 3px; padding: 2px 3px 1px; font-size: 12px; line-height: 1.50001; font-family: Monaco, Menlo, Consolas, "Courier New", monospace !important;"><span class="overFlow" style="overflow:hidden">ogrinfo: ./json_object.c:640: json_object_object_del: Assertion `json_object_get_type(jso) == json_type_object' failed.</span></code> <br></div><div><br></div><div><b style="box-sizing: inherit; font-weight: 700;" data-stringify-type="bold">Here's what I've done:</b><br></div></div><ol style="box-sizing: inherit; margin: 0px 0px 0px 20px; padding: 0px; list-style-type: decimal; margin-inline-start: 0px; padding-inline-start: 0px;" data-border="0" data-indent="0" class="p-rich_text_list p-rich_text_list__ordered p-rich_text_list--nested" data-list-tree="true" data-stringify-type="ordered-list"><li style="box-sizing: inherit; margin-bottom: 0px; list-style-type: unset; margin-inline-start: 20px; padding-inline-start: 8px;" data-stringify-border="0" data-stringify-indent="0">"manually" unzip and open [1,2] with QGIS and try ogrinfo-> Doesn't work<br></li><li style="box-sizing: inherit; margin-bottom: 0px; list-style-type: unset; margin-inline-start: 20px; padding-inline-start: 8px;" data-stringify-border="0" data-stringify-indent="0">Use Python to unzip and open with QGIS and try ogrinfo -> Doesn't work<br></li><li style="box-sizing: inherit; margin-bottom: 0px; list-style-type: unset; margin-inline-start: 20px; padding-inline-start: 8px;" data-stringify-border="0" data-stringify-indent="0">Use the zipped file and open with QGIS -> Works<br></li><li style="box-sizing: inherit; margin-bottom: 0px; list-style-type: unset; margin-inline-start: 20px; padding-inline-start: 8px;" data-stringify-border="0" data-stringify-indent="0">Use a similar data set [5], unzip and open with QGIS (works) then run ogrinfo on it (doesn't work, same error)<br></li><li style="box-sizing: inherit; margin-bottom: 0px; list-style-type: unset; margin-inline-start: 20px; padding-inline-start: 8px;" data-stringify-border="0" data-stringify-indent="0">Open with Fiona, works (but I would prefer to stick with ogrinfo)</li></ol><div style="box-sizing: inherit;" class="p-rich_text_section"><span style="box-sizing: inherit; height: 8px; display: block;" data-stringify-type="paragraph-break" class="c-mrkdwn__br" aria-label=""><br></span><div><br></div><div><b style="box-sizing: inherit; font-weight: 700;" data-stringify-type="bold">More details:</b><br></div><div>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).<br></div><span style="box-sizing: inherit; height: 8px; display: block;" data-stringify-type="paragraph-break" class="c-mrkdwn__br" aria-label=""><br></span><div>When I tried to open the unzipped file with QGIS I get:<span> </span><code style="box-sizing: inherit; --saf-0: rgba(29,28,29,.13); border-color: rgba(29, 28, 29, 0.13); border-style: solid; border-width: 0.666667px; border-image: none 100% / 1 / 0 stretch; background-color: rgba(29, 28, 29, 0.04); color: rgb(192, 19, 67); font-variant-ligatures: none; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 4; border-radius: 3px; padding: 2px 3px 1px; font-size: 12px; line-height: 1.50001; font-family: Monaco, Menlo, Consolas, "Courier New", monospace !important;" class="c-mrkdwn__code" data-stringify-type="code">Invalid Data Source: SAM_Master_Statewide_Database.gdb is not a valid or recognized data source. </code><span> </span>.<br></div><span style="box-sizing: inherit; height: 8px; display: block;" data-stringify-type="paragraph-break" class="c-mrkdwn__br" aria-label=""><br></span><div>When I use ogrinfo against it, it<span> </span><i style="box-sizing: inherit;" data-stringify-type="italic">mostly<span> </span></i>works:<br></div></div><pre style="box-sizing: inherit; margin: 4px 0px; padding: 8px; --saf-0: rgba(29,28,29,.13); border-color: rgba(29, 28, 29, 0.13); border-style: solid; border-width: 0.666667px; border-image: none 100% / 1 / 0 stretch; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(29, 28, 29, 0.04); font-variant-ligatures: none; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 4; border-radius: 4px; font-size: 12px; line-height: 1.50001; font-family: Monaco, Menlo, Consolas, "Courier New", monospace !important;" data-stringify-type="pre" class="c-mrkdwn__pre"><div style="box-sizing: inherit;" class="p-rich_text_block--no-overflow"><span class="overFlow" style="overflow:hidden">$ 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)</span><br></div></pre><div style="box-sizing: inherit;" class="p-rich_text_section">But when I try to get a JSON from it (the issue):<br></div><pre style="box-sizing: inherit; margin: 4px 0px; padding: 8px; --saf-0: rgba(29,28,29,.13); border-color: rgba(29, 28, 29, 0.13); border-style: solid; border-width: 0.666667px; border-image: none 100% / 1 / 0 stretch; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(29, 28, 29, 0.04); font-variant-ligatures: none; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 4; border-radius: 4px; font-size: 12px; line-height: 1.50001; font-family: Monaco, Menlo, Consolas, "Courier New", monospace !important;" data-stringify-type="pre" class="c-mrkdwn__pre"><div style="box-sizing: inherit;" class="p-rich_text_block--no-overflow"><span class="overFlow" style="overflow:hidden">$  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</span><br></div></pre><div style="box-sizing: inherit;" class="p-rich_text_section"><br></div><div style="box-sizing: inherit;" class="p-rich_text_section"><b>Version stuff:</b><br></div><div style="box-sizing: inherit;" class="p-rich_text_section">I'm on WSL:<br></div><pre class="c-mrkdwn__pre" data-stringify-type="pre" style="box-sizing: inherit; margin: 4px 0px; padding: 8px; --saf-0: rgba(29,28,29,.13); border-color: rgba(29, 28, 29, 0.13); border-style: solid; border-width: 0.666667px; border-image: none 100% / 1 / 0 stretch; background: none 0% 0% / auto repeat scroll padding-box border-box rgba(29, 28, 29, 0.04); font-variant-ligatures: none; white-space: pre-wrap; overflow-wrap: break-word; word-break: normal; tab-size: 4; border-radius: 4px; font-size: 12px; line-height: 1.50001; font-family: Monaco, Menlo, Consolas, "Courier New", monospace !important;"><div class="p-rich_text_block--no-overflow" style="box-sizing: inherit;"><span style="overflow:hidden" class="overFlow">$  </span>cat /etc/os-release <br></div><div class="p-rich_text_block--no-overflow" style="box-sizing: inherit;">PRETTY_NAME="Ubuntu 24.04.2 LTS"<br></div><div class="p-rich_text_block--no-overflow" style="box-sizing: inherit;">...<br></div><div class="p-rich_text_block--no-overflow" style="box-sizing: inherit;">$ ogrinfo --version <br></div><div class="p-rich_text_block--no-overflow" style="box-sizing: inherit;">GDAL 3.8.4, released 2024/02/08<br></div></pre><div><br></div><div>I have to stick to 24.04 so I can't install the latest gdal<br></div><div><br></div><div><br></div><div>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.<br></div><div><br></div><div>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.</div><div><br></div><div>Thank you for your time!<br></div><div><br></div><div>Best,<br></div><div>EJ</div><div><br></div><div><br></div><div><br></div><div>[1] <a target="_blank" href="https://gis.ny.gov/streets-addresses">https://gis.ny.gov/streets-addresses</a><br></div><div>[2] <a target="_blank" href="https://gisdata.ny.gov/GISData/State/Address_Points/SAM_Master_Statewide_Database.gdb.zip">https://gisdata.ny.gov/GISData/State/Address_Points/SAM_Master_Statewide_Database.gdb.zip</a><br></div><div>[3] <a target="_blank" href="https://gis.ny.gov/parcels">https://gis.ny.gov/parcels</a><br></div><div>[4] <a target="_blank" href="https://gisdata.ny.gov/GISData/State/Parcels/NYS-Tax-Parcels.zip">https://gisdata.ny.gov/GISData/State/Parcels/NYS-Tax-Parcels.zip</a> <br></div><div>[5] <a target="_blank" href="https://data.gis.ny.gov/datasets/dfa176b4cf284539812c05478dc028d2/about">https://data.gis.ny.gov/datasets/dfa176b4cf284539812c05478dc028d2/about</a><br></div></div><br></body></html>