GDAL GeoPackage (GPKG) vs Shapefile (SHP) performance

545 Views Asked by At

I'm trying to decide which format of vector spatial data should be used on a embedded device. The main operation imposed on these vectors will be to rasterize the with GDAL C++ API so they can be converted to pixmaps on the screen. I have read that GPKG should be faster than SHP on read and write operations. But in my experience the SHP is MUCH faster and MUCH less memory consuming in generating rasters than GPKG.

For example rastering a exact same part from GPKG and SHP files with gdal_rasterize:

SHP

time gdal_rasterize -burn 20 -burn 20 -burn 255 -burn 255 -l N44_VesiAlue -ts 512 512 -ot byte -te x1 y1 x2 y2 ./N44/N44_VesiAlue.shp vesi-shp.tif
0...10...20...30...40...50...60...70...80...90...100 - done.

real    0m0,433s
user    0m0,366s
sys 0m0,021s

GPKG

time gdal_rasterize -burn 20 -burn 20 -burn 255 -burn 255 -l vesialue -ts 512 512 -ot byte -te x1 y1 x2 y2 mtkshp100k.gpkg vesi-gpkg.tif
0...10...20...30...40...50...60...70...80...90...100 - done.

real    0m4,439s
user    0m4,244s
sys 0m0,150s

The GKPK takes a significantly more time and also very much RAM (more than the whole memory available on the target).

Is rastering actually a operation where SHP performs better. Why do my test conflict with the overall idea that GPKG is better performing than SHP.

0

There are 0 best solutions below