question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using geopackage tile occur SQLiteException

See original GitHub issue

According to the example, I write the following code:

Set<File> mapFiles = new HashSet<>();
mapFiles.add(new File("data/data/com.imagesky.app/123.gpkg"));
File[] maps = new File[mapFiles.size()];
maps = mapFiles.toArray(maps);

GeoPackageProvider geoPackageProvider = new GeoPackageProvider(maps, this);
List<GeopackageRasterTileSource> sources = geoPackageProvider.geoPackageMapTileModuleProvider().getTileSources();

XYTileSource tileSource = geoPackageProvider.getTileSource(sources.get(0).getDatabase(),
        sources.get(0).getTableDao());
BoundingBox bbox = sources.get(0).getBounds();
mMapView.setTileProvider(geoPackageProvider);
mMapView.setTileSource(tileSource);

There was an exception: 123

After debugging, it was found that there is a problem here: 2

Is it a bug?

Version Info

Version Info:
implementation 'org.osmdroid:osmdroid-android:6.1.5'
implementation 'org.osmdroid:osmdroid-geopackage:6.1.5'

I need help, thank you!!

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
AndresLpzFdzcommented, May 13, 2021

Hello. Testing with Android 25 works fine, but I have the same issue with:

  • Android 29.
  • ‘org.osmdroid:osmdroid-android:6.1.10’
  • ‘org.osmdroid:osmdroid-geopackage:6.1.10’

@spyhunter99 It´s not related with permissions or accessibility to filesystems. Same issue here:

I made debug and found that:

  • “manager.importGeoPackage(file)” calls method “create” from “GeoPackageMetadataDataSource“ class, that calls method “insert” from “GeoPackageDatabase” class, that calls method “quoteWrap” from “SQLUtils” class.
  • In “quoteWrap”, the Android class Parcel makes an operation that returns empty values (only for Android 29).

All of this classes are from NGA Geopackage Library (https://github.com/ngageoint/GeoPackage) and this issue was found and fixed in the 3.3.0 version (see https://github.com/ngageoint/geopackage-android/issues/56)

OsmDroid Geopackage uses “mil.nga.geopackage:geopackage-core:2.0.1” but the current version is “5.1.0”. Do you have any chance to update the NGA Geopackage Library? (Related with: https://github.com/osmdroid/osmdroid/issues/1707). It will fix this issue and maybe other future issues.

@hello-willy Please, did you find any workaround?

Thanks.

0reactions
monsieurtanukicommented, May 21, 2021

@spyhunter99 I don’t know which version you attempted to upgrade to, but perhaps the gap is not that big from version 2.0.1 to version 3.3.0, which would be good enough for us, at least for this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started With GeoPackage
For using direct SQL access, start with the empty geopackage template ... The GeoPackage Tiles option specifies a mechanism for storing raster data...
Read more >
How to create a spatial index in a GeoPackage with GeoTools?
I want to write a GeoPackage file with GeoTools and create a spatial ... SQLiteException: [SQLITE_CONSTRAINT_UNIQUE] A UNIQUE constraint ...
Read more >
osmdroid - Bountysource
I'm dealing with a small test App to load and display a GeoPackage raster layer. The source .gpkg file archive is on getExternalFilesDir(null) ......
Read more >
mil.nga.geopackage.tiles.user.TileDao.delete java code examples ...
Best Java code snippets using mil.nga.geopackage.tiles.user.TileDao.delete (Showing top 5 results out of 315). origin: ngageoint/geopackage-android ...
Read more >
GeoPackage Plugin — GeoTools 29-SNAPSHOT User Guide
Access to a GeoPackage can be performed either low level, using the GeoPackage ... The high level coverage reader can access all tile...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found