[Qgis-developer] Fwd: [Qgis-user] QGIS problem with GeoPackage database views

Richard Duivenvoorde rdmailings at duif.net
Sun Jun 26 13:33:13 PDT 2016


[resending to list as I sent it from wrong account]

On 26-06-16 21:22, Even Rouault wrote:
> The issue is that the OGR GeoPackage driver cannot derive an integer primary 
> key from the view, and affects 0 as the fid for all features. In the case of the 
> views of this particular dataset, the OBJECTID field could be used as the FID 
> (given some logic to be implemented in the driver to analyze the structure of 
> the view, the underlying tables and the unicity constraints on the join fields)

Ok... so, is this a driver challenge?

Or is it more an explicit problem, because the view is created without
explicit primary key?

Because, instead of putting 'some logic' into the driver trying to guess
a primary key, we can maybe create some kind of PK-constraint?

Like: a view (just like an Oracle table?) should have some kind of
primary key defined? If not: ask for it, so it is defined into the view
definition (uh... not sure IF that is possible at all in a view...).
Or QGIS asks for it: showing the attributes, and letting the user choose
the id('s) that the user (thinks) are unique and should be used as
primary key...

To be honest, instead of driven by (technological) knowledge, I'm more
driven by a desire to make GeoPackage a successfull format :-)

Regards and thanks for picking this up so swift.

Regards,

Richard Duivenvoorde




More information about the Qgis-developer mailing list