在vrt文件中使用zip的相对路径(vsizip)?

时间:2017-02-02 13:31:36

标签: docker gis tiff zipfile gdal

我正在尝试构建一个包含大量压缩文件的vrt文件。 我发现这个xml-command将zip文件中的tiff文件添加到vrt:

<SourceFilename relativeToVRT="1">/vsizip/c:/data/DSM_633_54_TIF_UTM32-ETRS89.zip/DSM_1km_6333_546.tif</SourceFilename>

这很好用,但问题是它只适用于绝对路径。由于我在码头工作,我不能使用绝对路径,只能使用相对。

如果我只使用相对路径,它似乎无法找到图像(当我在QGis中打开它时,它全部为黑色并且值为1e [巨大数字])。

将zip文件中的tiff图像添加到vrt时,有没有办法使用相对路径

1 个答案:

答案 0 :(得分:1)

我认为你可以使用绝对路径:

这是一个例子(注意他是双正斜杠)。

pksorensen@swarm-master-4D58E13F-0:~$ docker -H 172.16.0.5:2375 run --rm -v $(docker -H 172.16.0.5:2375 volume create -d azurefile -o share=dhm-danmarks-hoejdemodel):/data  geodata/gdal gdalinfo /vsizip//data/DSM_633_54_TIF_UTM32-ETRS89.zip/DSM_1km_6333_546.tif
Driver: GTiff/GeoTIFF
Files: /vsizip//data/DSM_633_54_TIF_UTM32-ETRS89.zip/DSM_1km_6333_546.tif
Size is 2500, 2500
Coordinate System is:
PROJCS["ETRS89 / UTM zone 32N",
    GEOGCS["ETRS89",
        DATUM["European_Terrestrial_Reference_System_1989",
            SPHEROID["GRS 1980",6378137,298.257222101,
                AUTHORITY["EPSG","7019"]],
            TOWGS84[0,0,0,0,0,0,0],
            AUTHORITY["EPSG","6258"]],
        PRIMEM["Greenwich",0,
            AUTHORITY["EPSG","8901"]],
        UNIT["degree",0.0174532925199433,
            AUTHORITY["EPSG","9122"]],
        AUTHORITY["EPSG","4258"]],
    PROJECTION["Transverse_Mercator"],
    PARAMETER["latitude_of_origin",0],
    PARAMETER["central_meridian",9],
    PARAMETER["scale_factor",0.9996],
    PARAMETER["false_easting",500000],
    PARAMETER["false_northing",0],
    UNIT["metre",1,
        AUTHORITY["EPSG","9001"]],
    AXIS["Easting",EAST],
    AXIS["Northing",NORTH],
    AUTHORITY["EPSG","25832"]]
Origin = (546000.000000000000000,6334000.000000000000000)
Pixel Size = (0.400000000000000,-0.400000000000000)
Metadata:
  AREA_OR_POINT=Area
Image Structure Metadata:
  COMPRESSION=DEFLATE
  INTERLEAVE=BAND
Corner Coordinates:
Upper Left  (  546000.000, 6334000.000) (  9d45'36.85"E, 57d 8'49.01"N)
Lower Left  (  546000.000, 6333000.000) (  9d45'36.19"E, 57d 8'16.67"N)
Upper Right (  547000.000, 6334000.000) (  9d46'36.34"E, 57d 8'48.65"N)
Lower Right (  547000.000, 6333000.000) (  9d46'35.66"E, 57d 8'16.31"N)
Center      (  546500.000, 6333500.000) (  9d46' 6.26"E, 57d 8'32.66"N)
Band 1 Block=256x256 Type=Float32, ColorInterp=Gray
  NoData Value=-9999

因为这意味着我们假设生成的vrt文件在之后的任何调用都具有相同的卷绑定 - 但我认为应该没问题:)