I am unable to publish a PostGIS table as a GeoServer layer using the gsconfig library. I was able to create a workspace, data store but was unable to publish layers in the store.
While running the script it gives an error on this line
layer1 = cat.publish_featuretype(name = self.tablename, store = schema_store, native_crs='EPSG:4326', srs='EPSG:4326')
The error is as shown below
File "S:\Coding\Python\sz_env\lib\site-packages\gsconfig_py3-1.0.7-py3.9.egg\geoserver\catalog.py", line 716, in publish_featuretype headers=headers, params=params) UnboundLocalError: local variable 'params' referenced before assignment
I am unable to figure out the error. Found a similar issue in the below link.
I tried Ian's version as mentioned in the above link but got an import error. ImportError: cannot import name 'url' from 'urllib'
from geoserver.catalog import Catalog File "<frozen zipimport>", line 259, in load_module File "S:\Coding\Python\sz_env\lib\site-packages\gsconfig_py3-1.0.8-py3.9.egg\geoserver\catalog.py", line 21, in <module> File "<frozen zipimport>", line 259, in load_module File "S:\Coding\Python\sz_env\lib\site-packages\gsconfig_py3-1.0.8-py3.9.egg\geoserver\layergroup.py", line 4, in <module> ImportError: cannot import name 'url' from 'urllib'