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

2016-06-27 Thread Jukka Rahkonen
Marcus Blake  writes:

...

 
> 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.

I made some quick tests by making queries directly with SQL from spatialite-gui

SELECT * FROM "sa1_b01_map_v"
order by SA1_MAINCODE_2011
limit 100;

Looks good with no duplicates.

select * from "sa1_b01_map_v"
where SA1_7DIGITCODE_2011=1135752;

One row returned.

You should give more detailed examples about what you do, what you get, and
what is the expected result.

-Jukka Rahkonen-

> Marcus.
> 
> 
> ___
> Qgis-user mailing list
> Qgis-user  lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user


___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

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

2016-06-27 Thread Richard Duivenvoorde
On 26-06-16 09:37, Marcus Blake wrote:

> 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.

FYI further discussion via dev list:

https://lists.osgeo.org/pipermail/qgis-developer/2016-June/043464.html

___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] QGIS problem with GeoPackage database views

2016-06-26 Thread Marcus Blake
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
 

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
 

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.___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user