ESRI文件地理数据库(FileGDB)

司机简称

文件数据库

生成依赖项

FileGDB API库

File gdb驱动程序提供对ArcGIS 10及以上版本创建的文件geodatabase(.gdb目录)的矢量层的读写访问。数据集名称必须是目录/文件夹名称,并且必须以.gdb扩展名结尾。

注意 : the OpenFileGDB driver 驱动程序作为可选的内置驱动程序存在,即不依赖于第三方库)只读驱动程序。

驱动程序功能

Supports Create()

This driver supports the GDALDriver::Create() operation

Supports Georeferencing

This driver supports georeferencing

要求

FileGDB API SDK

几何图形中的曲线在GDAL>=2.2的情况下支持读取。

批量功能加载

The FGDB_BULK_LOAD configuration option can be set to YES to speed-up feature insertion (or sometimes solve problems when inserting a lot of features (see http://trac.osgeo.org/gdal/ticket/4420). The effect of this configuration option is to cause a write lock to be taken and a temporary disabling of the indexes. Those are restored when the datasource is closed or when a read operation is done.

对于新创建的图层,默认情况下启用批量加载(除非另有指定)。

SQL支持

SQL语句通过FileGDB SDK API的SQL引擎运行。这适用于非SELECT语句。但是,由于当前FileGDB SDK API版本(v1.2)中对SELECT语句的部分/不准确支持,默认情况下,OGR SQL引擎将运行SELECT语句。可以通过指定 -dialect FileGDB 选择ogrinfo或ogr2ogr。

特殊SQL请求

“GetLayerDefinition a_layer_name”和“GetLayerMetadata a_layer_name”可以用作特殊的SQL请求,分别获取作为XML内容的FileGDB表的定义和元数据。

Starting with GDAL 3.5, the "REPACK" special SQL request can be issued to ask for database compaction.

Field domains

3.3 新版功能.

Retrieving coded and range field domains are supported. Writing support has been added in GDAL 3.5.

Hiearchical organization

3.4 新版功能.

The hiearchical organization of tables and feature classes as top-level element or within a feature dataset can be explored using the methods GDALDataset::GetRootGroup(), GDALGroup::GetGroupNames(), GDALGroup::OpenGroup(), GDALGroup::GetVectorLayerNames() and GDALGroup::OpenVectorLayer()

交易支持

FileGDB驱动程序通过模拟(根据 RFC 54:数据集事务 ),因为FileGDB SDK本身不提供它。当调用StartTransaction(force=TRUE)时,这通过备份geodatabase的当前状态来工作。如果事务已提交,备份副本将被销毁。如果事务回滚,则会还原备份副本。因此,在大型地理数据库上操作时,这可能会很昂贵。

从GDAL 2.1开始,在Linux/Unix上,只备份修改过的层,而不是完全备份副本。

请注意,在并发更新的情况下(在同一个或另一个进程中具有不同的连接),此仿真具有未指定的行为。

CreateFeature()支持

FileGDB SDK API不允许使用用户指定的FID创建功能。从GDAL 2.1开始,FileGDB驱动程序实现了一种特殊的FID重新映射技术,使用户能够在自己选择的FID上创建特性。

数据集创建选项

没有。

图层创建选项

  • FEATURE_DATASET :设置此选项后,将在命名的FeatureDataset文件夹中创建新层。如果文件夹不存在,将创建它。

  • LAYER_ALIAS =string:(GDAL>=2.3)设置层名称别名。

  • GEOMETRY_NAME :在新层中设置几何列的名称。默认为“SHAPE”。

  • GEOMETRY_NULLABLE :(GDAL>=2.0)几何列的值是否可以为空。可以设置为“否”,以便需要几何图形。默认为“是”

  • FID :要创建的OID列的名称。默认为“OBJECTID”。注意:在GDAL 2之前的版本中,option被称为OID_NAME

  • 耐氧性 :这些参数控制用于高级ArcGIS功能(如网络和拓扑规则)的捕捉公差。它们不会影响任何OGR操作,但ArcGIS会使用它们。参数的单位是坐标系的单位。

    XYTOLERANCE的ArcMap 10.0和OGR默认值对于投影坐标系为0.001m(或等效值),对于地理坐标系为0.000000008983153°。

  • XORIGIN、YORIGIN、ZORIGIN、XYSCALE、ZSCALE :这些参数控制 coordinate precision grid 在geodatabase文件中。网格的尺寸由原点和比例决定。原点定义参考栅格点在空间中的位置。比例是分辨率的倒数。因此,要获得原点为0、所有轴上分辨率为0.001的栅格,可以将所有原点设置为0,将所有比例设置为1000。

    重要的 :指定的域 (xmin=XORIGIN, ymin=YORIGIN, xmax=(XORIGIN + 9E+15 / XYSCALE), ymax=(YORIGIN + 9E+15 / XYSCALE)) 需要包含要素类的所有可能的坐标值。如果添加的要素的坐标不在域内,则在使用空间索引、要素选择和导出数据的ArcGIS中会出现错误。

    ArcMap 10.0和OGR默认值:

    • 对于地理坐标系:XORIGIN=-400,YORIGIN=-400,XYSCALE=100000000

    • 对于投影坐标系:XYSCALE=10000,默认XYTOLERANCE为0.001m。XORIGIN和YORIGIN根据坐标系更改,但OGR默认值-2147483647适用于所有坐标系的默认XYSCALE。

  • XML_DEFINITION :设置此选项时,其值将用作创建新表的XML定义。这种XML定义的根节点必须是<esri:数据元素>元素符合文件gdbapi.xsd

  • CREATE_MULTIPATCH =YES:设置此选项时,MultiPolygon类型图层的几何图形将写入MultiPatch

  • CONFIGURATION_KEYWORD =DEFAULTS/TEXTu UTF16/MAXu FILEu SIZEu 4GB/MAXu FILEu SIZEu 256TB/GEOMETRYu OUTOFLINE/BLOBu OUTOFLINE/GEOMETRYu ANDu BLOBu OUTOFLINE:自定义数据存储方式。默认情况下,文本采用UTF-8格式,数据最大为1TB

配置选项

The following configuration options are available:

  • FGDB_BULK_LOAD can be set to YES to speed-up feature insertion (or sometimes solve problems when inserting a lot of features (see http://trac.osgeo.org/gdal/ticket/4420). The effect of this configuration option is to cause a write lock to be taken and a temporary disabling of the indexes. Those are restored when the datasource is closed or when a read operation is done. Bulk load is enabled by default for newly created layers (unless otherwise specified).

实例

  • 从FileGDB读取层并加载到PostGIS:

  • 获取文件gdb的详细信息:

建筑注释

阅读 GDAL Windows Building example for Plugins . 在nmake.opt的FileGDB中可以找到类似的部分。完成后,去 $gdal_source_rootogrogrsf_frmtsfilegdb 文件夹和执行:

nmake /f makefile.vc plugin         nmake /f makefile.vc plugin-install

已知问题

  • The SDK is known to be unable to open layers with particular spatial reference systems. This might be the case if messages "FGDB: Error opening XXXXXXX. Skipping it (Invalid function arguments.)" when running ogrinfo --debug on the.gdb (reported as warning in GDAL 2.0). Using the OpenFileGDB driver will generally solve that issue.

  • FGDB坐标捕捉将导致在写入期间更改几何图形。使用“原点”和“缩放图层”创建选项控制捕捉行为。

  • 驱动程序无法读取SDC格式的数据(智能数据压缩),因为ESRISDK不支持该操作。

  • 读取以CDF格式(压缩数据格式)压缩的数据需要ESRISDK1.4或更高版本。

  • Some applications create FileGeodatabases with non-spatial tables which are not present in the GDB_Items metadata table. These tables cannot be opened by the ESRI SDK, so GDAL will automatically fallback to the OpenFileGDB driver to read these tables. Accordingly they will be opened with the limitations of the OpenFileGDB driver (for instance, they will be read only).

Other limitations

  • The FileGeodatabase format (and thus the driver) does not support 64-bit integers.