Question

I'm pretty new to geoserver so pardon me if this is a noob question. I've spent a good bit of time on Google, Stack Overflow and even reading TFM trying to figure this out.

To add the file to the datastore I'm using the following form

PUT http://myserver:myport/geoserver/rest/workspaces/workspace/datastores/datastore/file.shp

The documentation specifically says that this endpoint is only for deleting or updating/overwriting an item.

I tried deleting the item as a layer

DELETE http://myserver:myport/geoserver/rest/layers/layerid.xml

At first I thought this worked, but then it showed up in the WFS GetCapabilities request and I found the data was still in the shape file directory.

Any advice on this? I can't just delete the Layer and the FeatureType and call it good. The data needs to be removed from the datastore.

Was it helpful?

Solution

I'm still unable to delete the actual source files from the shapefile directory, but deleting the featuretype took care of all WMS and WFS artifacts. For any future searchers who stumble across this question, here's the proper REST url for this sort of request.

DELETE http://myserver:myport/geoserver/rest/workspaces/workspace/datastores/datastore/featuretypes/typename?recurse=true

Make sure not to include the workspace before the typename ala "workspace:typename".

If I ever figure out how to make geoserver remove the actual files from the folder I'll update the answer.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top