NetTopologySuite / NetTopologySuite.IO.Esri

BSD 3-Clause "New" or "Revised" License
35 stars 18 forks source link

GDBWriter and GDBReader classes removed? #38

Open oshawa-connection opened 11 months ago

oshawa-connection commented 11 months ago

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?

KubaSzostak commented 8 months ago

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?

oshawa-connection commented 8 months ago

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.

KubaSzostak commented 8 months ago

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 commented 2 months ago

See also: NetTopologySuite.IO.ShapeFile/src/NetTopologySuite.IO.GDB

mburbea commented 2 months ago

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).

KubaSzostak commented 2 months ago

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: