6
votes
Creating Workspace, Data Store and Layer via GeoServer REST API?
I use node/request;
to add a workspace
curl -u admin:geoserver -v -XPOST -H Content-Type:application/xml -d @test.xml http://192.168.1.254:8083/geoserver/rest/workspaces
curl -u admin:geoserver -v ...
6
votes
Accepted
How to properly post style to geoserver
The GeoServer REST documentation is quite clear as to what format to use. So assuming you are using SLD 1.0 you need to POST a application/vnd.ogc.sld+xml document to the /styles endpoint, optionally ...
6
votes
Accepted
Problem with GeoServer modifying a style when uploading an SLD via the REST API
You are mixing an SLD 1.1.0 file (or Symbology Encoding) with the SLD 1.0.0 format so GeoServer is filtering out the 1.1.0 elements to make it compliant with 1.0.0. You need to set the content-type to ...
6
votes
Getting 404 error when making WMS call on GeoServer
A colon : between the workspace and the layer is missing. If the layer exists in the provided workspace, the URL below should work:
Request URL: http://<domain>:<port>/geoserver/<...
6
votes
Accepted
Adding a geopackage (gpkg) to GeoServer through REST API
Mixing the comment by @AndreaAime and the answer by @IanTurton, I finally made a working curl for Geopackages containing SQLite vector data:
curl -v -u <USR>:<PASSWORD> -XPUT -H "...
6
votes
Accepted
Error publishing PostGIS Layer to Geoserver using Python gsconfig
That is one of the bugs I proposed a fix for a while back - You might be better off using my fork. However, given the lack of progress being made fixing things on any of the forks out there it might ...
6
votes
Accepted
How to extract GeoServer usage details using REST API?
The monitoring module allows to collect information about requests regardless of how they are made (POST/GET, different versions of the protocol). However, the database storage for the module has ...
5
votes
Upload many layers from PostGIS database to GeoServer using curl
Example of a simple bash script to create Geoserver layers for all tables of a given Postgresql schema.
The workspace and the store should already exist in Geoserver. In this example I use the ...
4
votes
Accepted
get geotiff info like width, height, pixel size with Geoserver REST API
You do not, the REST API does not provide this information. You can however get it from a WCS 2.0 DescribeCoverage call, e.g.:
http://demo.geo-solutions.it/geoserver/ows?service=WCS&version=2.0.1&...
4
votes
Accepted
Unable to publish a GeoTiff file in GeoServer with curl tool
Finally I found the answer in my question. It helped me the following topic:
http://osgeo-org.1560.x6.nabble.com/Geoserver-REST-Question-td3796644.html
and the answer of @iant because I figured out ...
4
votes
Creating new GeoServer user through rest api?
For anyone who's still getting problems with this, it's been fixed in v2.15.1. I've updated it and it all works no problems now, although I'm using the rest/security/usergroup/users/ route as I get a ...
4
votes
Geoserver - How to set up a workspace when creating a new image mosaic using gsconfig?
I solved the problem.
cat_wrksp.create_imagemosaic(ws, "/var/lib/tomcat8/webapps/geoserver/data/coverages/"+ws, workspace=ws)
4
votes
405 Method not Allowed on uploading a shapefile via REST API on GeoServer
Try running it without the apache proxy first, that will rule out it being in the web server. You should be able to point to localhost:8000 in order to get to GeoServer directly.
The 405 error is ...
4
votes
Accepted
Http 500 error when creating workspace using GeoServer REST-API
Seems that despite documentation says otherwise GeoServer do not support json-based requests. Only XML works.
It turns out that json is supported, but the documentation itself is wrong. You need to ...
4
votes
Creating and publishing a new layer in Geoserver using Geoserver Rest API
The url seems to be invalid.
I use:
${geoserver.url}/geoserver/rest/workspaces/${geoserver.namespace}/datastores/${geoserver.store}/featuretypes
And it's fine. Ex. localhost:8080/geoserver/rest/...
4
votes
GeoServer Error Bucket S3 Plugin
You are sending an XML file but it is not valid XML because your entity reference contains an invalid character.
Actually, you didn't want to use &awsRegion= as an entity but you forgot to XML ...
4
votes
Accepted
Change GeoServer admin password via REST
I suspect you've found a bug, it all works nicely if between setting the new password and testing it via REST you login into the GUI, or call a reload of the config (using the old password) via REST.
...
4
votes
Accepted
Create a parametrized SQL view based layer using geo.Geoserver Python API
You could do it without a dedicated GeoServer library, only using GeoServer REST in combination with requests library and since you already said you created the layer "by hand", then this ...
4
votes
Accepted
GeoServer REST API | Unable to get records more than 100 records
If you look at the configuration documentation: https://docs.geoserver.org/latest/en/user/extensions/monitoring/configuration.html
you will see that it mentions the following:
Memory Storage
With ...
3
votes
Add new style using REST api in geoserver
If you're sure that .xml is valid (you can check its validation via this online tool) you need to add the following line to your request's header as mentioned in geoserver official documentation (here)...
3
votes
Add new style using REST api in geoserver
It's not clear what libraries you are using but as the example you link to shows you need to send the sld file (zipped and encoded) to http://localhost:8080/geoserver/rest/styles with the Content-type ...
3
votes
Creating Coveragestore GeoTIFF using REST API
2020 update,
Using geoserver-rest library(pip install geoserver-rest). The example case is below,
#import and initialize library
from geo.Geoserver import Geoserver
geo = Geoserver('http://localhost:...
3
votes
Error adding store through REST API to GeoServer
You need to add the workspace name when creating coverage store. In your case XML will look like this:
<coverageStore>
<name>fff</name>
<enabled>true</enabled>
<...
3
votes
how to set default style from particular workspace using gsconfig?
you can do:
my_style = 'my_ws:my_style'
style = cat.get_style(my_style)
layer = cat.get_layer('layername')
layer.default_style = style
cat.save(layer)
3
votes
Accepted
HTTP 500 error when uploading shapefile to GeoServer with C#
I had the same issue, and it was resolved after setting the "Activate HTTP method matching", and checking PUT method.
Access your geoserver web interface ( http://localhost:8070/geoserver/web ), ans ...
3
votes
Accepted
Creating image pyramid datastore using GeoServer REST API?
After some time I have succeeded in creating a imagepyramid datastore.
I will write it down here so someone else can make use of it.
To create the datastore, first create a xml file yourdatastore....
3
votes
Accepted
Creating Workspace, Data Store and Layer via GeoServer REST API?
Here's a workaround using Selenium, which opens a web browser and programatically clicks the 4 checkboxes:
from selenium import webdriver
serverUrl = "http://<my_geoserver>:8080/geoserver/web/"...
3
votes
Accepted
Deleting datastore (and its content) with GeoServer REST API?
You need the recurse parameter set to true. GeoServer will then delete all the layers in the datastore.
3
votes
Accepted
Difference between outcome of REST query through browser and through cURL
Actually, this has nothing to do with the way you make the request. RESTful services can provide different representations of their state depending on the output format you request. So the information ...
3
votes
Enabling tile caching for layer?
As with all questions relating to a REST API the trick is to make the change once using the GUI and then request that resource from the REST API and see what the required change is.
So you need to ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
geoserver-rest-api × 276geoserver × 194
curl × 23
python × 22
rest × 14
sld × 13
shapefile × 11
geowebcache × 11
gsconfig × 10
geoserver-manager × 10
layers × 9
postgis × 7
c# × 7
style × 7
image-mosaic × 7
geotiff-tiff × 6
wms × 5
php × 5
javascript × 4
kml × 3
java × 3
extents × 3
netcdf × 3
security × 3
proxy × 3