[gdal-dev] Performance of reading large polygons with holes

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Sat Apr 21 08:24:06 EDT 2012


Even Rouault wrote:

> Le samedi 21 avril 2012 12:41:49, Jukka Rahkonen a écrit :
>> Hi,
>>
>> Martin Davis started this thread on OpenJUMP-dev list
>> http://thread.gmane.org/gmane.comp.gis.jump.devel/11119
>> Perhaps someone would like to test how OGR performs with such data?
>> Link to dataset is mentioned in the discussion.

> I suppose that dataset you mention is :
> http://maps.cmparks.net/geoserver/metroparks/ows?service=WFS&version=1.0.0&request=GetFeature&>typeName=metroparks:tpi_1&outputFormat=SHAPE-
ZIP ?

Exactly.

> If so, on my box, the whole shapefile (~ 390 MB for the .shp / ~1 million
> features) can be read in about 4 seconds with a simplified version of ogrinfo
> that just loops on all the features. The algorithm that assembles the rings of
> polygon shapes into polygons that conform to Simple Features has been pretty
> improved during the last years. It is in the
> OGRGeometryFactory::organizePolygons() method ( see
> http://trac.osgeo.org/gdal/browser/trunk/gdal/ogr/ogrgeometryfactory.cpp#L1015
> ) . For shapefiles, there's a shortcut that save a lot of computations w.r.t.
> the general algorithm, because the shapefile specification states that outer
> rings should be described clockwise , whereas inner rings should be described
> counter-clockwise.

Thus it is 4 seconds vs. 32 seconds measured by Martin. It is a considerable difference but perhaps Martin is not doing exactly the same thing.  Anyway, speed of OGR seems to be excellent.

-Jukka Rahkonen-


More information about the gdal-dev mailing list