[gdal-dev] New saga grid zipped format

Even Rouault even.rouault at spatialys.com
Wed Jul 12 10:06:38 PDT 2017


On mercredi 12 juillet 2017 17:24:44 CEST Dmitry Baryshnikov wrote:
> Hi Johan,
> 
> Just use CPL_VSIL_ZIP_ALLOWED_EXTENSIONS to add new extension and enjoy.
> 
> CPLSetConfigOption(CPL_VSIL_ZIP_ALLOWED_EXTENSIONS, "sg-grd-z");
> 
> Or in ogrinfo use option -config CPL_VSIL_ZIP_ALLOWED_EXTENSIONS sg-grd-z
> 

Johan,

since GDAL 2.2, /vsizip/ can handle any zip file with non standard extension with the 
following syntax

/vsizip/{/path/to/the/archive}/path/inside/the/archive

(the { } pair must be used to surround the zip filename)

So you'd basically just need to add a few lines to the existing SAGA driver to recognize files 
with sg-grd-z extension, and in that case (and when non explicitly prefixed by /vsizip/ add the 
/vsizip/ prefix , and the .sdat file (you can use VSIReadDir() on the /vsizip/ file to get the 
contents)

You can have a look at the SRTMHGT driver that has some similarity, since it allows to open 
.hgt.zip files directly

Even


> Best regards,
>      Dmitry
> 
> 12.07.17 17:18, Johan Van de Wauw пишет:
> > Hi all,
> > 
> > Saga GIS introduced a new file format .sg-grd-z [1] which actually is
> > a zipfile containing the normal files encountered in saga gis (*.sgrd
> > ; *.sdat; and optionally *.mgrd ).
> > 
> > In fact, if you rename the .sg-grd-z file you can already open it using
> > vsizip eg
> > cp Landgebruik_def_watem.sg-grd-z Landgebruik_def_watem.zip
> > gdalinfo /vsizip/Landgebruik_def_watem.zip/Landgebruik_def_watem.sdat
> > Driver: SAGA/SAGA GIS Binary Grid (.sdat)
> > Files: /vsizip/Landgebruik_def_watem.zip/Landgebruik_def_watem.sdat
> > 
> >         /vsizip/Landgebruik_def_watem.zip/Landgebruik_def_watem.sdat.aux.x
> >         ml
> >         /vsizip/Landgebruik_def_watem.zip/Landgebruik_def_watem.sgrd
> >         /vsizip/Landgebruik_def_watem.zip/Landgebruik_def_watem.prj
> > 
> > Size is 49400, 24000
> > Coordinate System is `'
> > Origin = (17000.000000000000000,249995.000000000000000)
> > Pixel Size = (5.000000000000000,-5.000000000000000)
> > Corner Coordinates:
> > Upper Left  (   17000.000,  249995.000)
> > Lower Left  (   17000.000,  129995.000)
> > Upper Right (  264000.000,  249995.000)
> > Lower Right (  264000.000,  129995.000)
> > Center      (  140500.000,  189995.000)
> > Band 1 Block=49400x1 Type=Int16, ColorInterp=Undefined
> > 
> >    NoData Value=-32767
> > 
> > I'm willing to get my hands dirty to add support for this format in
> > gdal (either developing/testing/...), but I wonder if there are any
> > similar formats where I can find inspiration.
> > 
> > Kind Regards,
> > Johan
> > 
> > [1] https://sourceforge.net/p/saga-gis/mailman/message/35918456/
> > _______________________________________________
> > gdal-dev mailing list
> > gdal-dev at lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/gdal-dev
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170712/a01c193c/attachment-0001.html>


More information about the gdal-dev mailing list