ngageoint / geopackage-js

GeoPackage JavaScript Library
http://ngageoint.github.io/geopackage-js/
MIT License
304 stars 78 forks source link

Difficulty loading raster tiles from generated GPKG #122

Closed zacharyburnett closed 6 years ago

zacharyburnett commented 6 years ago

I am creating new geopackages in Python from Numpy arrays, using Rasterio to create subdatasets.

I can open the geopackage in QGIS and view the rasters, but they do not show at all in Leaflet, although the console shows Draw tile messages as if the tiles are being rendered.

I am not all too familiar with geopackage creation, so perhaps it is my fault and I am not correctly initializing something.

danielbarela commented 6 years ago

If you can send me the GeoPackage you created I can take a look

zacharyburnett commented 6 years ago

I don't know what I changed, but now the console gives the following error, which is more helpful than before:

leaflet-geopackage.js:11910 Uncaught TypeError: Cannot read property 'adjustTileMatrixLengths' of undefined
    at new GeoPackageTileRetriever (leaflet-geopackage.js:11910)
    at leaflet-geopackage.js:868
    at GeoPackage.<anonymous> (leaflet-geopackage.js:5191)
    at leaflet-geopackage.js:2911
    at leaflet-geopackage.js:2938
    at leaflet-geopackage.js:17884
    at Object.whilst (leaflet-geopackage.js:22148)
    at Adapter.each (leaflet-geopackage.js:2925)
    at Adapter.all (leaflet-geopackage.js:2907)
    at GeoPackageConnection.all (leaflet-geopackage.js:2472)

Here is the geopackage I'm using. From reading online I think my problem is a malformed tile matrix, but I have not idea how to access that table to check.

https://drive.google.com/drive/folders/1oJcqJW4kvE0-Hxv7N7DSxPrX1kRjz6_k?usp=sharing

danielbarela commented 6 years ago

This GeoPackage has a tile table with the 2d-gridded-coverage type. This extension is not support (currently) by GeoPackage-JS. I will fix the bug that is causing that table to show up in the list of tile tables.

On a side note, DB Browser For SQLite (https://sqlitebrowser.org/) works well for opening GeoPackages to check on things.

zacharyburnett commented 6 years ago

Thank you! I will attempt to get it into a tiled format.