[Gfoss] Fwd: Re: [Qgis-user] Spatialite : problems with spatial views

Paolo Cavallini cavallini a faunalia.it
Mer 5 Feb 2014 11:40:16 CET


Salve.
Ho seguito la discussione un po' al volo, ma mi pare che questa nota aiuti a capire
(se no, scusatemi).
Saluti.


-------- Messaggio originale --------
Oggetto: 	Re: [Qgis-user] Spatialite : problems with spatial views
Data: 	Wed, 05 Feb 2014 12:26:55 +0200
Mittente: 	Micha Silver <micha at arava.co.il>
A: 	giedrius <gvaivilavicius at gmail.com>, qgis-user at lists.osgeo.org



Notice that you have duplicate ROWID values in your view results. Spatialite (and DB
manager) don't care about this since the ROWID is more a convenience. But for QGIS
it's critical that this column be like a unique primary key.

This is happening because you have GROUP BY with two columns in your query. I think
that what will resolve this is creating a new integer column with unique values for
each Fortas-rusis pair.

If you could try this: add to both the siksnosparniai_rusis table and the
siksnosparniai_patalpa tables  additional integer columns with unique values for each
Fortas and unique values for each rusis. Then in your view, combine these two
integers in some way to get a new *unique* value to be used as the ROWID. That should
work out the duplicate error values in QGIS.

Good luck,
Micha




On 05/02/2014 09:25, giedrius wrote:
> Hello, 
>
> I have a problem with the display of tables add to QGIS from spatialite. 
> DB Manager displays the correct data, but uploading to QGIS table entries
> changed to false: 
> http://i.imgur.com/Pahw13c.png
> http://i.imgur.com/9Y1zaq4.png
>
> When loaded data export to shapfile then show the correct data: 
> http://i.imgur.com/ZeXk6Xz.png
>
> Is this a bug? Is it my fault as a user? 
>
> I work with Debian
>
> VAM_test_s.sqlite
> <http://osgeo-org.1560.x6.nabble.com/file/n5101983/VAM_test_s.sqlite>  

-- 
Micha Silver
GIS Consulting
052-3665918
http://www.surfaces.co.il





Maggiori informazioni sulla lista Gfoss