[Gdal-dev] OGRTINDEX support for Geodatabases?

Frank Warmerdam warmerdam at pobox.com
Wed May 31 14:06:54 EDT 2006


Mateusz Loskot wrote:
> Matt Wilkie wrote:
>>> The other alternative is to build a DOS for loop to invoke
>>> ogrtindex for each file via looping.
>>
>> e.g. for /r Z:\geodatabase %f in (*.mdb) do ogrtindex mdb_index.shp
>> "%f"
>>
>> Will recursively search Z:\Geodatabase and index all .mdb files.
>> Doesn't work on my machine though. Or rather the recursion works but
>> ogrtindex exits with an error: "Schema of attributes of subsequent
>> layers does not match ... Terminating."
> 
> And that's a correct behaviour of ogrtindex.
> Please, see my previous post (second part) in this thread
> or refer to Bug 1144:
> http://bugzilla.remotesensing.org/show_bug.cgi?id=1144
> 
> Simply, all layers processing with ogrtindex should have the same
> attributes schema.
> 
> May be for PGeo this behaviour should be quite different, specific.
> Frank, what do you think?

Mateusz,

There is nothing special about personal geodatabases having more than
one layer.  It is a common case.  For a tileindex to work properly with
mapserver all the inserted layers need to be of a consistent schema.
Assuming all the .mdb files have a table that matches the others (but
is presumably for a different geographic region) and assuming that layer
always has a consistent name, you can use the -lname switch with ogrtindex
to select just that layer.

eg.

e.g. for /r Z:\geodatabase %f in (*.mdb) do \
      ogrtindex mdb_index.shp -lname target_table %f

Best regards,

-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | President OSGF, http://osgeo.org




More information about the Gdal-dev mailing list