Pubblicato il da Totò
Quesito preso dalla lista spatialite-users:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
— creating the VirtualText table | |
CREATE VIRTUAL TABLE txt_pts USING VirtualText('C:\Users\pigre\Desktop\prov_centroid.csv','UTF-8', 1,'POINT','NONE', ','); | |
— creating the Spatial Table | |
CREATE TABLE mypoints (fid INTEGER PRIMARY KEY AUTOINCREMENT); | |
— adding a POINT geometry to the Spatial Table | |
SELECT AddGeometryColumn('mypoints', 'geom', 4326, 'POINT', 'XY'); | |
— populating the Spatial Table from the VirtualText | |
INSERT INTO mypoints (fid, geom) | |
SELECT NULL, MakePoint(long, lat, 4326) | |
FROM txt_pts; | |
— dropping the now useless VirtualText | |
DROP TABLE txt_pts; |
Riferimenti:
- SpatiaLite Home Page
- download spatialite_gui 2.10
- CookBook
- Virtual table
Ringraziamenti:
Alessandro Furieri papà di SpatiaLite
Pubblicità