CREATE TABLE coordinates (
id INTEGER NOT NULL
PRIMARY KEY AUTOINCREMENT,
site_name TEXT NOT NULL, "the_geom" POINT)
Select AddGeometryColumn ('the_geom', 'gtry', 32636, 'POINT', 2);
I have seen a lot of discussions on the internet about triggers and BLOB statements so, I am not sure if these two are all the necessary steps for me to have an accurately functioning spatial data table.
My second question is: should I have a separate geometry table for polygons? The reason for having polygon data is to determine the location of a specific point in relation to many polygons (to figure out in which watershed the archaeological site is located at).
Finally, I am assuming that I need to connect geometry tables with the main table (containing the names and other details of archaeological sites), right?
Thank you!
Bulent
Dear List,Since I am new to SpatiaLite, I am trying to understand how one constructs spatial dbase here. I understand that coordinate data (and associated details such as datum and projection info) are stored in a separate table. In my project, I am dealing with mainly two types of geometry: points (i.e., archaeological sites) and polygons (i.e., watersheds). I already have a geometry table for points (WGS84, UTM 36N).My first question is about creating geometry tables in SpatiaLite. I used the commands below to create the table "coordinates" for my point data:CREATE TABLE coordinates (
id INTEGER NOT NULL
PRIMARY KEY AUTOINCREMENT,
site_name TEXT NOT NULL, "the_geom" POINT)
Select AddGeometryColumn ('the_geom', 'gtry', 32636, 'POINT', 2);
CREATE TABLE coordinates(-- do not include the geometry field in the SQL CREATE Staatement
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, site_name TEXT NOT NULL
);
-- Syntax: table_name, geometry_name, srid, geometry_type, dimension
SELECT AddGeometryColumn ('coordinates', 'point_utm', 32636, 'POINT', 'XY');
I have seen a lot of discussions on the internet about triggers and BLOB statements so, I am not sure if these two are all the necessary steps for me to have an accurately functioning spatial data table.
My second question is: should I have a separate geometry table for polygons? The reason for having polygon data is to determine the location of a specific point in relation to many polygons (to figure out in which watershed the archaeological site is located at).
-- Add a WSG84 POINT to the TABLE
SELECT AddGeometryColumn ('coordinates', 'point_wsg84', 4326, 'POINT', 'XY');
-- Add a WSG84 POLYGON to the TABLE
SELECT AddGeometryColumn ('coordinates', 'polygon_wsg84', 4326, 'POLYGON', 'XY');
-- create SpatialIndex for the 3 geometries
SELECT CreateSpatialIndex('coordinates','point_utm');
SELECT CreateSpatialIndex('coordinates','point_wsg84');
SELECT CreateSpatialIndex('coordinates','polygon_wsg84');