Opened 4 years ago

Closed 2 years ago

#7008 closed enhancement (wontfix)

Let's make ArcGIS geodatabases rasters a thing!

Reported by: rbarnes Owned by: warmerdam
Priority: normal Milestone: closed_because_of_github_migration
Component: default Version: unspecified
Severity: normal Keywords: esri, arcgis, geodatabase
Cc: Even Rouault, Robert Coup


I'd like to be able to read ArcGIS Raster Geodatabases from within GDAL.

Based on some previous work by Even Roualt and James Ramm, I have a working program to extract data and projections into GeoTIFFs available here:

There are still a few things to figure out, but this is functional enough that it may be useful to people and, since I don't have access to a large set of geodatabases, it's difficult to for me to get ahold of the exotic examples which would help flesh it out. There are also some things we may never know about the format because they are not used in the wild, so perhaps everything is already working! For this reason, I think it would be useful to build this into GDAL, and I'm willing to give it a shot.

However, I'm not entirely sure how to proceed.

Since there are commonalities with the OGR OpenFileGDB plug-in, I could copy that code wholesale and make the necessary modifications, though this seems wasteful.

I could also modify the existing code, but then the plugin would be for both GDAL and OGR, which seems to break the separation between the two that I see in the source.

If you have thoughts about what is best, let's talk about it.

Change History (7)

comment:1 Changed 4 years ago by rbarnes

This was originally posted to gdal-dev, where Even Rouault replied:

Hi Richard, That's great!

Even if it doesn't cover all cases, we can start with what you've already figured out and add/fix things later.

This separation [between OGR/GDAL drivers] is historic, and we now have drivers that have both raster and vector capabilities, e.g. the GeoPackage one

So I think the raster side of the driver could/should be added within the existing driver. You would benefit from the low-level lib implemented in filegdbtable.cpp (would probably need some tweaking to deal with the raster tables), instead of redevelopping it as you seemed to have done in your prototype. I can imagine raster tables would be exposed as GDAL subdatasets and you would open them with "OPENFILEGDB:my.gdb:rastername"

We can also perhaps create a dedicated Trac ticket for further discussions on this so interested parties can follow.


comment:2 Changed 4 years ago by rbarnes


Are alterations needed to convert a driver from OGR-only (the existing OpenFileGDB driver) into raster+vector (e.g. GeoPackage)?

I'll look at filegdbtable.cpp sometime in the next day or so and see if I can figure out how to modify it to recognize rasters.

comment:3 Changed 4 years ago by Even Rouault

Cc: Even Rouault added

Are alterations needed to convert a driver from OGR-only (the existing OpenFileGDB driver) into raster+vector (e.g. GeoPackage)?

Nothing fundamental in the structure. You need to add poDriver->SetMetadataItem?( GDAL_DCAP_RASTER, "YES" ); and then set/implement raster related methods.

On particular aspect of drivers with both raster&vector capabilities is to take into account poOpenInfo->nOpenFlags. If GDAL_OF_RASTER is set and not GDAL_OF_VECTOR (typically the case of opening with gdalinfo/gdal_translate), then you must return a NULL dataset at open time if there's no raster. And if there are raster table, you must not expose vectors. And the reverse situation (when opening with ogrinfo/ogr2ogr). If both are defined, you can return a valid dataset as soon as there's at least one vector or one raster table.

comment:4 Changed 4 years ago by rbarnes

Good to know.

Are the "raster related methods" obvious if I look at the source of, e.g., GeoPackage or AAIGrid? Are they listed anywhere?

comment:5 Changed 4 years ago by Even Rouault

You may want to study . The GeoPackage driver is quite complex. The AAIGRID one will be easier to follow

Here's a random example of how to expose subdatasets :

comment:6 Changed 4 years ago by Robert Coup

Cc: Robert Coup added

comment:7 Changed 2 years ago by Even Rouault

Milestone: closed_because_of_github_migration
Resolution: wontfix
Status: newclosed

This ticket has been automatically closed because Trac is no longer used for GDAL bug tracking, since the project has migrated to GitHub?. If you believe this ticket is still valid, you may file it to if it is not already reported there.

Note: See TracTickets for help on using tickets.