1

I have a GeoServer store of type "Directory of Shape Files". I have layers defined in that store corresponding to specific shapefiles. Some of my layers have been renamed. I'm looking for how to pull from GeoServer the name of the shapefile a particular layer from this store is referencing. Seems like it should be easy but I cannot find it anywhere...

Do I have to look in the XML files?

This is an old GeoServer running 2.8.2, I'm planning to move some layers to a newer version, and I want to make sure I get the right data files...

2

This REST call will get the layers (called featuretypes in this API)

http://localhost:8080/geoserver/rest/workspaces/<workspace>/datastores/<store of shape files dir>/featuretypes.xml

Which returns a list of the layers published. So for each you can then look at its details like this:

http://localhost:8080/geoserver/rest/workspaces/<workspace>/datastores/<store of shape files dir>/featuretypes/<name of layer>.xml

Now look at the <nativeName> tag. It has the name of the shapefile.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.