ngageoint / geopackage-mapcache-android

GeoPackage MapCache Android App
https://ngageoint.github.io/geopackage-mapcache-android
MIT License
40 stars 16 forks source link

Fails to load GDAL's raster GPKGs #23

Closed fnorf closed 7 years ago

fnorf commented 8 years ago

gdal_translate -of GPKG ERDC_Whitehorse_GeoPackage.gpkg ERDC_Whitehorse_GeoPackage.gdal.gpkg

If I try to open the resulting file on my phone, mapcache shortly pauses/freezes, then I get a popup with the following error message:

GeoPackage Errors ERDC_Whitehorse_GeoPackage.gdal Errors:

near ".": syntax error (code 1): ,while compiling: PRAGMA table_info(ERDC_Whitehorse_GeoPackage.gdal)

fnorf commented 8 years ago

Poking in the dark I dropped all triggers and all new tables from GDAL's version, still got the same error.

bosborn commented 8 years ago

It looks like using a . in the name might be creating an invalid sqlite table name "ERDC_Whitehorse_GeoPackage.gdal".

Can you try something like:

gdal_translate -of GPKG ERDC_Whitehorse_GeoPackage.gpkg Whitehorse_gdal.gpkg

fnorf commented 8 years ago

Ah, that will be it! You need to quote those table names. A point in the name might be silly and misleading but valid. :)

I guess this is the offending line: https://github.com/ngageoint/geopackage-android/search?utf8=%E2%9C%93&q=table_info

In these too I'd say, did not look further: https://github.com/ngageoint/geopackage-java/search?utf8=%E2%9C%93&q=table_info https://github.com/ngageoint/geopackage-core-java/search?utf8=%E2%9C%93&q=table_info

bosborn commented 8 years ago

Thanks. It will be more cases than just the pragmas. From a quick test queries that use the table names in the statements as well. I'll go through and try to find all cases when I get the chance. Until then if you can avoid .'s, things should work.

bosborn commented 8 years ago

The changes are on the develop branch of geopackage-android, geopackage-core-java, and geopackage-java. They will go out with the next release.

bosborn commented 7 years ago

Quotation fixes for this project were released as part of:

Also fixed in geopackage-java 1.2.1