geoserver rest配置
gsconfig-py3的Python项目详细描述
gsconfig-py3
gsconfig-py3是一个python3库,用于通过geoserver restconfig api操作geoserver实例。
gsconfig-py3是python3的gsconfig(https://github.com/boundlessgeo/gsconfig)端口。
使用GeoServer 2.8.1进行测试。
项目分布在MIT License下。
安装
git clone git@github.com:dimitri-justeau/gsconfig-py3.git
cd gsconfig-py3
python setup.py install
获取帮助
gsconfig-py3与gsconfig保持相同的api,因此您可以参考http://boundlessgeo.github.io/gsconfig/获得使用它的帮助。
示例图层创建代码
fromgeoserver.catalogimportCatalogcat=Catalog("http://localhost:8080/geoserver/")topp=cat.get_workspace("topp")shapefile_plus_sidecars=shapefile_and_friends("states")# shapefile_and_friends should look on the filesystem to find a shapefile# and related files based on the base path passed in## shapefile_plus_sidecars == {# 'shp': 'states.shp',# 'shx': 'states.shx',# 'prj': 'states.prj',# 'dbf': 'states.dbf'# }# 'data' is required (there may be a 'schema' alternative later, for creating empty featuretypes)# 'workspace' is optional (GeoServer's default workspace is used by... default)# 'name' is requiredft=cat.create_featurestore(name,workspace=topp,data=shapefile_plus_sidecars)