vastly simplifying and improving the spatialite processing script