I have been looking over the gsconfig.py code for days, and I just do not see any function that can create a layer. The author of the program said though that it is possible to create layers. Does anyone know what function to use to create a layer?
I seem to have mislead you - gsconfig is able to create layers only indirectly (by adding a CoverageStore or DataStore and allowing GeoServer to automatically configure a layer from it.) The good news is that the GeoServer REST API itself does support creating new layers directly, but since gsconfig doesn’t yet support this operation it will take some coding work to do it. You could use a different tool (some alternatives are listed at http://docs.geoserver.org/stable/en/user/restconfig/rest-config-examples/index.html ) or, since you’ve already spent some time digging into the code, maybe you could help add this feature to gsconfig. In case you are interested in this, I’ve included some notes on how to go about it in the rest of this email. You can also contact me via IRC chat at the GeoServer channel on Freenode if you have further questions. http://webchat.freenode.net/?channels=#geoserver will let you connect to this chat in a web browser.)
gsconfig is designed to use an Unsaved variant of any REST resource type for resources that are being created directly - so in order to create layers without relying on auto-configuration we would need to have those. The general pattern is to add a method on the Catalog class which creates the thing and takes as parameters any required fields, and returns a new UnsavedThing. For example, see the create_datastore method in the Catalog class:
UnsavedDataStore is a very small class which extends DataStore and overrides its “save_method” field to POST instead of PUT and ensures that all required fields are marked as “dirty” (ie, will be included in the REST request that is generated.) Similar variants would be required for Layer and Coverage in order to configure new raster layers - both will closely follow the design of DataStore.
I have been looking over the gsconfig.py code for days, and I just do not see any function that can create a layer. The author of the program said though that it is possible to create layers. Does anyone know what function to use to create a layer?
Thanks!
Katie
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d
So when I add a CoverageStore with gsconfig.py, how can I get Geoserver to
automatically publich a layer from that store? That's all the functionality
I really need.
Also, I would love to help develop your tool, but I think my skill level is
way too low to provide any real value.
So when I add a CoverageStore with gsconfig.py, how can I get Geoserver to
automatically publich a layer from that store? That’s all the functionality
I really need.
Also, I would love to help develop your tool, but I think my skill level is
way too low to provide any real value.
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d