inasafe icon indicating copy to clipboard operation
inasafe copied to clipboard

We should support keywords in geopackage datastore

Open Gustry opened this issue 8 years ago • 8 comments

Problem

We should support keywords in the datastore for read and write with the monkey patching.

For now we have only two datastores :

  • folder : we should use the normal .xml file next to the shp or the tiff.
  • geopackage : we should store the keywords in the geopackage itself.

We will add soon :

  • postgis

Gustry avatar Sep 29 '16 03:09 Gustry

Lets wait for QGIS 3 metadata in datasource support

timlinux avatar Oct 09 '17 08:10 timlinux

I just started a prototype in the PR above.

Gustry avatar Mar 14 '18 14:03 Gustry

hi @timlinux I encoutered a bug related to this. When you load two different layers from the same geopackage they will share the keywords. screenshot from 2018-07-05 10-40-23 screenshot from 2018-07-05 10-40-12

Are you guys still working on @Gustry's PR #4921 ?

mbernasocchi avatar Jul 04 '18 22:07 mbernasocchi

You have this bug because InaSAFE doesn't care about what is after the | in your layer path unfortunately. https://github.com/inasafe/inasafe/blame/master/safe/metadata/base_metadata.py#L196

So I guess you have a XML file sitting next to your geopackage. (one XML keywords file for one geopackage with many layers inside!)

Maybe it would be better to store keywords in the inasafe metadata DB?

BTW, is there not a kind of bug from QGIS? On the source text of your point layer, I would expect to have the layername property. How InaSAFE can know which layer it is in the geopackage? I already noticed this behavior.

Gustry avatar Jul 04 '18 23:07 Gustry

BTW, is there not a kind of bug from QGIS? On the source text of your point layer, I would expect to have the layername property. How InaSAFE can know which layer it is in the geopackage? I already noticed this behavior.

yes, I think this happens when you load a GPKG that has only one layer. after adding multiple layers probably it just picks the first layer. @nyalldawson is it a bug or a feature? :)

mbernasocchi avatar Jul 05 '18 05:07 mbernasocchi

@mbernasocchi I'm a bit lost sorry, can you summarise exactly what the issue is?

nyalldawson avatar Jul 05 '18 05:07 nyalldawson

when you two issues here the first is the one this bug report is about (keywords being per gpkg file and not per layer) but it is not the one I'm asking you about.

the second (The QGIS Question risen by @Gustry) is that when you add a GPKG with only one layer it is loaded as /path/file.gpkg when you add a further layer to this file it is loaded as: /path/file.gpkg|layername=SecondLayer which is the behaviour I'd expect in every case also when adding a GPKG that has only one layer

mbernasocchi avatar Jul 05 '18 05:07 mbernasocchi

@mbernasocchi

Seems like a bug to me too

nyalldawson avatar Jul 07 '18 00:07 nyalldawson