TransWikia.com

Creating directory of shapefiles using gsconfig

Geographic Information Systems Asked by Paul Nicoara on February 5, 2021

I would like to use gsconfig-py3 1.0.8 Python library to create a store that can receive multiple shapefiles, i.e. "Directory of spatial files (shapefiles)" (as it is in geosever), then add multiple shapefiles to it.

I am able to create a store by using the create_featurestore from gsconfig, however it result in a single shapefile store.

from geoserver.catalog import Catalog
cat = Catalog(geoserver_uri + 'rest/', username="username", password="password")
data = r'../file.zip'
store = cat.create_featurestore("test", data, workspace=workspace)
cat.add_data_to_store(store, store.name, data, workspace)

If i try to add another shp it gives the error:

geoserver.catalog.ConflictingDataError: There is already a store named

When I use the create_datastore the store type is not even specified on GeoServer under Data – Stores – Type, while Data Type has an exclamation sign.

store = cat.create_datastore("test", workspace=workspace)
cat.add_data_to_store(store, store.name, data, workspace)

If I try to add a shapefile to it, I get:

geoserver.catalog.FailedRequestError: Error code (500) from GeoServer:
Store ‘test’ already exists in workspace

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP