New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Report hiearchical organization of vector layers #3762
Conversation
rouault
commented
Apr 29, 2021
- Add C++, C, SWIG API to explore hiearchical organization of vector layers
- Implement it in FileGDB and OpenFileGDB drivers
- Make "ogrinfo my.gdb" use that
7319601
to
d175b81
Compare
CC @nyalldawson |
Nice enhancement! |
One question -- if we add support in future for raster layers with a hierarchy, would we then add GDALGroupGetRasterLayerNames/ etc ? |
…and implement it in FileGDB/OpenFileGDB drivers Add GDALGroup::GetVectorLayerNames() and OpenVectorLayer(), and corresponding C and SWIG API Fixes https://trac.osgeo.org/gdal/ticket/5752
``` $ ogrinfo ../autotest/ogr/data/filegdb/featuredataset.gdb INFO: Open of `../autotest/ogr/data/filegdb/featuredataset.gdb' using driver `OpenFileGDB' successful. Layer: standalone (Point) Group fd1: Layer: fd1_lyr1 (Point) Layer: fd1_lyr2 (Point) Group fd2: Layer: fd2_lyr (Point) ```
d175b81
to
bee464d
Compare
good question. For the very few drivers that support the multidimensional raster API, there is GDALGroupOpenMDArray() which returns a GDALMDArray which is a sort-of generalization of a GDALDataset to multidimensional (most things have an equivalent, but not always in a straightforward way). This is used for netCDF, HDF4, HDF5 and GRIB (and Zarr at some point). Hiearchical netCDF and HDF5 are represented like that. I can't really think of formats that would be 2D only and have a hierarchical organization, except some formulations of KML. Or possibly GeoPackage by adding an extension that would describe hiearchy. |
Even, this is massive! Thanks so much for this! |
@Saijin-Naib |
Fair enough. I tried experimenting to see if it's supported in gdb, but couldn't find any way to do this (see comment above), so I suspect it's not supported in geodatabases either. |
So, in FileGeoDataBase land, you want a Raster stored in a Feature Class? I think Feature Class can only hold vector, but there is the concept of Raster Catalogs, which may be a similar hierarchical structure in FileGeoDataBase. Don't let me go more than Wednesday without giving you data and answers. |
I believe they are closer in concept to a multidimensional raster array (mentioned earlier in this thread), but I've never used one personally to know for sure |
GitHub_Test.gdb.zip I created a Raster Catalog, which doesn't allow for any hierarchical organization within itself, but it does present itself as a branch in the hierarchy of the FileGeoDataBase. |
Hand-opening the .gdbtable file corresponding to the raster catalog, one can see a flat list of a few raster in it:
Anyway, raster-in-gdb is something for later... |
Hey @Saijin-Naib what is "parcel_fabric_test"? Is that some special kind of layer? |
Yeah, it's one of the number of special data types that can be stored only in Feature Dataset. If wanted, I'd like to enumerate a test dataset full of those special types. I included it here since it also presents itself as a branch in the hierarchical organization of the FileGeoDataBase |
A "DECadastralFabric":
Interestingly the layers that in the screenshop appear under it have a path like \Feature_Dataset_Test\Parcel_Fabric_Test_Control , which is at the same level as the Parcel_Fabric_Test (\Feature_Dataset_Test\Parcel_Fabric_Test). I guess that ArcMap has a logic based on the fact that \Feature_Dataset_Test\Parcel_Fabric_Test is a prefix of the path of those layers. |