Roberto,
this is an international mailing list and posting in English
is strictly required. If you wish using the Italian language
you can eventually post your mails to
gf...@lists.gfoss.it
This time I'll exceptionally reply to your latest mail,
but for the future remember that messages posted in any
other language except the English one will be simply
ignored.
A quick recall of the very basic and elementary principles
of SQL and Spatial SQL supported by SQLite + SpatiaLite:
a. data are always stored into some Table, i.e. into a
rectangular matrix presenting a variable number of
Rows and a fixed number of Columns.
In order to create a new Table you must specify
a list of Columns, and for each Column a name and
a data-type must be defined.
Geometry Columns are someway special, and require
to be created in a second time by specifying:
a1. a Geometry Class (e.g. Point or Polygon etc)
a2. a SRID (e.g. 3004, 32632, 4326 etc)
a3. Dimensions (e.g. XY, XYZ, XYM or XYZM)
A Geometry Column can never change its specific
attributes after being created; anyway you are
free to define two (or even more) Geometries for
the same Table.
b. ST_Transform() is the standard SQL function allowing
to re-project coordinates from a SRID to another.
c. SQL supports several mechanism allowing to copy values
from a Column to another and/or between two Tables.
Putting it all together:
1. you initially start with a Table presenting a Geometry
Column referencing SRID=3004
2a. you can add a second Geometry Column on the same
table referencing SRID=4326
2b. alternatively you can create a new Table presenting
the same Columns of the first one except in that this
time the Geometry Column will reference SRID=4326
3. after this you finally have to populate this new
Column (or Table) by copying data from the initial
Table and by applying an appropriate coordinate
transformation.
SQL snipper for case 2a
=======================
SELECT AddGeometryColumn('old_table', 'geom2', 4326, 'POINT', 'XY');
UPDATE old_table SET geom2 = ST_Transform(geom, 4326);
SQL snipper for case 2b
=======================
CREATE TABLE new_table (
... all column definitions, including PK and FK
constraints exactly as in old_table ...
);
SELECT AddGeometryColumn('new_table', 'geom', 4326, 'POINT', 'XY');
INSERT INTO new_table
SELECT ... columns list ..., ST_Transform(geom, 4326)
FROM old_table;
note: all the above informations are clearly and detailed
explained with many practical examples in the Cookbook:
http://www.gaia-gis.it/gaia-sins/spatialite-cookbook/index.html
reading the appropriate documentation before asking rather
trivial questions usually is the simpler and quicker way to
get all the informations you need.
bye Sandro