6

I think I figured it out... After checking user30184 comment realized that I was sending petition to .../rest/layers/LayerName.xml Instead of ...rest/layers/workspace:tasmania_cities.xml Tried then with: curl -v -u admin:geoserver -XDELETE "http://testdevt.fractanet.com.mx:181/geoserver/rest/layers/Workspace:layer.xml" and the layer disappeared. Then I ...


5

1. Connect to Catalog cat = Catalog("http://localhost:8080/geoserver/rest","admin", "geoserver") 2. Get some layers and styles lyrs = [list of layers] stls = [list of styles] 3. Create the group layer lg = cat.create_layergroup(groupname) 4. Add the layers and styles to the group layer lg.layers = lyrs lg.styles = stls 5. Save the group layer ...


5

You can specify the optional RULE parameter in your request to specify the rule you want the legend for (see documentation) You must have a Rule with a Name set, so if you modify the default population style: <Rule> <Name>top</Name> <Title>&gt; 4M</Title> <!-- like a linesymbolizer but with a fill ...


4

Could be - it would be useful if /geoserver/rest/layers returned the workspace qualified names, such as: <layer><name>mylayer</name><atom:link rel="alternate" href="http://localhost:8080/geoserver/rest/layers/WK1:mylayer.xml" type="application/xml"/></layer> <layer><name>mylayer</name><atom:link rel="...


4

Try this: curl -v -u admin:geoserver -XDELETE http://localhost:8080/geoserver/rest/my_ws/coveragestores/my_cover?recurse=true You have a space between -X and DELETE Example can be seen at the REST API Docs curl -v -u admin:geoserver -XDELETE "http://localhost:8080/geoserver/rest/workspaces/topp/coveragestores/polyphemus-v1/coverages/NO2/index/granules....


4

Setting the declared SRS is relatively straight forward using the GeoServer REST API. The key to using the REST API is to understand that you only need to send fragments when updating an existing resource, I have seen others in the past trying to build a complete resource XML to POST or PUT and then coming unstuck. To set the declared SRS you need to set ...


4

What @Iant said. As the GeoServer RESTful interface docs says: GeoServer provides a RESTful interface through which clients can retrieve information about an instance and make configuration changes. Using the REST interface’s simple HTTP calls, clients can configure GeoServer without needing to use the Web Administration Interface. So ...


4

No, there is no REST based API for data manipulation, only for configuration. To modify vectors you should use WFS-T


4

I managed this by making a GET request for the coverage: curl -v -u admin:geoserver -H 'Accept: text/xml' -XGET http://localhost:8080/geoserver/rest/workspaces/nurc/coveragestores/mosaic/coverages/mosaic > req.xml editing the required change into the file and then PUTting it curl -v -u admin:geoserver -H 'Accept: text/xml' -H 'Content-type: text/xml' -...


4

I solved the problem. cat_wrksp.create_imagemosaic(ws, "/var/lib/tomcat8/webapps/geoserver/data/coverages/"+ws, workspace=ws)


4

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 unusual for GeoServer. EDIT: Looking at the documentation, here, it seems that you should be using POST rather than PUT. Can you try that? EDIT2: The ...


3

you have to go through geoserver's wms service: http://GEOSERVERBASE/geoserver/wms? service=WMS& version=1.1.1& request=GetMap& layers=jantrik:Storm_Mains& styles=&format=image/png& TRANSPARENT=TRUE& srs=EPSG:2000& bbox=11879566.92588,7000626.9713143,11880134.841974,7001041.8162735& ...


3

You say you're getting code from that site, but you're creating new code with errors in it. The error message you're getting here is 'AttributeError: 'str' objetcs has no attribute 'workspace'' This is because you pass in an argument to the method you've created: publish_featuretype("self" name="Layername", store="store_name", native_crs="4326", srs="EPSG:...


3

Thanks to iant that leads me to the right direction ( the RESTFeatureType tip ): private static void styleTest() throws Exception { String RESTURL = "http://my.server.ip.address/geoserver"; String RESTUSER = "admin"; String RESTPW = "mypassword"; GeoServerRESTReader reader; reader = new GeoServerRESTReader(RESTURL, RESTUSER, RESTPW); ...


3

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 then: Authentication --> Filter Chains --> rest --> Check HTTP Method (check), PUT (check) --> hit 'close' and then 'save'


3

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&request=DescribeCoverage&coverageId=nurc__mosaic


3

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 set. I've never tried but I expect you could send just the XML data with a Content-type: text/xml but it will take longer than sending a compressed file.


3

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/" workspaceName = "<workspaceName>" login = "admin" pwd = "geoserver" # Open a browser and log in to the GeoServer admin page browser = webdriver.Chrome()...


3

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 you get back is the same in the browser and the command line if you go to a URL like: http://localhost:8080/geoserver/rest/layers/topp:states.xml in the ...


3

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 find out about a cached layer so goto (e.g.): http://localhost:8080/geoserver/gwc/rest/layers/topp:states which returns: <GeoServerLayer> <id>...


3

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 application/vnd.ogc.se+xml as is documented in the manual though it would help if QGis made it clearer that it was exporting SE not SLD.


3

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 workspace name = database name; the store name = schema name; postgresql server = geoserver server. That is why my URL is: http://$pghost/geoserver/rest/workspaces/$...


2

I would move the data directory in a location outside the GeoServer since if you deploy in an application container and then you want to do an update or upgrade of GeoServer you might lose the GeoServer configuration as the update/upgrade most probably will wipe out the data dir itself! Internal data director is used mostly for prototyping not for ...


2

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)


2

For using geoserver-manager with Maven, follow this: https://github.com/geosolutions-it/geoserver-manager/wiki#working-with-maven Looking at your post, you declare a dependency instead of a repository, and the log indicates that some class is not found, which may indicate geoserver-manager is not found on your classpath. Check your pom.xml is valid, and ...


2

You can do this via the REST interface by posting to the right URL as indicated here: http://docs.geoserver.org/stable/en/user/rest/api/coverages.html#workspaces-ws-coveragestores-cs-coverages-c-format the new XML representation for the coverage layer. I would use the original one as a template to modify and post back to experiment. As an alternative in ...


2

You can certainly add data to an existing datastore, or remove the data and add replacement data. This is documented in the DataStore REST part of the GeoServer user manual. You'd just use a normal PUT operation. The key aspect is the "update" parameter, which selects whether the intention is append or overwrite. Of course, an append has to make sense for ...


2

While typing the question, I found out how to do it. However, sharing is caring ;-) Maybe this will be useful to somebody else one day. For escaping URLs when using cUrl to access the GeoServer REST API, special characters can be replaced with their respective ASCII codes, so that the problematic example above becomes: curl -v -u admin:geoserver -XDELETE ...


2

As user30184 said, the importer extension has been designed exactly for this job, and will convert the data into the format of the chosen target store (e.g., will import the data into postgis or oracle for you). WFS-T is more geared towards single feature editing than "mass import" and can only handle GML anyways.


2

You have to create a FeatureType before you can create a Layer (i.e. publish it). If you have already created a test layer then fetch the feature type of that one (like http://geoserver.ianturton.com/rest/workspaces/topp/datastores/bgs/featuretypes/test_uk_625k_mapped_feature.xml) but you should be able to delete quite a lot of that and leave it for ...


Only top voted, non community-wiki answers of a minimum length are eligible