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

Frank Warmerdam warmerdam at pobox.com
Fri May 25 10:27:23 EDT 2007


Dave Robertson wrote:
> PostGIS driver vs shapefile driver:
> 
> I made some measurements and would be interested to hear your thoughts.
> The code reads a data via OGR and renders this to screen.
> 
> Typical time to read and render PostGIS: 1,209,100,332 nanoseconds
> Typical time to read and render shapefiles:  225,924,592 nanoseconds
> 
> These timings are rendering exactly the same data at the same resolution 
> using the same code. I am using SetSpatialFilterRect in both cases. 
> PostGIS is running on the same machine, is GiST indexed, and is using 
> its default driver options.
> 
> PG appears to me to be 6 times slower than shapefiles: is this what 
> you'd expect,  or should I be able to tune the PG query in some way 
> (perhaps using binary cursors?)

Dave,

The OGR PostGIS read support is not well optimized, so I'm not surprised
at a difference, though this is more dramatic than I would have
expected.  It makes me wonder if perhaps spatial querying is not being
used for something.

You might try replacing PG: with PGB: in your datasource name for postgis
access.  This uses alternate postgis driver code in OGR with binary
fetching for geometries.  This code path is not very well maintained, but
is reportedly significantly faster than fetching geometries in text format.

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 OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list