qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.6k stars 3.01k forks source link

Spatialite view and DB manager #23589

Open qgib opened 8 years ago

qgib commented 8 years ago

Author Name: Enrico Fiore (Enrico Fiore) Original Redmine Issue: 15666

Redmine category:unknown


Hi,

I have created a database with spatialite_gui tool (spatialite version 4.3.0a), the database has some spatial views created with a code like this

CREATE VIEW comunitorino AS
SELECT c.ROWID as rowid, c.cod_com, c.geometry
from comuni c;

INSERT INTO views_geometry_columns
    (view_name, view_geometry, view_rowid, f_table_name, f_geometry_column,read_only)
  VALUES ('comunitorino', 'geometry', 'rowid', 'comuni', 'geometry',1)

The view can be load in QGIS by 'add spatialite layer' button

The problem is that if I use DB Manager and open the DB the view will not be seen as spatial view.

If I create the same view in DB Manager with the "Create a view" button the view will be seen as spatial view.

I wrote in qgis user mailing list and I solved it adding an entry in geometry_columns table (for the view created with spatialite.

It would better to align the two qgis tools: 'add spatialite layer' button and DB manager; so that spatial views will be always seen correctly.

qgib commented 7 years ago

Author Name: Giovanni Manghi (@gioman)


qgib commented 7 years ago

Author Name: Jürgen Fischer (@jef-n)


qgib commented 7 years ago

Author Name: Jürgen Fischer (@jef-n)


I have created a database with spatialite_gui tool (spatialite version 4.3.0a), the database has some spatial views created with a code like this

CREATE VIEW comunitorino AS SELECT c.ROWID as rowid, c.cod_com, c.geometry from comuni c;

INSERT INTO views_geometry_columns (view_name, view_geometry, view_rowid, f_table_name, f_geometry_column,read_only) VALUES ('comunitorino', 'geometry', 'rowid', 'comuni', 'geometry',1)

The view can be load in QGIS by 'add spatialite layer' button

The problem is that if I use DB Manager and open the DB the view will not be seen as spatial view.

If I create the same view in DB Manger with the "Create a view" button the view will be seen as spatial view.

I wrote in qgis user mailing list and I solved it adding an entry in geometry_columns table (for the view created with spatialite.

It would better to align the two qgis tools: 'add spatialite layer' button and DB manager; so that spatial views will be always seen correctly. to Hi,

I have created a database with spatialite_gui tool (spatialite version 4.3.0a), the database has some spatial views created with a code like this

CREATE VIEW comunitorino AS
SELECT c.ROWID as rowid, c.cod_com, c.geometry
from comuni c;

INSERT INTO views_geometry_columns
    (view_name, view_geometry, view_rowid, f_table_name, f_geometry_column,read_only)
  VALUES ('comunitorino', 'geometry', 'rowid', 'comuni', 'geometry',1)

The view can be load in QGIS by 'add spatialite layer' button

The problem is that if I use DB Manager and open the DB the view will not be seen as spatial view.

If I create the same view in DB Manager with the "Create a view" button the view will be seen as spatial view.

I wrote in qgis user mailing list and I solved it adding an entry in geometry_columns table (for the view created with spatialite.

It would better to align the two qgis tools: 'add spatialite layer' button and DB manager; so that spatial views will be always seen correctly.

benoit9126 commented 5 years ago

:+1: Any news on this feature?