3

Can QGIS 2.4 follow Linux soft links?

I want to add a number of raster layers from a store of NED30m elevation data, and thought I'd do it by creating a collection of softlinks in one directory to the elevation files nested in the store.

However, when I try to add a layer from one of the links, QGIS 2.4 complains:

Raster layer: somepath/elev_ned30m_links/n46w105.adf is not a supported raster data source

However, n46w105.adf is the result of a linux ln -s command:

ln -s /Mapstore/ned30m/grid/n46w105_1/w001001.adf

QGIS will open w001001.adf just fine if approached directly, but that means digging down into each tile's directory structure, while the softlinks can be created programmatically with a script.

5

Yes QGIS can follow symbolic links.

However, an ArcGIS Grid coverage can't be linked like that, the raster data is not just the .adf file, it is a directory of related files stored in a parent directory (workspace) with an INFO directory and you can not change either the directory structure or the .adf filename (both of which you did with the ln -s command), see format description:

structure

However, you have another option...

Use your script to create VRT headers pointing to the Grid .adf files and store them in a single directory. Replace the bit in your script that does the ln -s ... with

gdal_translate -of VRT /absolute/path/to/wNNNN.adf /absolute/path/to/vrt/directory/someraster.vrt

Alternatively, if you wish to mosaic the GRIDS, create a textfile with the paths of all the GRIDs (either /path/to/GRID folder path or /path/to/GRID/w001001.adf file path) and then use

gdalbuildvrt -input_file_list /path/to/gridlist.txt your_new_mosaic.vrt
6
  • Ah, I had been lulled into a misunderstanding by QGIS' accepting me just finding and clicking the, one, adf file. (what is with not being able to enter a carriage-return??) Anyway, I've used a VRT only one prior time (I think), to unify a whole host of individually loaded ned tiles in order to treat them as a single unit for purposes of doing a StretchToMinMax. (whoops, I hit Return again...) Thanks, Luke (fwiw, I wanted this to be nicely formatted with whitespa[CR]
    – quagmire
    Jan 2 '15 at 23:33
  • @quagmire comment fields are very limited, probably intentionally. Have a look at the VRT tutorial gdal.org/gdal_vrttut.html
    – user2856
    Jan 3 '15 at 0:27
  • That worked a treat! However, in following up on my recollection about how to treat the multiples as one, I found a reference to a capability of gdal_translate or gdal_warp to recombine multiple .vrts into a single image. It would be most perfect if I could output a single image from all the tiles, or alternatively, load all the tiles as a single virtual image. It might appear from this comment that I ignored your link, but I did visit...
    – quagmire
    Jan 3 '15 at 3:05
  • @quagmire gdalbuildvrt gdal.org/gdalbuildvrt.html
    – user2856
    Jan 3 '15 at 3:10
  • Simple perfection. After creating the individual .vrts as you suggest, I am dumbfounded to find they go together as easily as: % gdalbuildvrt gdalbuildvrt_out.tif n??w???.vrt
    – quagmire
    Jan 3 '15 at 3:22

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.