New answers tagged

2

Your problem is very easy to resolve because the problem is only in the documentation. https://www.gaia-gis.it/gaia-sins/spatialite-sql-latest.html is indeed claiming that ST_Centroid requires Surface but it is not true and you can just feed in your MultiPoints as they are. I made a a following test with spatialite-gui versions 1.8.0 and 2.0.0: Query: ...


3

Lets start with a simple example: spatialite> CREATE TABLE gis193636 (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, flag INTEGER NOT NULL); spatialite> SELECT AddGeometryColumn( 'gis193636', 'geom', 0, 'MULTIPOINT', 'XY', 1); 1 spatialite> INSERT INTO gis193636 (flag, geom) VALUES (1, GeomFromText('MULTIPOINT((0 0))', ...


0

Found the solution after I explored the documentation a bit more. https://www.gaia-gis.it/gaia-sins/spatialite-cookbook/html/c.html Unfortunately, the cookbook part was more about how to use spatial queries instead of how to create software using the spatialite library, with an incomplete description on how to create the metatables. The missing piece is ...


2

Using views (as suggested in link) is pretty easy, for example. -- population table (the table you edit when changes...) CREATE TABLE pop_table ( gid integer primary key, population integer, geom geometry); -- Density view (you can open it like a table in QGIS) CREATE VIEW density_table AS SELECT gid,population,(population/ST_Area(geom))::float AS ...


1

Try UNION ALL for collecting all the geometries before running ST_COLLECT. SELECT ST_Collect(geometry) FROM (SELECT geometry from tbl1 UNION ALL SELECT geometry from tbl2 UNION ALL SELECT geometry from tbl3 UNION ALL SELECT geometry from tbl4);



Top 50 recent answers are included