Python wrapper for GeoServer REST API
Full documentation
The documentation for this project is moved here: https://geoserver-rest.readthedocs.io/.
Overview
The geoserver-rest package is useful for the management of geospatial data in GeoServer. The package is useful for the creating, updating and deleting geoserver workspaces, stores, layers, and style files.
Installation
conda install -c conda-forge geoserver-rest
For the pip installation, check the official documentation of geoserver-rest
Some examples
Please check the https://geoserver-rest.readthedocs.io/ for full documentation.
# Import the library
from geo.Geoserver import Geoserver
# Initialize the library
geo = Geoserver('http://127.0.0.1:8080/geoserver', username='admin', password='geoserver')
# For creating workspace
geo.create_workspace(workspace='demo')
# For uploading raster data to the geoserver
geo.create_coveragestore(layer_name='layer1', path=r'path\to\raster\file.tif', workspace='demo')
# For creating postGIS connection and publish postGIS table
geo.create_featurestore(store_name='geo_data', workspace='demo', db='postgres', host='localhost', pg_user='postgres',
pg_password='admin')
geo.publish_featurestore(workspace='demo', store_name='geo_data', pg_table='geodata_table_name')
# For uploading SLD file and connect it with layer
geo.upload_style(path=r'path\to\sld\file.sld', workspace='demo')
geo.publish_style(layer_name='geoserver_layer_name', style_name='sld_file_name', workspace='demo')
# delete workspace
geo.delete_workspace(workspace='demo')
# delete layer
geo.delete_layer(layer_name='layer1', workspace='demo')
# delete style file
geo.delete_style(style_name='style1', workspace='demo')
To create the dynamic style you need to install the extra dependencies as, gdal, seaborn and matplotlib. The below functions will be only available after installing the full package geoserver-rest[all] or geoserver-rest[style],
# For creating the style file for raster data dynamically and connect it with layer
geo.create_coveragestyle(raster_path=r'path\to\raster\file.tiff', style_name='style_1', workspace='demo',
color_ramp='RdYiGn')
geo.publish_style(layer_name='geoserver_layer_name', style_name='raster_file_name', workspace='demo')
# For creating outline featurestyle
geo.create_outline_featurestyle(style_name='style1', color='#ff0000')
Contribution
Geoserver-rest is the open source library written in python and contributors are needed to keep this library moving forward. Any kind of contributions are welcome. Here are the basic rule for the new contributors:
- Please use the request library for the http request.
- One feature per pull request (If the PR is huge, you need to create a issue and discuss).
- Please add the update about your PR on the change log documentation as well.
Citation
Full paper is available here: https://doi.org/10.5194/isprs-archives-XLVI-4-W2-2021-91-2021
@Article{isprs-archives-XLVI-4-W2-2021-91-2021,
AUTHOR = {Tek Bahadur Kshetri, Angsana Chaksana and Shraddha Sharma},
TITLE = {THE ROLE OF OPEN-SOURCE PYTHON PACKAGE GEOSERVER-REST IN WEB-GIS DEVELOPMENT},
JOURNAL = {The International Archives of the Photogrammetry, Remote Sensing and Spatial Information Sciences},
VOLUME = {XLVI-4/W2-2021},
YEAR = {2021},
PAGES = {91--96},
URL = {https://www.int-arch-photogramm-remote-sens-spatial-inf-sci.net/XLVI-4-W2-2021/91/2021/},
DOI = {10.5194/isprs-archives-XLVI-4-W2-2021-91-2021}
}
Metadata
Release files for geoserver-rest 2.10.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| geoserver_rest-2.10.0.tar.gz | 34.8 kB | Without provenance | Details for geoserver_rest-2.10.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| geoserver_rest-2.10.0-py3-none-any.whl | Python 3 | none | any | Details for geoserver_rest-2.10.0-py3-none-any.whl |
Total release size: 59.8 kB
Release files / geoserver_rest-2.10.0.tar.gz
| Download URL | geoserver_rest-2.10.0.tar.gz |
|---|---|
| Size | 34.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
117f582fbdb1e7f4babb87a5f186c5fa38c906809e41dab6030aa655178f3c5f
|
|
BLAKE2b-256 checksum How to use checksums |
358762c102526ad5da885cc466d18e67637c26987f485bd12343bc6fa891ab09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.23
|
Release files / geoserver_rest-2.10.0-py3-none-any.whl
| Download URL | geoserver_rest-2.10.0-py3-none-any.whl |
|---|---|
| Size | 25.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
025ccd63e1e9beba6fec4f3bf587593607c9ec68c5cffbd56a0e9bde9018b31a
|
|
BLAKE2b-256 checksum How to use checksums |
0874664bdaf5e48451eb4ce28e4e610fb4bce47e738313ae7ab04a0d6a54ff70
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.9.23
|
Security for geoserver-rest 2.10.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.