Closed jvanulde closed 4 years ago
The current Docker Image does not work with the SQLIte Provider (Plugin). See also here. Not sure why but could be a lib-dependency problem in the Docker image. @jorgejesus @francbartoli may know.
Quick solution is to use a local pygeoapi
config like my.config.yml
that does not contain a SQLite dataset and use Docker Volume mapping to override the default within the Docker image e.g.:
docker run -p 5000:80 -v $(pwd)/my.config.yml:/pygeoapi/local.config.yml -it geopython/pygeoapi:latest
You should be able to use the project default config file:
pygeoapi-config.yml as my.config.yml
.
The issue is I need to connect to a GeoPackage. I couldn't get it to work using the base install either so I decided to try the Docker image.
You could also use the OGRProvider for GeoPackage, see for example this config snippet.
Fast reply to @jvanulde @justb4 The SQLite plugin
has been replaced with SQLiteGPKGProvider checking what is the problem
Pushed a fix to my branch: https://github.com/jorgejesus/pygeoapi/tree/issue-364 But there is another problem with openapi generation:
File "/pygeoapi/pygeoapi/openapi.py", line 351, in get_oas_30
if v2['type'] == 'date':
TypeError: string indices must be integers
Seems this is related to #367 and there is a PR for this bug
Ok, I was not aware of the SQLite
to SQLiteGPKGProvider
name-change. I also see in plugin.py master
a 'GeoPackage': 'pygeoapi.provider.geopackage.GeoPackageProvider'
, but no corresponding module under pygeoapi/provider
. Or is this a Provider that returns GPKG formats, like downloads? I missed some of the discussions, sorry.
Apart from the SQLite
to SQLiteGPKGProvider
name-change (and #367), I think the Docker Image should also contain the proper SQLite/SpatialLite library (mod_spatialite.so
) ?
@justb4
Well spotted 'GeoPackage': 'pygeoapi.provider.geopackage.GeoPackageProvider'
is surpassed and should be removed
I think that the on the docker image everything is ok with SQLite/SpatialLite (mod_spatialite.so)
ha yes, I see libsqlite3-mod-spatialite
is installed in Docker build.
so a Provider name change required in at least: https://github.com/geopython/pygeoapi/blob/master/docker/default.config.yml#L193 and in other config yml's under docker/
dir.
Updated my fork and commited, the docker image is running
https://github.com/jorgejesus/pygeoapi/tree/issue-364
Testing on the browser the Sqlite
dataprovider from countries is giving an error on json serialization, pytest runs ok the sqlite dataprovider, inside the docker container.
tests/test_sqlite_geopackage_provider.py .......... [100%]
@justb4 I can submit a PR for what was done already and have a "working" docker image but with problems on the sqlite data, or wait until I see what is going on specifically with the json serialization
Autobuild on docker was triggered and image updated, tested locally pulling new image, everything working
Trying to launch pygeoapi container using the following:
Get the following error:
Environment