4

Environment: Win10 and GDAL 2.1.0 in the OSGEO4W shell, 64 bit. Edits made below.

I have temporary access to a whole-of-country dataset in ESRI's Arc/Info binary grid format, which according to this - http://www.gdal.org/frmt_various.html - should be supported by gdal. Its accessible through webDAV.

The whole dataset is about 200GB, but I only need a small portion of it, so i would like to use something like

gdal_translate -projwin_src EPSG:4283 -projwin xmin ymin xmax ymax src_dataset=http://user:pass@path_to_file/w1001001.adf dst_dataset=local_path

to get the portion I need. The command fails out with error 4 'failed to create temporary file', because I don't have write access to the remote location.

I've tried incorporating "--config CPL_TMPDIR local_folder" into the command, and I've tried setting it separately (set CPL_TMPDIR=local_path), but that doesn't seem to help much. The next problem is error 4: "local_folder\w1001001.adf is not recognised as a supported file format', which contradicts the documentation.

SOLVED: per comment below, one must use vsicurl, e.g.

gdal_translate --config CPL_TMPDIR D:\local_folder -projwin_srs EPSG:4283 -projwin ulx uly lrx lry /vsicurl/http://user:pass@webdav-url/w001001.adf D:\local_folder\output.tif

works on both tif and adf source files.

9
  • That syntax looks wrong - the src_file= and dst_file= parts are bogus.
    – BradHards
    Jul 9, 2016 at 4:42
  • ....its a code snippet example, I've replaced the actual paths with a generic tag. You don't need to see the full paths on my machine to understand the command syntax.
    – obrl_soil
    Jul 9, 2016 at 4:46
  • I mean it should be gdal_translate -projwin xmin ymin xmax ymax http://<remote_path> <local path>. I'm not asking for the paths, I'm trying to make sure the basic syntax is OK.
    – BradHards
    Jul 9, 2016 at 5:02
  • oh i see what you mean now - the tags are actually -src_dataset -dst_dataset, but their use is optional. removing them has had no effect. I've managed to get past the original error by making the --config CPL_TMPDIR=X the first parameter after 'gdal_translate', but now its saying that the .adf file is not supported, which contradicts the documentation...
    – obrl_soil
    Jul 9, 2016 at 5:05
  • 4
    Try /vsicurl/http://the/url erouault.blogspot.com/2012/05/…
    – user2856
    Jul 9, 2016 at 8:53

2 Answers 2

4

I suggest to build a VRT around the full datasource:

gdal_translate -of VRT http://user:pass@path_to_file/w1001001.adf local_path.vrt

and work on with that. GDAL tries to write its .aux.xml file next to the source file, and will fail on that with an external source.

1
  • Tried that. Seemed like it was working at first (lot of wifi activity at least) but after ~40 minutes it failed out with 'ERROR 1: Failed writing body (0 != 1380)
    – obrl_soil
    Jul 10, 2016 at 2:10
3

Use the vsicurl virtual file system syntax.

/vsicurl/http://the/url

E.g

gdal_translate --config CPL_TMPDIR D:\local_folder -projwin_srs EPSG:4283 -projwin ulx uly lrx lry /vsicurl/http://user:pass@webdav-url/w001001.adf D:\local_folder\output.tif

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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