Skip to content
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

[FEATURE] OpenFileGDB: add creation/update capabilities #5910

Merged
merged 13 commits into from
Jun 21, 2022

Conversation

rouault
Copy link
Member

@rouault rouault commented Jun 10, 2022

Same functional scope as write side of the FileGDB driver:

  • Create new database
  • Update existing database
  • Add / rename / delete layers
  • Add fields, including to existing non-empty layers
  • Alter / delete fields
  • Add / update / delete features
  • Spatial index creation / update
  • Attribute index creation / update
  • Create / update / delete field domains
  • 'Emulated' transaction support
  • Same layer creation options as FileGDB driver
  • FileGDB v10 format only

Interoperability tested with ArcGIS Pro 2.8.3

Funded by Provincie Zuid-Holland, Provincie Gelderland and Gemeente Amsterdam

@rouault rouault added this to the 3.6.0 milestone Jun 10, 2022
@rouault rouault force-pushed the openfilegdb_write branch 3 times, most recently from 4107cb4 to 1ce3b88 Compare June 10, 2022 19:33
rouault added 4 commits June 10, 2022 21:57
Same functional scope as write side of the FileGDB driver:
- Create new database
- Update existing database
- Add / rename / delete layers
- Add fields, including to existing non-empty layers
- Alter / delete fields
- Add / update / delete features
- Spatial index creation / update
- Attribute index creation / update
- Create / update / delete field domains
- 'Emulated' transaction support
- Same layer creation options as FileGDB driver
- FileGDB v10 format only

Funded by Provincie Zuid-Holland, Provincie Gelderland and Gemeente Amsterdam
@palmerj
Copy link
Contributor

palmerj commented Jun 11, 2022

@rouault this is fantastic news, and well done to Provincie Zuid-Holland, Provincie Gelderland and Gemeente Amsterdam!

Is there a docker build to test this?

@rouault
Copy link
Member Author

rouault commented Jun 11, 2022

Is there a docker build to test this?

I just generated one with:
./docker/alpine-normal/build.sh --tag openfilegdb_write --gdal openfilegdb_write --gdal-repository rouault/gdal

Available with docker pull rouault/gdal:alpine-normal-openfilegdb_write

pBrokendowntime->tm_hour = psField->Date.Hour;
pBrokendowntime->tm_min = psField->Date.Minute;
pBrokendowntime->tm_sec = static_cast<int>(psField->Date.Second);
if( STARTS_WITH_CI(osExpression.c_str(), "LOWER(") && osExpression.back() == ')' )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the intention to expand this in future with other functions? Or is only "lower" supported for the index use?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what is supported. I've just noticed that this was used for a few system tables, e.g a00000001.gdbindexes has a "LOWER(Name)" expression for index TablesByName (a00000001.TablesByName.atx)

eFieldType == FGFT_DATETIME )
{
CreateAttributeIndex(poIndex.get());
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potentially a warning should be raised here? (Might be hittable if an existing gdb created in esri* is modified and contains a previously unsupported index type)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we need a warning. Esri software seems robust to the absence of an index

ogr/ogrsf_frmts/openfilegdb/ogropenfilegdbdatasource.cpp Outdated Show resolved Hide resolved
doc/source/drivers/vector/openfilegdb.rst Outdated Show resolved Hide resolved
@nyalldawson
Copy link
Collaborator

Fantastic effort @rouault -- the importance of this cannot be understated 💯

@Hsxxxxxx
Copy link

@rouault This is a great feature, thank you very much for your efforts! Is it possible to support arm64(because Filegdb does not support arm64)?

@rouault
Copy link
Member Author

rouault commented Jun 13, 2022

Is it possible to support arm64

It passes continuous integration tests on arm64-graviton2: https://app.travis-ci.com/github/OSGeo/gdal/jobs/573298621

…K [layer_name]' and 'RECOMPUTE EXTENT ON layer_name'
@nyalldawson
Copy link
Collaborator

@rouault

Last two commits look good too 👍

@rouault
Copy link
Member Author

rouault commented Jun 16, 2022

@palmerj did you have a chance to test ?

@palmerj
Copy link
Contributor

palmerj commented Jun 16, 2022

Some testing but didn't finish. Will be able to do some more this weekend

nyalldawson added a commit to nyalldawson/QGIS that referenced this pull request Jun 20, 2022
in browser

This change means that the dataset management functionality which
was previously available only to gpkg/spatialite databases through
browser is now available for all appropriate OGR supported datasets,
including:

- showing the "Fields" item which lets users directly add/remove
fields from the dataset without having to first open it in a project
- exposing the "New Table" action for creating new layers in a
format which OGR supports table creation in (e.g. File Geodatabases,
after OSGeo/gdal#5910 lands)
nyalldawson added a commit to nyalldawson/QGIS that referenced this pull request Jun 20, 2022
in browser

This change means that the dataset management functionality which
was previously available only to gpkg/spatialite databases through
browser is now available for all appropriate OGR supported datasets,
including:

- showing the "Fields" item which lets users directly add/remove
fields from the dataset without having to first open it in a project
- exposing the "New Table" action for creating new layers in a
format which OGR supports table creation in (e.g. File Geodatabases,
after OSGeo/gdal#5910 lands)
@rouault
Copy link
Member Author

rouault commented Jun 21, 2022

Merging. Potential feedback on this to be done through Issues

@rouault
Copy link
Member Author

rouault commented Jun 21, 2022

"osgeo/gdal:alpine-normal-latest" docker image has been regenerated with fix for #5952, and outdated "rouault/gdal:alpine-normal-openfilegdb_write" has been removed

nyalldawson added a commit to nyalldawson/QGIS that referenced this pull request Jun 22, 2022
in browser

This change means that the dataset management functionality which
was previously available only to gpkg/spatialite databases through
browser is now available for all appropriate OGR supported datasets,
including:

- showing the "Fields" item which lets users directly add/remove
fields from the dataset without having to first open it in a project
- exposing the "New Table" action for creating new layers in a
format which OGR supports table creation in (e.g. File Geodatabases,
after OSGeo/gdal#5910 lands)
nyalldawson added a commit to qgis/QGIS that referenced this pull request Jun 22, 2022
in browser

This change means that the dataset management functionality which
was previously available only to gpkg/spatialite databases through
browser is now available for all appropriate OGR supported datasets,
including:

- showing the "Fields" item which lets users directly add/remove
fields from the dataset without having to first open it in a project
- exposing the "New Table" action for creating new layers in a
format which OGR supports table creation in (e.g. File Geodatabases,
after OSGeo/gdal#5910 lands)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants