view gdalinfo.xml @ 0:2241ff3e5b7c draft default tip

Uploaded
author mnhn65mo
date Thu, 02 Aug 2018 06:30:23 -0400
parents
children
line wrap: on
line source

<tool id="gdalinfo" name="GDAL Informations" version="0.1.0">
    <description>lists information about a raster dataset</description>
    <requirements>
        <requirement type="package" version="2.1.0">gdal</requirement>
        <requirement type="package" version="3.5.0">geos</requirement>
        <requirement type="package" version="9b">jpeg</requirement>
        <requirement type="package" version="1.5.90">libjpeg-turbo</requirement>
    </requirements>
    <command detect_errors="exit_code"><![CDATA[
        gdalinfo '$input1'
            #if $settings.advanced=='advanced'
                $settings.mm
                $settings.stats
                $settings.approx_stats
                $settings.hist
                $settings.nogcp
                $settings.nomd
                $settings.norat
                $settings.noct
                $settings.checksum
                $settings.listmdd
                $settings.proj4
                -mdd '$settings.mdd'
            #end if
            #if $format.value=='json'
                -json > '$outputJson';
                #if $subdataset=='subd_y'
                    cat '$outputJson' | grep -A 1 "\"SUBDATASET_._NAME\":\".*\"," | cut -d "\"" -f4- | sed 's/..$//' | sed 's/\t//' | sed -e 'N; s/\n/\t/' > '${input1.name}_Subdatasets'
                #end if
            #else
                > '$outputDefault';
                #if $subdataset=='subd_y'
                    cat '$outputDefault' | grep -A 1 "SUBDATASET_._NAME=.*:.*$" | cut -d "=" -f 2 | sed 's/\t//' | sed -e 'N; s/\n/\t/' > '${input1.name}_Subdatasets'
                #end if
            #end if
    ]]></command>
    <inputs>
        <param type="data" name="input1" format="data" label="Gdal supported input file" help="http://www.gdal.org/formats_list.html"/>
        <param name="format" type="select" label="Output format" display="radio" multiple="False">
            <option value="default" selected="true">Text</option>
            <option value="json">Json</option>
        </param>
        <param name="subdataset" type="select" label="Create list of potential subdatasets" display="radio" multiple="False">
            <option value="subd_y">Yes</option>
            <option value="subd_n" selected="True">No</option>
        </param>
        <conditional name="settings">
            <param name="advanced" type="select" label="Specify advanced parameters">
                <option value="simple" selected="true">No, use program defaults.</option>
                <option value="advanced">Yes, see full parameter list.</option>
            </param>        
            <when value="simple">
            </when>
            <when value="advanced">
                   <param name="mm" type="boolean" truevalue="-mm" falsevalue="" checked="false" label="-mm" help="Force computation of the actual min/max values for each band in the dataset."/>
                   <param name="stats" type="boolean" truevalue="-stats" falsevalue="" checked="false" label="-stats" help="Read and display image statistics. Force computation if no statistics are stored in an image."/>
                   <param name="approx_stats" type="boolean" truevalue="-approx_stats" falsevalue="" checked="false" label="-approx_stats" help="Read and display image statistics. Force computation if no statistics are stored in an image. However, they may be computed based on overviews or a subset of all tiles. Useful if you are in a hurry and don't want precise stats."/>
                   <param name="hist" type="boolean" truevalue="-hist" falsevalue="" checked="false" label="-hist" help="Report histogram information for all bands."/>
                   <param name="nogcp" type="boolean" truevalue="-nogcp" falsevalue="" checked="false" label="-nogcp" help="Suppress ground control points list printing. It may be useful for datasets with huge amount of GCPs, such as L1B AVHRR or HDF4 MODIS which contain thousands of them."/>
                   <param name="nomd" type="boolean" truevalue="-nomd" falsevalue="" checked="false" label="-nomd" help="Suppress metadata printing. Some datasets may contain a lot of metadata strings."/>
                   <param name="norat" type="boolean" truevalue="-norat" falsevalue="" checked="false" label="-norat" help="Suppress printing of raster attribute table."/>
                   <param name="noct" type="boolean" truevalue="-noct" falsevalue="" checked="false" label="-noct" help="Suppress printing of color table."/>
                   <param name="checksum" type="boolean" truevalue="-checksum" falsevalue="" checked="false" label="-checksum" help="Force computation of the checksum for each band in the dataset."/>
                   <param name="listmdd" type="boolean" truevalue="-listmdd" falsevalue="" checked="false" label="-listmdd" help="List all metadata domains available for the dataset."/>
                <param name="proj4" type="boolean" truevalue="-proj4" falsevalue="" checked="false" label="-proj4" help="Report a PROJ.4 string corresponding to the file's coordinate system."/> 
                <param name="mdd" type="text" label="-mdd DOMAIN" help="Report metadata for the specified domain. Starting with GDAL 1.11, 'all' can be used to report metadata in all domains." value="all"/>
            </when>
        </conditional>
        
    </inputs>
    <outputs>
        <data name="outputDefault" format="txt" label="Default info file">
            <filter>format == "default"</filter>
        </data>
        <data name="outputJson" format="json" label="Json formated info file">
            <filter>format == "json"</filter>
        </data>
        <data name="Subdatasets" format="tabular" from_work_dir="*_Subdatasets" label="Subdatasets from ${input1.name}">
            <filter>subdataset == "subd_y"</filter>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="input1" value="stere.tif"/>
            <param name="format" value="json" />
            <param name="subdataset" value="subd_n" />
            <param name="advanced" value="simple"/>
            <output name="outputJson" file="stere_info.json" lines_diff="6"/>
        </test>
        <test>
            <param name="input1" value="stere.tif"/>
            <param name="format" value="default" />
            <param name="subdataset" value="subd_n" />
            <param name="advanced" value="advanced"/>
            <param name="stats" value="-stats"/>
            <param name="hist" value="-hist"/>
            <param name="checksum" value="-checksum"/>
            <param name="mdd" value="all"/>
            <output name="outputDefault" file="stere_advanced_info.txt" lines_diff="6"/>
        </test>
    </tests>
    <help><![CDATA[
==========================
Gdalinfo
==========================
**What it does**        

The gdalinfo program lists various information about a GDAL supported raster dataset. 

It will report all of the following (if known):

    - The format driver used to access the file.
    - Raster size (in pixels and lines).
    - The coordinate system for the file (in OGC WKT).
    - The geotransform associated with the file (rotational coefficients are currently not reported).
    - Corner coordinates in georeferenced, and if possible lat/long based on the full geotransform (but not GCPs).
    - Ground control points.
    - File wide (including subdatasets) metadata.
    - Band data types.
    - Band color interpretations.
    - Band block size.
    - Band descriptions.
    - Band min/max values (internally known and possibly computed).
    - Band checksum (if computation asked).
    - Band NODATA value.
    - Band overview resolutions available.
    - Band unit type (i.e.. "meters" or "feet" for elevation bands).
    - Band pseudo-color tables.

|

**How to use it**

Select from history a suported raster file and choose either Json or Text format for result display.

An additional option can list available subdatasets.

|

**Other options, advanced usage**


*-mm*

    Force computation of the actual min/max values for each band in the dataset. 

|

*-stats*

    Read and display image statistics. Force computation if no statistics are stored in an image. 

|

*-approx_stats*

    Read and display image statistics. Force computation if no statistics are stored in an image. However, they may be computed based on overviews or a subset of all tiles. Useful if you are in a hurry and don't want precise stats. 

|

*-hist*

    Report histogram information for all bands. 

|

*-nogcp*

    Suppress ground control points list printing. It may be useful for datasets with huge amount of GCPs, such as L1B AVHRR or HDF4 MODIS which contain thousands of them. 

|

*-nomd*

    Suppress metadata printing. Some datasets may contain a lot of metadata strings. 

|

*-norat*

    Suppress printing of raster attribute table. 

|

*-noct*

    Suppress printing of color table. 

|

*-checksum*

    Force computation of the checksum for each band in the dataset. 

|

*-listmdd*

    List all metadata domains available for the dataset. 

|

*-mdd domain*

    Report metadata for the specified domain. Starting with GDAL 1.11, "all" can be used to report metadata in all domains 

|

*-proj4*

    Report a PROJ.4 string corresponding to the file's coordinate system.

|

**Sources**

http://www.gdal.org

http://www.gdal.org/gdalinfo.html

Raster Processing Tutorial : https://trac.osgeo.org/gdal/wiki/UserDocs/RasterProcTutorial


    ]]></help>
</tool>