2

I'm trying to use the REST API to upload a GPKG file (SQLite with vector data) into GeoServer with curl but I always get Error auto-configuring coverage.

The (wrong) command I'm currently using is curl -v -u <USR>:<PASSWORD> -XPUT -H "Content-type: application/geopackage+vnd.sqlite3" --data-binary @<PATH&FILENAME.GPKG> "http://<IP>:<PORT>/geoserver/rest/workspaces/<MYWORKSPACE>/coveragestores/<FILENAME>/file.geopackage%20(mosaic)"

After @IanTurton’s comments below, I noticed that I'm using the wrong endpoint since "geopackage%20(mosaic)" is for raster data only.

Which is the right endpoint I have to use with a vector gpkg?

I tried searching online but I found nothing.

0

2 Answers 2

6

Mixing the comment by @AndreaAime and the answer by @IanTurton, I finally made a working curl for Geopackages containing SQLite vector data:

curl -v -u <USR>:<PASSWORD> -XPUT -H "Content-type: application/x-sqlite3" --data-binary @<PATH&FILENAME.GPKG> http://<IP>:<PORT>/geoserver/rest/workspaces/<MYWORKSPACE>/datastores/<FILENAME>/file.gpkg

2

It seems that you can add geopackages in the same way as you add shapefiles but with the file extension .gpkg:

curl -v -u admin:geoserver -XPUT -H "Content-type: application/zip" --data-binary @codepoint.zip http://localhost:8080/geoserver-2.17.2/rest/workspaces/ian/datastores/cp/file.gpkg
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.