[Gdal-dev] OGRTINDEX support for Geodatabases?

Mateusz Loskot mateusz at loskot.net
Wed May 31 04:35:01 EDT 2006


chrislist at narx.net wrote:
> Hi list,
> 
> Just wondering if the ogrtindex driver has support for the pgeo 
> driver? I have multiple geodatabases and creating a ogr index would 
> make my life 100x easier. OGR can read the PGeo fine, but whenever i 
> try to create an index it fails with the below ODBC error.
> 
> ogrtindex tindex.shp F:/web/uploaded/slip/data/Hydro/50k/*.mdb
> 
> ERROR 1: Unable to initialize ODBC connection to DSN for 
> DRIVER=Microsoft Access Driver 
> (*.mdb);DBQ=F:/web/uploaded/slip/data/Hydro/50k/*.mdb, 
> [Microsoft][ODBC Microsoft Access Driver] Disk or network error. 
> Failed to open dataset F:/web/uploaded/slip/data/Hydro/50k/*.mdb, 
> skipping.


This error is well-known and we are working to fix it.
The bug is in MDB Tools which currently does not allow to use its ODBC
driver with DSN-less connection.

Here is the story:
http://article.gmane.org/gmane.comp.db.mdb-tools.devel/1038

You could try to create DSN for your MDB database and run it as follows:

ogrinfo PGeo:your_dsn_to_pgeo_database

(list of layers)

ogrinfo PGeo:your_dsn_to_pgeo_database <layer name>

(layer details)


Recenlty, I've managed to run OGR + PGeo with .mdb file path but it
is not available for users yet.


> Geodatabase support is working everywhere else except for ogrtindex, 
> so i'm beginning to think that indexing is not possible on pgeo. Can 
> someone confirm this for me?


Back to the ogrtindex.
If you will run ogrtindex against PGeo database, it will try to generate
tile index for every layer in this PGeo database.
Also, ogrtindex expect all layers being indexed have the same schema of
attributes (recently fixed,
http://bugzilla.remotesensing.org/show_bug.cgi?id=1144).
If layers in your PGeo database have different attirubes
number/definition then ogrtindex will fails with message like:

"Number of attributes of subsequent layers does not match ... terminating."

After you have DSN defined in your odbc.ini file, then try to run
ogrtindex as follows:

$ ogrtindex index.shp PGeo:your_pgeo_dsn

and if layers in database pointed by your_pgeo_dsn have different
attributes schema, then you should get:

"Number of attributes of subsequent layers does not match...terminating."

or

"Schema of attributes of subsequent layers does not match...terminating."

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net



More information about the Gdal-dev mailing list