1

How do you create a temporary table with geometry column in spatialite?

I have tried:

CREATE TEMP TABLE rivers (code INTEGER, id INTEGER, name TEXT);

Followed by:

SELECT AddGeometryColumn('temp.rivers','geom', 27700, LINESTRING');

The first query succesfully creates the table, but the second query does not create the geometry column. I have tried running the queries in spatialite-gui, and in python with the sqlite3 module, with the same results.

2

I do not believe that the AddGeometryColumn part is possible at all. This thread tells that it is not possible to use it for attached databases https://groups.google.com/forum/#!topic/spatialite-users/rRMSHk2Lt38 and the temporary database is an attached, automatically created database. You must create your temporary tables into the main database and drop them once you do not need them any more.

1
  • A temporary database is an attached database. – BradHards Nov 25 '14 at 0:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.