2

I can not set remote store for my geoserver. Technically, I have two servers. Geoserver is installed on one server and data (rasters) is stored on another server. Data itself is reachable through url. When I set local store for my geoserver (using some test rasters), it works. I do it like so:

requests.post("http://" + geoserverhost + ":" + geoserverport + "/geoserver/rest/workspaces/" + workspace +\
"/coveragestores?configure=all", data="<coverageStore><name>" + layer_name + \
"store</name><workspace>accent</workspace><enabled>true</enabled><advertised>true</advertised><type>" + tif_type +\
"</type><url>file:" + targetPath + \
"</url></coverageStore>", headers={"Content-Type": "text/xml"}, auth=(geo["user"], geo["password"]))

The most important part here, is where I set data url:

"...<url>file:" + targetPath + "</url>"

Here targetPath is local to the geoserver itself. Now, I want to switch to remote data storage. I do it like so:

"...<url>" + targetUrl + "</url>"

Here target url is a valid url reachable form everywhere. But unfortunatelly, it does not work. When I publish my layer, I get some rubbish on the client. So, what is wrong with that and how can I fix it?

  • does it work when you use the GUI? what does the log file show – Ian Turton Dec 12 '17 at 10:37
  • I have not tried it in GUI. I will check it in a minute. – Vitaminus Maximus Dec 12 '17 at 10:38
  • I see this error message in GUI Could not list layers for this store, an error occurred retrieving them: java.io.FileNotFoundException: Invalid input file providedexists: false isDirectory: false. Even though the target url (which points to a remote tif) is perfectly reachable. – Vitaminus Maximus Dec 12 '17 at 10:58
2

The TIFF reader out of the box won't work unless the file is local.

If the URL happens to point to a S3 bucket then this unsupported module (use at your own risk) might help: https://github.com/geotools/geotools/tree/master/modules/unsupported/s3-geotiff

  • 1
    or use a virtual file system to mount the data and use it as if it was local. See here. – pLumo Dec 12 '17 at 15:25

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.