changeset 0:485204e18759 draft

planemo upload for repository https://github.com/galaxyecology/tools-ecology/tools/gdal commit b964e8f7d7bb076d63a1c7bdfbbdba0f9074d517
author ecology
date Tue, 26 Feb 2019 11:51:43 -0500
parents
children daf66eda45b8
files gdal_macros.xml gdalwarp.xml test-data/gdalwarp_test2_out.tif test-data/gdalwarp_test3_out.tif test-data/gdalwarp_test4_out.tif test-data/small_warpmerged.tif test-data/stere.tif test-data/stere_warp1.tiff test-data/tinyworld.tif
diffstat 9 files changed, 359 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gdal_macros.xml	Tue Feb 26 11:51:43 2019 -0500
@@ -0,0 +1,164 @@
+<macros>
+    <token name="@VERSION@">2.4.0</token>  
+    <xml name="gdal_requirements">
+        <requirements>
+            <requirement type="package" version="2.1.0">gdal</requirement>
+            <requirement type="package" version="3.5.0">geos</requirement>
+        </requirements>
+    </xml>
+
+    <xml name="gdal_advanced_params_select">
+        <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>
+    </xml>
+
+    <xml name="gdal_param_te">
+        <conditional name="condi_te">
+            <param name="te" type="select" label="Georeferenced extents of output file" help="-te xmin ymin xmax ymax">
+                <option value="no_te" selected="true">Don't use the -te option</option>
+                <option value="te">Use the -te option</option>
+            </param>
+            <when value="no_te">
+            </when>
+            <when value="te">
+                <param name="xmin" type="float" label="xmin" value="0" min="0" help="In target SRS by default, or in the SRS specified with -te_srs"/>
+                <param name="ymin" type="float" label="ymin" value="0" min="0" help="In target SRS by default, or in the SRS specified with -te_srs"/>
+                <param name="xmax" type="float" label="xmax" value="0" min="0" help="In target SRS by default, or in the SRS specified with -te_srs"/>
+                <param name="ymax" type="float" label="ymax" value="0" min="0" help="In target SRS by default, or in the SRS specified with -te_srs"/>
+            </when>
+        </conditional> 
+    </xml>
+
+    <xml name="gdal_param_r">
+        <conditional name="condi_resample">
+            <param label="Use a resampling method" help="-r resampling algorithm" name="resample" type="select">
+                <option value="no_resampling" selected="true">Don't use a resampling method</option>
+                <option value="resampling">Use a resampling method, option -r</option>
+            </param>
+            <when value="resampling">
+                <param name="r" type="select" label="Reseampling algorithm" >
+                    <option value="nearest" selected="true"/>
+                    <option value="bilinear"/>
+                    <option value="cubic"/>
+                    <option value="cubicspline"/>
+                    <option value="lanczos"/>
+                    <option value="average"/>
+                    <option value="mode"/>
+                    <option value="max"/>
+                    <option value="min"/>
+                    <option value="med">Median resampling</option>
+                    <option value="q1">First quartile resampling</option>
+                    <option value="q2">Third quartile resampling</option>
+                </param>
+            </when>
+            <when value="no_resampling">
+            </when>
+        </conditional>
+    </xml>
+
+    <xml name="gdal_param_tr">
+        <conditional name="condi_tr">
+            <param name="tr" type="select" label="Set the ouput file resolution" help="-tr xres yres. Set output file resolution (in target georeferenced units)"> 
+                <option value="no_tr" selected="true">Don't use the -tr option</option>
+                <option value="tr">Use the -tr option</option>
+            </param>
+            <when value="no_tr">
+            </when>
+            <when value="tr">
+                <param name="xres" type="float" label="xres" value="0" min="0"/>
+                <param name="yres" type="float" label="yres" value="0" min="0"/>
+            </when>
+        </conditional>
+    </xml>
+
+    <xml name="gdal_param_b">
+        <param name="b" type="text" label="Select an input band band for output" help="eg : -b band -b 1 -b 2 -b 3. Bands are numbered from 1. Multiple -b switches may be used to select a set of input bands to write to the output file, or to reorder bands." value=""/>
+    </xml>
+
+    <xml name="gdal_param_tap">
+        <param name="tap" label="Align the coordinates" help="-tap Target Aligned Pixel, align the coordinates of the extent of the output file to the values of the -tr, such that the aligned extent includes the minimum extent" type="boolean" truevalue="-tap" falsevalue="" checked="false" />
+    </xml>
+
+    <xml name="gdal_param_separate">
+        <param name="separate" type="boolean" truevalue="-separate" falsevalue="" checked="false" label="Place each input file into a separate band" help="-separate. In that case, only the first band of each dataset will be placed into a new band. Contrary to the default mode, it is not required that all bands have the same datatype" />
+    </xml>
+
+    <xml name="gdal_param_a_srs">
+        <param name="a_srs" type="text" label="Override the projection for the output file" help="-a_srs srs_def. The srs_def may be any of the usual GDAL/OGR forms, complete WKT, PROJ.4, EPSG:n or a file containing the WKT. No reprojection is done" value="" />
+    </xml>
+
+    <xml name="gdal_param_stats">
+        <param name="stats" type="boolean" truevalue="-stats" falsevalue="" checked="false" label="Force (re)computation of statistics"  help="-stats. Read and display image statistics. Force computation if no statistics are sto.red in an image."/>
+    </xml>
+    
+    <xml name="gdal_param_norat">
+        <param name="norat" type="boolean" truevalue="-norat" falsevalue="" checked="false" help="-norat. Do not copy source RAT into destination dataset." label="Suppress printing of raster attribute table."/>
+    </xml>
+
+    <xml name="gdal_param_of">
+        <param name="of" type="select" label="Output format -of" value="Gtiff" help="Select the output format. The default is GeoTIFF (GTiff). A short list of raster formats is currently enable in GalaxyE : GTiff, netCDF and VRT.">
+            <option value="GTiff">GTiff</option>
+            <option value="netCDF">Network Common Data Format - netCDF</option>
+            <option value="VRT">GDAL Virtual - VRT</option>
+        </param>
+    </xml>
+
+    <xml name="gdal_param_co">
+        <param name="co" type="text" label="Pass a creation option to the output format driver" help="-co NAME=VALUE. eg : COMPRESS=JPEG" value="" />
+    </xml>   
+
+    <xml name="gdal_param_ot">
+        <param name="ot" type="select" label="Datatype of the output bands" help="-ot Datatype">
+            <option value="byte">Byte</option>
+            <option value="int16">Int16</option>
+            <option value="uint16">UInt16</option>
+            <option value="uint32">UInt32</option>
+            <option value="int32">Int32</option>
+            <option value="float32">Float32</option>
+            <option value="float64">Float64</option>
+            <option value="cint16">CInt16</option>
+            <option value="cint32">CInt32</option>
+            <option value="cfloat32">CFloat32</option>
+            <option value="cfloat64">CFloat64</option>
+            <option value="" selected="true">Select a datatype for the output bands (default)</option>
+        </param>
+    </xml>
+
+<!-- need to upgrade gdal version to use
+    <xml name="gdal_param_oo">
+        <param name="oo" type="text" label="-oo NAME=VALUE" value="" />
+    </xml>
+-->
+
+    <xml name="gdal_input_raster_multiple">
+        <param type="data" name="input" format="gtiff,tiff,netcdf,VRT,txt,xml" help="Formats currently supported are : GTiff, netCDF and VRT" label="Gdal supported input file" multiple="true"/>
+    </xml>
+
+    <xml name="gdal_output_change_format">
+        <data name="output" format="GTiff" label="${on_string}.${of}">
+            <change_format>
+                <when input="of" value="GTiff" format="tiff"/>
+                <when input="of" value="netCDF" format="netcdf"/>
+                <when input="of" value="VRT" format="txt"/>
+            </change_format>
+        </data>
+    </xml>
+
+    <xml name="gdal_citation">
+        <citations>
+            <citation type="bibtex">
+                @Manual{,
+                title = {{GDAL/OGR} Geospatial Data Abstraction software Library},
+                author = {{GDAL/OGR contributors}},
+                organization = {Open Source Geospatial Foundation},
+                year = {2018},
+                url = {http://gdal.org},
+                }
+            </citation>
+        </citations>  
+    </xml>
+</macros>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gdalwarp.xml	Tue Feb 26 11:51:43 2019 -0500
@@ -0,0 +1,195 @@
+<tool id="gdal_gdalwarp" name="GDAL Warp" version="@VERSION@">
+    <description>image reprojection and warping utility</description>
+    <macros>
+        <import>gdal_macros.xml</import>
+    </macros>
+    <expand macro="gdal_requirements" />
+    <command detect_errors="exit_code"><![CDATA[
+        gdalwarp 
+            -q
+            #for $i in $input
+                '$i'
+            #end for
+            -of '$of'
+            #if str($s_srs).strip()!=''
+                -s_srs '$s_srs'
+            #end if
+
+            #if str($t_srs).strip()!=''
+                -t_srs '$t_srs'
+            #end if
+
+            #if $settings.advanced=="advanced"
+
+                #if $settings.condi_tr.tr=='tr'
+                    -tr $settings.condi_tr.xres $settings.condi_tr.yres
+                #end if
+    
+                -to '$settings.to'
+                
+                -wo '$settings.wo'
+            
+                #if $settings.order!='no_value'
+                    -order '$settings.order'
+                #end if
+
+                #if $settings.condi_resample.resample=='resampling'
+                    -r $settings.condi_resample.r
+                #end if
+                
+                #if $settings.condi_et.et=='et'
+                    -et $settings.condi_et.et
+                #end if
+            
+                #if $settings.condi_refine_gcps.refine_gcps=='refine_gcps'
+                    -refine_gcps $settings.condi_refine_gcps.tolerance $settings.condi_refine_gcps.minimum_gcps
+                #end if
+            
+                #if $settings.condi_te.te=='te'
+                    -te $settings.condi_te.xmin $settings.condi_te.ymin $settings.condi_te.xmax $settings.condi_te.ymax
+                #end if
+            
+                $settings.tps
+                $settings.rpc
+                $settings.geoloc
+                
+                #if str($settings.srcnodata).strip()!=''
+                    -srcnodata '$settings.srcnodata'
+                #end if
+                
+                $settings.dstalpha
+            #end if
+                        
+        '$output'
+
+    ]]></command>
+    
+    <inputs>
+        <expand macro="gdal_input_raster_multiple"/>
+        <expand macro="gdal_param_of"/>
+        <param name="s_srs" type="text" label="Source spatial reference set" value="" help="-s_srs def. The coordinate systems that can be passed are anything supported by the OGRSpatialReference."/>
+        <param name="t_srs" type="text" label="Target spatial reference set" value="" help="-t_srs srs_def. The coordinate systems that can be passed are anything supported by the OGRSpatialReference."/>
+        <conditional name="settings">
+            <expand macro="gdal_advanced_params_select"/>
+            <when value="advanced">
+                <expand macro="gdal_param_tr"/>    
+                <param name="to" type="text" label="Transformer option" help="-to NAME=VALUE. Set a transformer option suitable to pass to GDALCreateGenImgProjTransformer2()." value=""/>
+                <param name="wo" type="text" label="Warp option" help="-wo NAME=VALUE. Set a warp option." value="" />
+                <param name="order" type="select" label="Order of polynomial" help="-order n. Order of polynomial used for warping (1 to 3). The default is to select a polynomial order based on the number of GCPs.">
+                    <option value="no_value" selected="true">Select an order.</option>
+                    <option value="1">1</option>
+                    <option value="2">2</option>
+                    <option value="3">3</option>
+                </param>
+                <param name="tps" type="boolean" label="Force use of thin plate spline transformer" help="-tps. Based on available GCPs" truevalue="-tps" falsevalue="" checked="false"/>
+                <param name="rpc" type="boolean" label="Force use of RPCs" help="-rpc" truevalue="-rpc" falsevalue="" checked="false"/>
+                <param name="geoloc" type="boolean" label="Force use of Geolocation Arrays." help="-geoloc" truevalue="-geoloc" falsevalue="" checked="false"/>
+                <param name="srcnodata" type="text" label="Set nodata masking values for input bands" help="-srcnodata value. Different values can be supplied for each band" value=""/>
+                <param name="dstalpha" type="boolean" label="Create an output alpha band to identify nodata (unset/transparent) pixels" help="-dstalpha" truevalue="-dstalpha" falsevalue="" checked="false"/>
+                <conditional name="condi_et">
+                    <param name="et" label="Error threshold for transformation approximation" help="-et" type="select"> 
+                        <option value="et">Use an error threshold, option -et</option>
+                        <option value="no_et" selected="true">Don't use an error threshold</option>
+                    </param>
+                    <when value="no_et">
+                    </when>
+                    <when value="et">
+                        <param name="et" type="float" help="-et In pixel units - defaults to 0.125, unless, the RPC_DEM warping option is specified, in which case, an exact transformer, i.e. err_threshold=0, will be used)" label="Error threshold" value=""/>
+                    </when>
+                </conditional>
+                <conditional name="condi_refine_gcps">
+                    <param name="refine_gcps" type="select" label="Refines the GCPs by automatically eliminating outliers" help="-refine_gcps. Set tolerence and minimum gcps">
+                        <option value="no_refine_gcps" selected="true">Don't use the -refine_gcps option</option>
+                        <option value="refine_gcps">Use the -refine_gcps option</option>
+                    </param>
+                    <when value="no_refine_gcps">
+                    </when>
+                    <when value="refine_gcps">
+                        <param name="tolerance" type="float" label="tolerance" value="0" help="In pixel units if no projection is available, otherwise it is in SRS units"/>
+                        <param name="minimum_gcps" type="float" label="minimum_gcps" value="0" help="If minimum_gcps is not provided, the minimum GCPs according to the polynomial model is used"/>
+                    </when>
+                </conditional>
+                <expand macro="gdal_param_r"/>
+                <expand macro="gdal_param_te"/>
+            </when>
+        </conditional>
+    </inputs>
+    
+    <outputs>
+        <expand macro="gdal_output_change_format"/>
+    </outputs>
+    
+    <tests>
+        <test>
+            <param name="input" value="stere.tif"/>
+            <param name="of" value="GTiff" />
+            <param name="t_srs" value="EPSG:2154" />
+            <param name="advanced" value="simple"/>
+            <output name="output" file="stere_warp1.tiff"/>
+        </test>
+        
+        <test>
+            <param name="input" value="tinyworld.tif"/>
+            <param name="t_srs" value="+proj=ortho +datum=WGS84" />
+            <param name="advanced" value="simple"/>
+            <output name="output" file="gdalwarp_test2_out.tif"/>
+        </test>
+        
+        <test>
+            <param name="input" value="tinyworld.tif"/>
+            <param name="t_srs" value="+proj=ortho +datum=WGS84" />
+            <param name="advanced" value="advanced"/>
+            <param name="wo" value="SOURCE_EXTRA=125"/>
+            <output name="output" file="gdalwarp_test3_out.tif"/>
+        </test>
+
+        
+        <test>
+            <param name="input" value="tinyworld.tif"/>
+            <param name="t_srs" value="+proj=ortho +datum=WGS84" />
+            <param name="advanced" value="advanced"/>
+            <param name="wo" value="SOURCE_EXTRA=125"/>
+            <param name="dstalpha" value="-dstalpha"/>
+            <param name="srcnodata" value="11 10 50"/>
+            <output name="output" file="gdalwarp_test4_out.tif"/>
+        </test>
+        
+        <test>
+            <param name="input" value="small_east.dem,small_west.dem"/>
+            <param name="advanced" value="simple"/>
+            <output name="output" file="small_warpmerged.tif"/>
+        </test>     
+        
+    </tests>
+    <help><![CDATA[
+==========================
+Gdalwarp
+==========================
+**What it does**
+
+The gdalwarp utility is an image mosaicing, reprojection and warping utility. The program can reproject to any supported projection, and can also apply GCPs stored with the image if the image is "raw" with control information.        
+
+|
+
+**How to use it**
+
+Add as much input files you want to warp.
+
+Specifiy output format using short name (http://www.gdal.org/formats_list.html).
+
+Specify source and target spatial reference set.
+
+|
+
+**Advanced options and sources**
+
+To see complete details and help section please check the official gdal sources.
+
+http://www.gdal.org
+
+http://www.gdal.org/gdalwarp.html
+
+Raster Processing Tutorial : https://trac.osgeo.org/gdal/wiki/UserDocs/RasterProcTutorial
+    ]]></help>
+    <expand macro="gdal_citation"/>
+</tool>
Binary file test-data/gdalwarp_test2_out.tif has changed
Binary file test-data/gdalwarp_test3_out.tif has changed
Binary file test-data/gdalwarp_test4_out.tif has changed
Binary file test-data/small_warpmerged.tif has changed
Binary file test-data/stere.tif has changed
Binary file test-data/stere_warp1.tiff has changed
Binary file test-data/tinyworld.tif has changed