[gdal-dev] Table Names (FGDB)

Paul Ramsey pramsey at cleverelephant.ca
Mon May 30 17:47:03 EDT 2011


So, my goal is to map information from FGDB to PostGIS and as much
fidelity as possible.

FGDB includes a class called "Feature Dataset" which is basically a
folder that holds "Feature Class" objects, which map directly to OGR
layers. So the "Feature Dataset" then acts a good deal like a schema
in PostGIS.

I've noticed that the PgSQL driver supports a SCHEMA keyword to allow
you to write to a schema without schema-qualified table names, and
that it also notices when table names are schema qualified and puts
them in the appropriate place. So the name of a layer read from a
schema would show up in OGR as "schemaname.tablename".

In FGDB, we have the "path" of a Feature Class or Table, which looks
like this \FeatureDataset\FeatureClass. Similar to the schema
qualification, yet different. As it stands right now, the
FeatureDataset portion of the path is discarded in the public API, so
that the OGR layer name is just the FeatureClass, with no reference to
the FeatureDataset. That makes it hard to create a mapping from FGDB
(\FeatureDataset\FeatureClass) to PostGIS
(FeatureDataset.FeatureClass).

The FGDB implementation currently returns "GeoDatabase.GetQueryName()"
as the layer name, which "Gets the query name (the name to use in SQL
statements) of a table based on its path". If it returned the path
name, then the FeatureDataset qualification information could be
preserved in other contexts. On the other hand, perhaps the QueryName
is more useful to more users than the path? It looks like the
QueryName is expected to be unique, so probably FeatureClass and Table
names have to be unique regardless of what FeatureDataset they appear
in (true?).

So my options are:

(a) - change the current OGR layer name to the path name
(b) - change the current OGR layer name to a "schema.table" analogue
and handle appropriately
(c) - leave the current OGR layer name as is ("tablename" regardless
of containing folders) and make a FGDB-only method for accessing the
pathname for my particular purposes

Preferences?

P.


More information about the gdal-dev mailing list