Package for GeoServer rest API
Project description
Documentation
Installation
pip install wheel
pip install pipwin
pipwin install gdal
pip install geoserver-rest-python
How to use
This library is used for creating workspace, coveragestore, featurestore, styles. Some of the examples are shown below.
Initialize the library
This step is used to initialize the library. It takes parameters as geoserver url, username, password.
from geo.Geoserver import Geoserver
geo = Geoserver('http://localhost:8080/geoserver', username='admin', password='geoserver')
Create workspace
geo.create_workspace('demo')
Create coveragestore
It is helpful for publishing the raster data to the geoserver
geo.create_coveragestore(path=r'path\to\raster\file.tif', workspace='demo')
Create featurestore and publish layer
It is use for connecting the PostGIS with geoserver and publish this as a layer. It is only use for vector data
geo.create_featurestore(store='geo_data', workspace='demo', db='postgres', host='localhost', pg_user='postgres', pg_password='admin')
geo.publish_featurestore(workspace='demo', store='geo_data', pg_table='geodata_table_name')
Upload style and publish it
It is use for uploading SLD files and publish style
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')
Create Coverage Style based on the raster (Dynamic) and apply style
It is use to create the style file for raster data. You can get the color_ramp name from matplotlib colormaps.
#Style name will be the same as the raster_file_name
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')
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
geoserver-rest-0.1.0.tar.gz
(8.6 kB
view hashes)
Built Distribution
Close
Hashes for geoserver_rest-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca51265f4017deca5087697da2423f7c3d7da6edeaea0e123ab253765ef7bfde |
|
MD5 | 08f84f565e4fbb0f1942c2e61e929759 |
|
BLAKE2b-256 | 712fb02288144b4c4e6ab96baaad406b17cdecd2917b53d03c007e157aa107b0 |