Copy a table from one database to another includng the geometry column(s)

28 views
Skip to first unread message

Jim

unread,
Mar 2, 2022, 1:34:07 PM3/2/22
to SpatiaLite Users
So far, I've tried using various functions in Spatilaite_gui to  do this but the geometry column doesn't seem to get copied.

I've used both CSV and DBF with no joy  as to the geometry column.

Do I have to write a program to do this or can it be done with spatialite_gui?

 If so, does anyone have an example of a program or how to do it with spatialite_gui?

I'm afraid I'm getting beyond my spatialite skills.

Regards,
Jim




a.fu...@lqt.it

unread,
Mar 3, 2022, 4:11:00 AM3/3/22
to spatiali...@googlegroups.com
Hi Jim,

Spatial Data (with Geometries) are usually exchanged by using
ESRI Shapefiles, not CSV or DBF files that are only intended
for exchanging "plain" (non-spatial) data.

exchanging data from one DB to another does not requires
any intermediate file format because you can perform a
direct copy, something like this:

ATTACH DATABASE <path> AS db_input;
SELECT CloneTable('db_input', 'my_table', 'my_table', 1);

you should be a little more specific about what are you
doing and what difficulties you are experiencing in
order to get some appropriate answer.

bye Sandro
Reply all
Reply to author
Forward
0 new messages