NetTopologySuite.IO.Esri icon indicating copy to clipboard operation
NetTopologySuite.IO.Esri copied to clipboard

GDBWriter and GDBReader classes removed?

Open oshawa-connection opened this issue 1 year ago • 6 comments

Hello, I see that this package is the continuation of this package

However I see that at some stage the GDBWriter and GDBReader classes were dropped.

Just wondering if there is a technical reason why they were dropped, and if you would accept PR's to create new versions of these classes?

oshawa-connection avatar Nov 02 '23 10:11 oshawa-connection

Thank you @oshawa-connection for submitting this issue. GDBWriter and GDBReader classes were removed during migration due to lack of GDB documentation. Can you elaborate about your use case for GDB classes? What data is read/written using those classes? Is there official documentation for GBD specification?

KubaSzostak avatar Jan 13 '24 21:01 KubaSzostak

Hi @KubaSzostak thanks for your reply.

AFAIK there is no documentation for the GDB format, only the reverse engineered implementations that are part of GDAL (OpenFileGDB) which looks like a crazy amount of work.

My use case is that users of my app need to download vector layers from our database. The layers are relatively large, and we want to stream the data. We can do this ok for some file formats, but now our users have asked for all our data to be in ESRI file GDBs.

I don't think its possible to stream data with the C# GDAL bindings, so I was looking for a pure C# implementation.

oshawa-connection avatar Jan 15 '24 11:01 oshawa-connection

On the one hand, I don't like the idea of implementing undocumented features. On the other hand, direct access to data saved in the Esri FileGDB format would be great. @oshawa-connection can you provide a working sample of GDBReader/GDBWriter classes?

KubaSzostak avatar Jan 28 '24 13:01 KubaSzostak

While fgdb might be out of the realm of possibilty as it's undocumented hows about mobile geodatabases? this is a somewhat documented format:: https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/manage-mobile-gdb/mobile-geodatabases.htm

It's basically a sqllite database table per feature class, with the geometry stored as a special esri binary format. I think this could be really useful to implement, as shapefiles are a lousy interchange format for anything complex (no handling for NULL, 2gb limits, no datetime etc).

mburbea avatar Aug 05 '24 18:08 mburbea

Thanks @mburbea for pointing that out! Still, there is no specification for binary representation of ST_Geometry. That what I have found for ST_Geometry in general:

As you can see the implementation details differ between PostgreSQL and Oracle. The SQLite implementation may be different than these. Therefore, I would personally prefer to use officially documented geometry access functions:

KubaSzostak avatar Aug 06 '24 07:08 KubaSzostak