Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We need to automatize process of creating datastore and publishing geotiff layer. Also, before publishing we need to change Declared SRS and to save Native Bounding Box to our database.

Geotiff file will be uploaded to the file system by our customer.

Yes, I`ve seen Create a Layer in GeoServer using REST, also I see that there is publishGeoTIFF(...) methods in Geoserver-manager in

Another solution that I see - is to make all the operations with bot written with selenium or htmlUnit.

Could you please suggest us, what approach is more elegant and suitable for us. Is there any actions in our workflow that we will not be able to do with Geoserver-manager.

P.S.: we also have seen at gsrcj project, but it can`t create programmatically geotiff layer.

Thank you in advance, Dmitry.

share|improve this question

Unless your app is written in Java then the REST approach is the most elegant as it can be coded in any language that has an HTTP lib (all of them).

Any solution using selenium or something similar should be an absolute last resort, changes to the REST API will likely remain backward compatible so you can upgrade GeoServer with confidence, the UI will frequently change meaning you will need to review what you've done with Selenium on every update, it's a very brittle solution.

share|improve this answer
up vote 4 down vote accepted

I was able to do it using geoserver-manager.

The code is:

GeoServerRESTPublisher geoServerRESTPublisher = new GeoServerRESTPublisher("http://localhost:8090/geoserver", "admin", "geoserver");
geoServerRESTPublisher.publishGeoTIFF("myWS", "myTiff", "myTiff",
        new File("d:\\work\\myTiff.tif"), "EPSG:900913",
        GSResourceEncoder.ProjectionPolicy.REPROJECT_TO_DECLARED, defaultRasterStyle, null);

Now I am working on how to get bbox of just the created layer.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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