[Shapelib] ShapeLib API

shapelib at lists.maptools.org shapelib at lists.maptools.org
Wed Apr 14 12:55:06 EDT 2004

shapelib at lists.maptools.org wrote:
> To the group,
> I'm developing some functionality in an application suite written in Delphi and I've struck a problem generating shapefiles with lots of data.
> I did a bit of searching on the web and discovered you guys have written an API for shapefiles. But alas in one of the release notes for V1.2 it states that for speed use V1.1.
> My question is where can I get V1.1 and is it likely to help me. (Adding 10,000 Polygon shapes to a shapefile took 60mins using Delphi's ActiveX wrappers, which is not good when I really want to be able to create 1,000,000...)


I'm not sure how much data you are working with or what ActiveX wrapper
you are using.  I just did a quick test with my generic "ogr2ogr"
translator built on top of V1.2 Shapelib but with another whole expensive
layer of abstraction.  I was able to 300000 lines of data from one shapefile
to another in 45seconds (a bit over 100MB of data):

-r--------    1 warmerda users    83843266 Apr 14 12:48 roadharr_orig.dbf
-r--------    1 warmerda users    32040788 Apr 14 12:48 roadharr_orig.shp
-r--------    1 warmerda users     2540772 Apr 14 12:48 roadharr_orig.shx

I don't think that the performance differences between Shapelib 1.1.x and
1.2.x are going to be significant in your situation.  Either something
about how you are wrapping and calling the shapefile read/write code is
slow, or perhaps there is alot of extra validation being done to the polygon
data as it is written.

In short:
  o I think Shapelib 1.2 would be fine.
  o You will need to do a finer analsys of where you time is being spent.

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    | Geospatial Programmer for Rent

More information about the Shapelib mailing list