Hi,
I’m investigating to serve Geopackages through Geoserver 2.12. We are using
Docker, with Geoserver 2.12.0 and Tomcat 8.5.20. I just started experimenting
with Geopackage, using Geoserver 2.11 and the Geopackage plugin, when Geoserver
2.12 was released with core support for Geopackage.
With the old setup I was able to serve Geopackages, although the performance
was disappointing, because Geotools version 17 didn’t support the spatial index
from Geopackage. So I’m glad to notice that spatial index support was added to
2.12 as well (https://osgeo-org.atlassian.net/browse/GEOT-5826). Your release
notes (http://blog.geoserver.org/2017/10/17/geoserver-2-12-0-released/) seem to
be outdated: “Currently, GeoPackage vector does not support spatial indexes but
stay tuned, it’s cooking!”
Anyways, it is possible that some of the issues I’m mentioning are due to our
setup and because we’re just dipping our toes in the water when it comes to
Geopackage. My apologies if that turns out to be the case, although I did make
sure that this was not the case. I also decided to write this e-mail first,
before setting out for Jira straight ahead.
First of all, I’m having difficulties adding a new geopackage store. I’m adding
a new datastore by just specifying the data source name and the database file
(SQLite file), using the file browser. In the GEOSERVER_DATA_DIR (which is at
/data in my container) I’ve created a subdirectory, also called “data”, which
is mounted as a volume from the host into my Docker container. Because it is a
subdirectory of the Geserver data dir, I’m getting the following relative path:
file:data/mossel.gpkg. Since there are no other mandatory parameters (the
namespace comes from my workspace), I just click “Save”, but the following
error message appears: Error creating data store, check the parameters. Error
message: Unable to obtain connection: Cannot create PoolableConnectionFactory
(path to 'data/mossel.gpkg': '/usr/local/tomcat/data' does not exist). The
directory /usr/local/tomcat is the Tomcat (Catalina) base dir. When creating a
symbolic link from /usr/local/tomcat to /data/data (by executing the command ln
-s /data/data from within /usr/local/tomcat), I’m not getting this error
message anymore. So I’m fairly certain that this issue is not caused by my
particular setup. My guess is that when the connection to the SQLite database
is being set up, the relative path is not prefixed by the Geoserver data dir.
My second issue occurs when I’m publishing the only layer which is contained in
my geopackage. I’ve just calculated the bbox and WGS84 bbox, and press Save.
When using WMS or WFS, my layer shows up in the Capabilities document. However,
when executing a GetMap request, I’m getting a service exception:
<?xml version="1.0" encoding="UTF-8"?><ServiceExceptionReport version="1.3.0"
xmlns="http://www.opengis.net/ogc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.opengis.net/ogc
http://localhost:8080/geoserver/schemas/wms/1.3.0/exceptions_1_3_0.xsd">
<ServiceException code="internalError">
Rendering process failed
java.io.IOExceptionBorrow prepareStatement from pool failed
[SQLITE_ERROR] SQL error or missing database (no such table:
rtree_mosselenoesterhabitats.mosselenoesterhabitats_geom)
</ServiceException></ServiceExceptionReport>
My apologies for the unwieldy layer name. I’m getting a similar service
exception when doing a WFS GetFeature request. When accessing my geopackage
with the sqlite3 CLI I’m seeing this table (and also the main table) with the
.tables command. But when doing a count on this table (or the main table), I’m
also getting a “no such table” exception. I’m getting a count when enclosing
the table name within double quotes, like: select count(*) from
"rtree_mosselenoesterhabitats.mosselenoesterhabitats_geom". (The result is 577.)
I have created this geopackage with OGR 2.2
(http://www.gdal.org/drv_geopackage.html) as an export of a PostGIS table using
the following command: ogr2ogr -f GPKG mossel.gpkg "PG:dbname='#DB-name#'
host='#Host-IP#' port=#Port# user='#User-name#' password='#Password#'"
"mosselenoesterhabitats.mosselenoesterhabitats". In case anyone is interested,
I can share this geopackage. As a workaround I recreated the geopackage by
appending -nln mosselenoesterhabitats to my OGR command. I don’t care about the
schema name.
And lastly, I’ve also found a weird issue when putting my geopackage in the
Geoserver data dir itself (/data, not mounted as a Docker volume), and adding
it as a store. The database setting at the connection parameters is just
“file:mossel.gpkg”. When clicking Save, I’m getting an overview of the layers I
wish to publish, but it is showing no layers. I’m also not seeing any errors.
When adding a new layer and selecting the geopackage store, I’m also getting an
empty list of layers. I could provide a screenshot if necessary. I’m able to
reproduce this issue on a Windows 7 machine with the standard Geoserver 2.12.0
installation, and putting the geopackage in the data dir. (Because the data dir
is still in c:\program files (standard), I had to start Geoserver as
administrator, because the JDBC driver needs write access to this dir.)
Is anyone able to confirm these issues, and, if this is the case, what would be
the best way to go forward? Next week I might be able to create some patches.
Please let me know if more information is required (data, screenshots). With
regard to my own work, there is no blocking issue because of the workarounds.
They might be useful to someone else who is looking into serving Geopackage
files with Geoserver.
Thank you in advance,
Frank Steggink
Kadaster PDOK
Disclaimer:
De inhoud van dit bericht is uitsluitend bestemd voor geadresseerde.
Gebruik van de inhoud van dit bericht door anderen zonder toestemming van het
Kadaster
is onrechtmatig. Mocht dit bericht ten onrechte bij u terecht komen, dan
verzoeken wij u
dit direct te melden aan de verzender en het bericht te vernietigen.
Aan de inhoud van dit bericht kunnen geen rechten worden ontleend.
Disclaimer:
The content of this message is meant to be received by the addressee only.
Use of the content of this message by anyone other than the addressee without
the consent
of the Kadaster is unlawful. If you have received this message, but are not the
addressee,
please contact the sender immediately and destroy the message.
No rights can be derived from the content of this message.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
Please make sure you read the following two resources before posting to this
list:
- Earning your support instead of buying it, but Ian Turton:
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines:
http://geoserver.org/comm/userlist-guidelines.html
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users