Le dimanche 13 octobre 2013 20:57:16, Jukka Rahkonen a écrit : > Hi, > > I noticed a huge difference in running either InitSpatialMetaData() or > InitSpatialMetaData(1) on a rather weak Windows 32-bit computer with > Spatialite version 4.1.1. The first variant took 18 minutes vs. 3 seconds > for the latter. > > This must have to do with making either one big or thousands of small > transactions when populating the spatial_ref_sys table. > https://www.gaia-gis.it/gaia-sins/xmlBlob/spatialite-sql-latest.html. > > I am not sure from which Spatialite version this setting is supported but > it might be worth checking how GDAL behaves. I think it should use > "InitSpatialMetaData(1)" if it is supported. Option is said to be less safe > than the default setting "transaction=false" but function is used when an > new database is created so there is no risk for corrupting data. > > The speed of the function with default value is so awfully slow that it > feels like a bug in Spatialite.
Jukka, Yes, indeed this is very slow and I didn't have the patience to wait on my Linux PC too... InitSpatialMetaData() in spatialite < 4.1 ran always inside a transaction, which could prevent it to be used in a context where the user would have wanted a transaction that cover more than that. So the default in spatialite >= 4.1 is NOT to run inside a transaction. InitSpatialMetataData(1) in spatialite >= 4.1 is equivalent to InitSpatialMetaData() in older releases. Fixed in trunk and branches/1.10 by http://trac.osgeo.org/gdal/ticket/5270 Even -- Geospatial professional services http://even.rouault.free.fr/services.html _______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
