gicait / geoserver-rest

Python library for management of geospatial data in GeoServer.
https://geoserver-rest.readthedocs.io
MIT License
197 stars 79 forks source link

`create_datastore` fails for GeoPackage #142

Closed pesekon2 closed 8 months ago

pesekon2 commented 8 months ago

I believe that the type of the store is not correctly set when trying to create a datastore based on a GeoPackage. I get the warning icon in GeoServer web interface. And if I try to publish the datastore with geo.publish_featurestore, I get the following error:

Traceback (most recent call last):
  File "/home/pesek/workspace/scripts/geoserver/create_coverage.py", line 9, in <module>
    geo.publish_featurestore(workspace='highways', store_name='highways', pg_table='highways')
  File "/home/pesek/workspace/scripts/.direnv/python-3.10.12/lib/python3.10/site-packages/geo/Geoserver.py", line 1901, in publish_featurestore
    raise GeoserverException(r.status_code, r.content)
geo.Geoserver.GeoserverException: Status : 500 - b'Failed to find the datastore factory for highways, did you forget to install the store extension jar?'
iamtekson commented 8 months ago

I am sorry, but the current implementation only supports the PostGIS table might not work from geopackage. Looks like we need another PR for uploading the geopackage.

iamtekson commented 8 months ago

Not sure but the geo.create_shp_datastore might also work to create the geopackage datastore. Can you check and verify that?

pesekon2 commented 8 months ago

I am sorry, but the current implementation only supports the PostGIS table might not work from geopackage. Looks like we need another PR for uploading the geopackage.

Pity as we work solely with geopackages. But nice work otherwise!

Not sure but the geo.create_shp_datastore might also work to create the geopackage datastore. Can you check and verify that?

If I zip the geopackage, I am able to create the datastore, but it is (as expected) defined as a shapefile datastore.

image

Thus, I am not able to add any layer to that as the layers are not found (it is probably searching only for shapefiles). The same applies to the web interface. If I create a datastore based on geopackage using the web interface, I can see my layers there.

image

iamtekson commented 8 months ago

This issue is solved by #143. I will soon release the new version.

pesekon2 commented 8 months ago

Great, thanks.