view ogr2ogr.xml @ 2:22c54afd1cf3 draft

planemo upload for repository https://github.com/galaxyecology/tools-ecology/tree/master/tools/gdal commit d2c064afb4680f459012473e4de8653079e32c15
author ecology
date Thu, 13 Jun 2019 11:29:34 -0400
parents 402131c0b42c
children e12db3b4d3a6
line wrap: on
line source

<tool id="gdal_ogr2ogr" name="OGR2ogr" version="@VERSION@">
    <description>converts simple features data between file formats</description>
    <macros>
        <import>gdal_macros.xml</import>
    </macros>
    <expand macro="gdal_requirements" />
    <command detect_errors="exit_code"><![CDATA[
        ogr2ogr
            -f '$f'
            #if $f=='ESRI Shapefile'
                'shapefile.shp'
            #else
                'output'
            #end if
            #if $input.is_of_type("shp")
                ${os.path.join( $input.extra_files_path, 'shapefile.shp' )} 
            #else    
                '$input'
            #end if
            #if $f=='ESRI Shapefile'
                &&
                mkdir ${shapefile.extra_files_path} &&
                mv shapefile.* ${shapefile.extra_files_path}
            #end if 
    ]]></command>
    <inputs>
        <param type="data" name="input" format="shp,xml,json,txt" label="Gdal supported input file" help="http://www.gdal.org/ogr_formats.html"/>
        <param type="select" name="f" label="Conversion format" value="" help="Select the format to convert your input file. Currently supported : Shapefile, GeoJSON, GML, KML and WFS.">
            <option value="ESRI Shapefile">ESRI Shapefile</option>
            <option value="GeoJSON">GEOJSON</option> 
            <option value="GML">GML</option>
            <option value="KML">KML</option>
            <option value="WFS">WFS</option>
        </param>
    </inputs>
    <outputs>
        <data name="output" from_work_dir="output" format="xml" label="${on_string}.${f}">
            <filter>f != 'ESRI Shapefile'</filter>
                <change_format>
                    <when input="f" value="GeoJSON" format="json"/> 
                    <when input="f" value="GML" format="xml"/> 
                    <when input="f" value="KML" format="xml"/> 
                    <when input="f" value="WFS" format="txt"/> 
                </change_format> 
        </data>
        <data name="shapefile" format="shp" from_work_dir="shapefile" label="${on_string}.shapefile">
            <filter>f == 'ESRI Shapefile'</filter>
        </data>
    </outputs>
    <tests>
        <test>
            <param name="input" value="shp_compositefiles/shapefile.xml" ftype="shp">
                <composite_data value="shp_compositefiles/shapefile.shp"/>
                <composite_data value="shp_compositefiles/shapefile.shx"/>
                <composite_data value="shp_compositefiles/shapefile.dbf"/>
                <composite_data value="shp_compositefiles/shapefile.sbn"/>
                <composite_data value="shp_compositefiles/shapefile.sbx"/>
            </param>
            <param name="f" value="KML"/>
            <output file="ogr2ogr_KML.kml" name="output"/> 
        </test>
        <test>
            <param name="input" value="shp_compositefiles/shapefile.xml" ftype="shp">
                <composite_data value="shp_compositefiles/shapefile.shp"/>
                <composite_data value="shp_compositefiles/shapefile.shx"/>
                <composite_data value="shp_compositefiles/shapefile.dbf"/>
                <composite_data value="shp_compositefiles/shapefile.sbn"/>
                <composite_data value="shp_compositefiles/shapefile.sbx"/>
            </param>
            <param name="f" value="GML"/>
            <output file="ogr2ogr_GML.gml" name="output"/> 
        </test>
        <test>
            <param name="input" value="shp_compositefiles/shapefile.xml" ftype="shp">
                <composite_data value="shp_compositefiles/shapefile.shp"/>
                <composite_data value="shp_compositefiles/shapefile.shx"/>
                <composite_data value="shp_compositefiles/shapefile.dbf"/>
                <composite_data value="shp_compositefiles/shapefile.sbn"/>
                <composite_data value="shp_compositefiles/shapefile.sbx"/>
            </param>
            <param name="f" value="GeoJSON"/>
            <output file="ogr2ogr_geojson.json" name="output"/> 
        </test>   
        <test>
            <param name="input" value="ogr2ogr_KML.kml" ftype="xml"/>
            <param name="f" value="GeoJSON"/>
            <output file="ogr2ogr_test2_geojson.json" name="output"/> 
        </test>   
        <test>
            <param name="input" value="ogr2ogr_KML.kml" ftype="xml"/>
            <param name="f" value="ESRI Shapefile"/>
            <output file="shp_compositefiles/ogr2ogr_shapefile2.html" name="shapefile">
                <extra_files type="file" name="shapefile.dbf" value="shp_compositefiles/ogr2ogr_shapefile2.dbf" compare="sim_size" delta="50"/>
                <extra_files type="file" name="shapefile.prj" value="shp_compositefiles/ogr2ogr_shapefile2.prj"/>
                <extra_files type="file" name="shapefile.shp" value="shp_compositefiles/ogr2ogr_shapefile2.shp"/>
                <extra_files type="file" name="shapefile.shx" value="shp_compositefiles/ogr2ogr_shapefile2.shx"/>
            </output>
        </test>
        <test>
            <param name="input" value="ogr2ogr_KML.kml" ftype="xml"/>
            <param name="f" value="GML"/>
            <output file="ogr2ogr_GML2.gml" name="output"/> 
        </test>
    </tests>
    <help><![CDATA[
========
Ogrinfo
========

**What it does**

The Ogrinfo program lists various information about an OGR supported vector dataset.

|

**How to use it**

Select from history a suported vector file. 

|

**Advanced options and sources**

To see complete details and help section please check the official gdal sources.

http://www.gdal.org

https://gdal.org/programs/ogr2ogr.html

http://download.osgeo.org/gdal/workshop/foss4ge2015/workshop_gdal.pdf
    ]]></help>
    <expand macro="gdal_citation"/>
</tool>