[Gdal-dev] Max no of layers in OGR shapefile driver

Mateusz Loskot mateusz at loskot.net
Thu May 17 09:27:35 EDT 2007


Dave Robertson wrote:
> Hi,
> 
> I'm working with OGR and a set of 280 shapefiles each representing a
> layer. I find I can open the first 84 shapefiles and all the rest return
> error code 4 Error opening file). It doesn't seem to matter which
> particular 84 files - I can't open any more than that. The shapefiles
> are all one directory, along with their .dbf, .shx and .qix files. I've
> looked at the source for the shapefile driver and I can't see any limits
> built in there, and as far as I'm aware the operating system's limit is
> 12500 open files (per process). The OS is OS X.

Dave,

ADAIR, OSX9 used very low number of open files per process (64).
See this FAQ, error code 24:

http://www.osxfaq.com/man/2/intro.ws

When you open 280 shapefiles, you get (not counting .prj) 280 * 3 number
of open files, so I suppose you hit beyond the limit
which I *suppose* is ~255 per process, in newer OSX versions.

> I have loaded all the shapefiles into postgis as an experiment and I can
> read all the layers from there just fine, albeit slowly.

What means slowly?
Do you use spatial index, GiST ?

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



More information about the Gdal-dev mailing list