I have a directory of raster imagery that will be updated continually. From this imagery, I am making Image Pyramids using the Geotool's PyramidBuilder utility. I need to setup a cron job to automatically add raster datastores and layers to Geoserver without using the UI.
After looking at the REST section of the Geoserver manual I was able to add my workspace, "testWS", but trying the create an ImagePyramid datastore did not work.
Since I have access to the datastore, I expanded on the shapefile example and tried to
curl -u admin:geoserver -XPUT -H 'Content-type: text/plain' \
-d '/opt/geoserver_data_dir/2.0.2/data/test_pyramid.pyr' \
"http://localhost:8080/geoserver/rest/workspaces/testWS/datastores/test_pyramid.pyr/external.imagepyramid?configure=all"
Where test_pyramid.pyr is the base of my ImagePyramid at this location.
This gave me an error of "No such datastore: test_pyramid"
Is there a better way to add a new datastore and layer to Geoserver without manually adding each one via the UI? I need help in crafting the proper REST statement that will add an extisting ImagePyramid as a datastore and layer.
Is there some Java code that could do this? I looked at the Geoserver python extensions but they did not have this either.
No comments:
Post a Comment