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

Richard Duivenvoorde rdmailings at duif.net
Sun Jun 26 11:23:37 PDT 2016


@Marcus: forwarding this to the Developers mailing list, as I think
there are more people there who maybe can help.
Good that you publish both data + problems! Even better maybe create
issues (with if possible more slimmed down dataset)...

@All: I think as a FOSS gis community we should really try get
GeoPackage flying as a well known defined, working(!) GIS package format.

So: let's all try to work with GeoPackage, and fix problems we
encounter. So we do not get stuck with a defacto (other 1 company)
standard...

Regards,

Richard Duivenvoorde


-------- Forwarded Message --------
Subject: 	[Qgis-user] QGIS problem with GeoPackage database views
Date: 	Sun, 26 Jun 2016 17:37:19 +1000
From: 	Marcus Blake <marcusthemapmaker at gmail.com>
To: 	qgis-user at lists.osgeo.org



*Background (a bit of the business case for non his users..ignore if
required ;-)*

Statistical Agencies traditionally publish statistical data related to
statistical areas separately from the statistical boundaries that
defines these areas. This creates a significant barrier to the use of
these data in general mapping applications and more specialised spatial
analysis systems.
To remove this barrier the Australian Bureau of Statistics (ABS) is
evaluating the use of GeoPackage as an output format for facilitating
the publication of both geospatial and statistical data. GeoPackage has
a number of advantages one of the most significant is the ability to
define database views. A database view is SQL statement that results in
the creation of a “virtual” table that can be  The use of *database
views* within the GeoPackage database container provides a efficient
mechanism to maintain the relationship (the relational join) between the
statistical boundaries (“geometries”) and the statistical (“attribute")
data.

By maintaining this relationship in a single published product this
reduces the barrier to their use in mapping applications, reduces the
probability of introduced error, increases the ease of use of
statistical data in the community.

*The Problem...*

QGIS is not seem to fully support database views in GeoPackage. In some
respects QGIS works as expected, but spatial and attribute selections
and the display of the attribute table produce incorrect results.

Example GeoPackage File:

SA1_BCP_B01_05.gpkg (134 MB)
<https://drive.google.com/open?id=0Bz44nz9iptC5NkF5WlpEZjBoSVk>https://drive.google.com/open?id=0Bz44nz9iptC5NkF5WlpEZjBoSVk

Australian Bureau of Statistics 2011 Census Data
Product: Basic Community Profile. Statistical Tables B01 to B05

Images illustrating the issues
<https://drive.google.com/open?id=0Bz44nz9iptC5YjlrLV9vRFhmVE0>https://drive.google.com/open?id=0Bz44nz9iptC5YjlrLV9vRFhmVE0

Things that work...

1. Views are identified as layers and can be loaded into the Layers Panel
2. Polygons are drawn as expected.
3. The Identify Feature tool can be used to highlight and individual
polygon and display the correct associated attribute data.
4. Styling and classification algorithms can be applied to compose
correct choropleth maps.

Things that do not work...

1. QGIS is not displaying the Attribute Table of a GeoPackage view
correctly. Attribute values are repeated for a single row.
2. Any Select operation that is applied either to the attributes or the
geometries results in the whole layer being selected.

In summary it looks like whilst the geometries of a GeoPackage view are
being interpreted correctly the link to the underlying attributes in a
view is not. Incidentally, neither the latest version of ArcGIS or
MapInfo Profession can interpret views in GeoPackage either and this has
been identified as a bug by both organisations.

Any help from some one who knows their way around how GeoPackage is
interpreting views would be gratefully received.

Marcus.
-------------- next part --------------
_______________________________________________
Qgis-user mailing list
Qgis-user at lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user


More information about the Qgis-developer mailing list