Re: [Qgis-user] Spatialite VIEW in QGIS question

2014-02-21 Thread Bernd Vogelgesang
Dear folks, thanks a lot for all who tried to help. I have a working solution now, which I will hopefuly be able to forge into some script, so all steps for many layers will run more automatic. I maybe had other working solutions before, but I made the mistake and didn't see that I had

Re: [Qgis-user] Spatialite VIEW in QGIS question

2014-02-21 Thread Bo Victor Thomsen
Bernd - I think, that you have misunderstood some of the basic tenets of relational database technology: * If you establish a straight 1:n relationships in a relational database (as SQLite, SpatiaLite or Postgres/PostGis) you'll get at least n rows in the resulting view; if you want it

Re: [Qgis-user] Spatialite VIEW in QGIS question

2014-02-21 Thread Bernd Vogelgesang
Am 21.02.2014, 22:17 Uhr, schrieb Bo Victor Thomsen bo.victor.thom...@gmail.com: Bernd - I think, that you have misunderstood some of the basic tenets of relational database technology: If you establish a straight 1:n relationships in a relational

Re: [Qgis-user] Spatialite VIEW in QGIS question

2014-02-20 Thread Bernd Vogelgesang
Am 19.02.2014 20:06, schrieb Alex Mandel: On 02/19/2014 10:43 AM, Bernd Vogelgesang wrote: Am 19.02.2014 16:55, schrieb Alex Mandel: On 02/18/2014 12:29 PM, Bernd Vogelgesang wrote: Hi folks, I'm quite desperate, cause I do not seem to understand what I'm doing wrong, or if it's just not

Re: [Qgis-user] Spatialite VIEW in QGIS question

2014-02-20 Thread Bernd Vogelgesang
Am 19.02.2014 20:02, schrieb Olivier Dalang: Dear Bernd, I encountered some similar problems with Spatialite views, but in the end I had it working (sometimes) both in 2.0 and in master... I used the manual method from the spatialite cookbook though (not the Spatialite GUI). I have no time

Re: [Qgis-user] Spatialite VIEW in QGIS question

2014-02-20 Thread Olivier Dalang
Bernd, Here's a procedure which works here on QGIS master : 1. Create a spatialite layer countries with fields name and a geometry column geom of type polygon. 2. Add some features to that layer. 3. In the DB manager, create the view: CREATE VIEW countries_influence AS SELECT rowid as rowid,

Re: [Qgis-user] Spatialite VIEW in QGIS question

2014-02-20 Thread Bernd Vogelgesang
Am 20.02.2014 18:13, schrieb Olivier Dalang: Bernd, Here's a procedure which works here on QGIS master : 1. Create a spatialite layer countries with fields name and a geometry column geom of type polygon. 2. Add some features to that layer. 3. In the DB manager, create the view: CREATE

Re: [Qgis-user] Spatialite VIEW in QGIS question

2014-02-20 Thread Bo Victor Thomsen
Try this - CREATE VIEW Testview23 AS SELECT a.PK_UID*1 + b.PK_UID AS NEWID, a.ROWID AS ROWID, a.Geometry AS Geometry, b.ora_nachweis_id AS ora_nachweis_id, b.zahl AS zahl, b.jahr AS jahr, b.art AS art, b.sta AS sta FROM ASK_VOEGEL AS a JOIN ask_art AS b USING (id) Afterwards you can do

Re: [Qgis-user] Spatialite VIEW in QGIS question

2014-02-20 Thread Olivier Dalang
Hi Olivier, thank you for trying to help, but, ermm, actually I do not see the point performing this. I have not really a problem creating views, but more making these functional in QGIS. Your example, as far as i understand, lacks a join-part completely, but thats the culprit I fear. OK

Re: [Qgis-user] Spatialite VIEW in QGIS question

2014-02-19 Thread Pedro Machado Monteiro
Hello Bernd, In QGis 1.8 and 1.7, perhaps this will help (exporting *shp* to *csv* with *wkt *geometry, also your observation entries to *csv*, and linking both*; *not very productive, I suppose) http://gis.stackexchange.com/questions/10788/how-to-join-multiple-records-to-single-feature

Re: [Qgis-user] Spatialite VIEW in QGIS question

2014-02-19 Thread Steve G
This does not directly answer your question about spatialite views, but you might be able to use relationships directly in QGIS in the near future (I think this is a 2.1 update). See: http://blog.vitu.ch/10112013-1201/qgis-relations -Steve -- View this message in context:

Re: [Qgis-user] Spatialite VIEW in QGIS question

2014-02-19 Thread Bernd Vogelgesang
Am 19.02.2014 16:55, schrieb Alex Mandel: On 02/18/2014 12:29 PM, Bernd Vogelgesang wrote: Hi folks, I'm quite desperate, cause I do not seem to understand what I'm doing wrong, or if it's just not possible to do. I have a polygon layer in my spatialite database and a normal table with bird

Re: [Qgis-user] Spatialite VIEW in QGIS question

2014-02-19 Thread Bernd Vogelgesang
Am 19.02.2014 19:14, schrieb Steve G: This does not directly answer your question about spatialite views, but you might be able to use relationships directly in QGIS in the near future (I think this is a 2.1 update). See: http://blog.vitu.ch/10112013-1201/qgis-relations -Steve Hi Steve,

Re: [Qgis-user] Spatialite VIEW in QGIS question

2014-02-19 Thread Olivier Dalang
Dear Bernd, I encountered some similar problems with Spatialite views, but in the end I had it working (sometimes) both in 2.0 and in master... I used the manual method from the spatialite cookbook though (not the Spatialite GUI). I have no time to test now, but from what I recall, this does not

Re: [Qgis-user] Spatialite VIEW in QGIS question

2014-02-19 Thread Alex Mandel
On 02/19/2014 10:43 AM, Bernd Vogelgesang wrote: Am 19.02.2014 16:55, schrieb Alex Mandel: On 02/18/2014 12:29 PM, Bernd Vogelgesang wrote: Hi folks, I'm quite desperate, cause I do not seem to understand what I'm doing wrong, or if it's just not possible to do. I have a polygon layer in

Re: [Qgis-user] Spatialite VIEW in QGIS question

2014-02-19 Thread Alex Mandel
Maybe I'm unclear on the issue. If it's just how to get a view with geometry to show up, I've found you often have register view with spatialite metadata: INSERT INTO views_geometry_columns (view_name, view_geometry, view_rowid, f_table_name, f_geometry_column) VALUES (theview, thegeometry,

Re: [Qgis-user] Spatialite VIEW in QGIS question

2014-02-19 Thread Jukka Rahkonen
Bernd Vogelgesang bernd.vogelgesang@... writes: Guys, this is a very sad topic and I really can't understand how people can work with 1:n data even on the most basic level under these circumstances ... Or doesn't anyone work with 1:n data? Well, the the world I'm living in is full of that

[Qgis-user] Spatialite VIEW in QGIS question

2014-02-18 Thread Bernd Vogelgesang
Hi folks, I'm quite desperate, cause I do not seem to understand what I'm doing wrong, or if it's just not possible to do. I have a polygon layer in my spatialite database and a normal table with bird observations. There are many observation entries for each item in the polygons. They