Hello,
I have C++ code to create a Spatialite database but it takes a long time to execute compared to creating a Spatialite database from the command prompt.
My code creates a sqlite3 database, enables extensions, loads mod_Spatialite and then runs:
rc = sqlite3_exec(m_sqlite3db, "SELECT InitSpatialMetadata();", nullptr, nullptr, &zErrMsg);
this can take around 30 seconds to run. Doing it from the command line i.e. spatialite mydb.db, takes just a few seconds.
The file sizes are slightly different too between the two methods. The programmatic one is a few hundred bytes smaller.
This isn’t really a big problem but would be interested to know if there is a way for the programmatic approach to be just as quick as the command line approach.
Best, Chris
Hi,
cf https://www.gaia-gis.it/gaia-sins/spatialite-sql-5.1.0.html#p16 : "if the optional argument transaction is set to TRUE the whole operation will be handled as a single Transaction (faster)"
==> SELECT InitSpatialMetadata(TRUE)
--
You received this message because you are subscribed to the Google Groups "SpatiaLite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spatialite-use...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/spatialite-users/004701dc2583%2411895a70%24349c0f50%24%40gmail.com.
-- http://www.spatialys.com My software is free, but my time generally not.