I am trying to to create a spatial view on my spatialite database.
CREATE VIEW v2_pump_view AS SELECT pump.ROWID AS ROWID, pump.id AS pump_id, MakeLine( start_node.the_geom, end_node.the_geom ) AS the_geom FROM v2_pump AS pump , v2_connection AS start_node , v2_connection AS end_node where pump.connection_start_id = start_node.id AND pump.connection_end_id = end_node.id ; Then, to register with the views_geometry_columns:
INSERT INTO views_geometry_columns (view_name, view_geometry, view_rowid, f_table_name, f_geometry_column) VALUES ('v2_pump_view', 'the_geom', 'ROWID', 'v2_connection', 'the_geom');Of course this doesn't work as the connection table has a point geometry. How I can register the line-geometry I made on the fly during the view creation by the MakeLine-function?
أكثر...
CREATE VIEW v2_pump_view AS SELECT pump.ROWID AS ROWID, pump.id AS pump_id, MakeLine( start_node.the_geom, end_node.the_geom ) AS the_geom FROM v2_pump AS pump , v2_connection AS start_node , v2_connection AS end_node where pump.connection_start_id = start_node.id AND pump.connection_end_id = end_node.id ; Then, to register with the views_geometry_columns:
INSERT INTO views_geometry_columns (view_name, view_geometry, view_rowid, f_table_name, f_geometry_column) VALUES ('v2_pump_view', 'the_geom', 'ROWID', 'v2_connection', 'the_geom');Of course this doesn't work as the connection table has a point geometry. How I can register the line-geometry I made on the fly during the view creation by the MakeLine-function?
أكثر...