Python script to dump the content of a .gdbtable according to the reverse engineered FileGDB specification
rouault / dump_gdbtable Goto Github PK
View Code? Open in Web Editor NEWPython script to dump the content of a .gdbtable
Python script to dump the content of a .gdbtable
Python script to dump the content of a .gdbtable according to the reverse engineered FileGDB specification
It might be useful for the spec to list parts of the FGDB which have not been reverse engineered.
For example a00000004.horizon
. This file is often (always?) present but does not serve any obvious function (meaning: deleting it seems to have no deleterious effect and they are automatically recreated whenever the f-gdb is opened by ArcGIS).
https://gis.stackexchange.com/questions/413875/what-is-function-of-horizon-files-in-file-geodatabase
In one dump I have to make it would be better to grab directly the uuid correctly formatted
Here how I've done it.
diff --git i/dump_gdbtable.py w/dump_gdbtable.py
index ab00ac1..36137dd 100644
--- i/dump_gdbtable.py
+++ w/dump_gdbtable.py
@@ -34,6 +34,7 @@
import struct
import sys
+import uuid
if len(sys.argv) != 2:
print('Usage: dump_gdbtable.py some_file.gdbtable')
@@ -590,7 +591,7 @@ for fid in range(nfeaturesx):
elif fields[ifield].type == 10 or fields[ifield].type == 11:
val = f.read(16)
- print('Field %s : "%s"' % (fields[ifield].name, ''.join(x.encode('hex') for x in val)))
+ print('Field %s : "%s"' % (fields[ifield].name, uuid.UUID(bytes=val)))
elif fields[ifield].type == 7:
geom_len = read_varuint(f)
Hi there,
I have been using the excellent ogr2ogr gdb extension, but I found a database that it can't open, the Washington state soils database downloads (both statewide and per-county):
https://fortress.wa.gov/dnr/app1/dataweb/dmmatrix.html#Soils
Note that I found geometry problems even after opening in ESRI and exporting to shapefile and playing with that using ogr2ogr.
Not sure where else to post this, will also post to the GDAL trac site.
Thanks!
feature number 29863 (as in if you change this line to for fid in [29863]:
) in this gdb file has something up with it's geometry type in both our versions
getting errors when I try this GDB on both our tools
Thanks for this code. I was using it to troubleshoot an fgdb and modified line 740 to get it to work in python 3
Replaced
print('Field %s : "%s"' % (fields[ifield].name, ''.join(x.encode('hex') for x in val)))
with
print('Field %s : "%s"' % (fields[ifield].name, ''.join(bytes.hex(val))))
dump_gdbtable/dump_gdbtable.py
Line 740 in ad881a4
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.