This file contains hidden or 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
| -- Enable PostGIS extension | |
| CREATE EXTENSION IF NOT EXISTS postgis; | |
| -- Create City table with PostGIS geometry column | |
| CREATE TABLE City ( | |
| ID SERIAL PRIMARY KEY, | |
| name VARCHAR(255) NOT NULL, | |
| point GEOMETRY(POINT, 4326) | |
| ); |
This file contains hidden or 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
| sqlite> .load /usr/local/lib/mod_spatialite.so | |
| sqlite> CREATE TABLE test_geometries ( | |
| id INTEGER PRIMARY KEY, | |
| name TEXT, | |
| geom GEOMETRY | |
| ); | |
| sqlite> INSERT INTO test_geometries (id, name, geom) VALUES | |
| (1, 'Valid Point', GeomFromText('POINT(1 1)', 4326)), | |
| (2, 'Valid Polygon', GeomFromText('POLYGON((0 0, 1 0, 1 1, 0 1, 0 0))', 4326)), | |
| (3, 'Empty Point', GeomFromText('POINT EMPTY', 4326)), |
OlderNewer