Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete basket support #552

Open
gacarrillor opened this issue Oct 1, 2024 · 2 comments
Open

Delete basket support #552

gacarrillor opened this issue Oct 1, 2024 · 2 comments

Comments

@gacarrillor
Copy link
Contributor

gacarrillor commented Oct 1, 2024

Just like it is possible to delete datasets via --delete --dataset MyDataset, could deleteObjectsOfBasket() (see link) be made accessible via ili2db operations (e.g., --delete --basket ...)?

@claeis
Copy link
Owner

claeis commented Oct 30, 2024

this should already work (--delete --baskets BID)

@gacarrillor
Copy link
Contributor Author

gacarrillor commented Oct 31, 2024

@claeis, I made a couple of attempts with --delete --baskets BID with no success:

Sample GeoPackage (data.zip).

Command 1:

java -jar /home/germap/.local/share/QGIS/QGIS3/profiles/test_plugins_2/python/plugins/QgisModelBaker/libs/modelbaker/iliwrapper/bin/ili2gpkg-5.2.0/ili2gpkg-5.2.0.jar --delete --dbfile /docs/tr/og/projects/qgismodelbaker/sample_data/baskets_datasets_cities/data.gpkg --baskets '805a9ec9-8dcf-4774-995c-5430dd1a9adf'

Result 1:

Info: dburl <jdbc:sqlite:/docs/tr/og/projects/qgismodelbaker/sample_data/baskets_datasets_cities/data.gpkg>
Info: dbusr <>
Info: ili2gpkg-5.2.0-SNAPSHOT-66511033be8345c94260e6f852e57ae82d8becc8
Info: ili2c-5.6.0-SNAPSHOT-76299ce3983fa9ebc8f23b7976816a89c9fdefb1
Info: iox-ili-1.23.2-SNAPSHOT-40e366dabc2783db597840a1a1a73658ba328c8f
Info: java.version 11.0.24
Info: user.name <germap>
Info: maxMemory 4050944 KB
Info: currentTime 2024-10-31 15:01:34
no datasetName given

Command 2:

java -jar /home/germap/.local/share/QGIS/QGIS3/profiles/test_plugins_2/python/plugins/QgisModelBaker/libs/modelbaker/iliwrapper/bin/ili2gpkg-5.2.0/ili2gpkg-5.2.0.jar --delete --dbfile /docs/tr/og/projects/qgismodelbaker/sample_data/baskets_datasets_cities/data.gpkg --baskets '805a9ec9-8dcf-4774-995c-5430dd1a9adf' --dataset 'Dataset 7'

Result 2:

Info: dburl <jdbc:sqlite:/docs/tr/og/projects/qgismodelbaker/sample_data/baskets_datasets_cities/data.gpkg>
Info: dbusr <>
Info: ili2gpkg-5.2.0-SNAPSHOT-66511033be8345c94260e6f852e57ae82d8becc8
Info: ili2c-5.6.0-SNAPSHOT-76299ce3983fa9ebc8f23b7976816a89c9fdefb1
Info: iox-ili-1.23.2-SNAPSHOT-40e366dabc2783db597840a1a1a73658ba328c8f
Info: java.version 11.0.24
Info: user.name <germap>
Info: maxMemory 4050944 KB
Info: currentTime 2024-10-31 15:06:49
Info: dburl <jdbc:sqlite:/docs/tr/og/projects/qgismodelbaker/sample_data/baskets_datasets_cities/data.gpkg>
Info: dbusr <>
Info: databaseProduct <SQLite>
Info: databaseVersion <3.43.0>
Info: driverName <SQLite JDBC>
Info: driverVersion <3.43.0.0>
Info: max active DB statements <0>
Info: compile models...
Info: lookup model <City_V1> in repository <jdbc:sqlite:/docs/tr/og/projects/qgismodelbaker/sample_data/baskets_datasets_cities/data.gpkg/>
Info: lookup model <GeometryCHLV95_V1> 2.3 in repository <jdbc:sqlite:/docs/tr/og/projects/qgismodelbaker/sample_data/baskets_datasets_cities/data.gpkg/>
Info: lookup model <CoordSys> 2.3 in repository <jdbc:sqlite:/docs/tr/og/projects/qgismodelbaker/sample_data/baskets_datasets_cities/data.gpkg/>
Info: lookup model <Units> 2.3 in repository <jdbc:sqlite:/docs/tr/og/projects/qgismodelbaker/sample_data/baskets_datasets_cities/data.gpkg/>
Info: ilifile </home/germap/.ilicache/jdbc&003asqlite&003a/docs/tr/og/projects/qgismodelbaker/sample_data/baskets_datasets_cities/data.gpkg/Units-20120220.ili>
Info: ilifile </home/germap/.ilicache/jdbc&003asqlite&003a/docs/tr/og/projects/qgismodelbaker/sample_data/baskets_datasets_cities/data.gpkg/CoordSys-20151124.ili>
Info: ilifile </home/germap/.ilicache/jdbc&003asqlite&003a/docs/tr/og/projects/qgismodelbaker/sample_data/baskets_datasets_cities/data.gpkg/CHBase_Part1_GEOMETRY_V1.ili>
Info: ilifile </home/germap/.ilicache/jdbc&003asqlite&003a/docs/tr/og/projects/qgismodelbaker/sample_data/baskets_datasets_cities/data.gpkg/model.ili>
Info: process data file...
Info: ...delete done

Findings:

  1. Passing a --delete with no --dataset and no --baskets params returns the same result as Command 1, that is, Result 1. So, it seems that --baskets is not making a difference here.
  2. After executing Command 2, the whole dataset (in this case, Dataset 7) is deleted, not only the basket that was passed (in this case, '805a9ec9-8dcf-4774-995c-5430dd1a9adf').

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants