Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Is there a way to retrieve remote data through ECWP protocol in QGIS? I've read that .ecw files can be opened with QGIS, but haven't found anything concerning this particular protocol and QGIS.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

Make sure you have the ERDAS ECW/JP2 SDK and the GDAL ECW plugin installed. Then use a VRT to point to the ECWP Raster. You can then load the vrt into QGIS like a standard filesystem raster. An easy way of generating the vrt file, is to use gdalbuildvrt.

i.e.

gdalbuildvrt ecwpraster.vrt ecwp://myimagewebserver/folder/file.ecw

Which creates vrt a file containing:

<VRTDataset rasterXSize="500880" rasterYSize="409335">
  <GeoTransform> 8.7132999999999963e+006, 2.5000000000000000e+000, 0.0000000000000000e+000, 5.0460199999999991e+006, 0.0000000000000000e+000,-2.5000000000000000e+000</GeoTransform>
  <VRTRasterBand dataType="Byte" band="1">
    <ColorInterp>Red</ColorInterp>
    <SimpleSource>
      <SourceFilename relativeToVRT="0">ecwp://myimagewebserver/folder/file.ecw</SourceFilename>
      <SourceBand>1</SourceBand>
      <SourceProperties RasterXSize="500880" RasterYSize="409335" DataType="Byte" BlockXSize="500880" BlockYSize="1" />
      <SrcRect xOff="0" yOff="0" xSize="500880" ySize="409335" />
      <DstRect xOff="0" yOff="0" xSize="500880" ySize="409335" />
    </SimpleSource>
  </VRTRasterBand>
  <VRTRasterBand dataType="Byte" band="2">
    <ColorInterp>Green</ColorInterp>
    <SimpleSource>
      <SourceFilename relativeToVRT="0">ecwp://myimagewebserver/folder/file.ecw</SourceFilename>
      <SourceBand>2</SourceBand>
      <SourceProperties RasterXSize="500880" RasterYSize="409335" DataType="Byte" BlockXSize="500880" BlockYSize="1" />
      <SrcRect xOff="0" yOff="0" xSize="500880" ySize="409335" />
      <DstRect xOff="0" yOff="0" xSize="500880" ySize="409335" />
    </SimpleSource>
  </VRTRasterBand>
  <VRTRasterBand dataType="Byte" band="3">
    <ColorInterp>Blue</ColorInterp>
    <SimpleSource>
      <SourceFilename relativeToVRT="0">ecwp://myimagewebserver/folder/file.ecw</SourceFilename>
      <SourceBand>3</SourceBand>
      <SourceProperties RasterXSize="500880" RasterYSize="409335" DataType="Byte" BlockXSize="500880" BlockYSize="1" />
      <SrcRect xOff="0" yOff="0" xSize="500880" ySize="409335" />
      <DstRect xOff="0" yOff="0" xSize="500880" ySize="409335" />
    </SimpleSource>
  </VRTRasterBand>
</VRTDataset>
share|improve this answer
    
I know that it's a very old thread but finally I've managed to add this .ecw layer throgh ecwp:// protocol. I've built the .vrt file with the built-in GdalTools of QGIS. Thank you for your help. –  Istvan Peto May 10 at 8:10

Your Answer

 
discard

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.