Skip to content

Commit

Permalink
More GRASS direct modules
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Dec 6, 2012
1 parent b777b51 commit cb7d1ec
Show file tree
Hide file tree
Showing 8 changed files with 138 additions and 82 deletions.
2 changes: 1 addition & 1 deletion src/plugins/grass/modules/r.aspect.qgm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE qgisgrassmodule SYSTEM "http://mrcc.com/qgisgrassmodule.dtd">

<qgisgrassmodule label="Create aspect raster from DEM (digital elevation model)" module="r.slope.aspect">
<qgisgrassmodule label="Create aspect raster from DEM (digital elevation model)" module="r.slope.aspect" direct="1">
<option key="elevation" />
<option key="aspect" />
</qgisgrassmodule>
3 changes: 2 additions & 1 deletion src/plugins/grass/modules/r.average.qgm
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE qgisgrassmodule SYSTEM "http://mrcc.com/qgisgrassmodule.dtd">

<qgisgrassmodule label="Calculate average of raster within areas with the same category in a user-defined base map" module="r.average">
<!-- direct problem: r.average is using external r.stats, r.recode -->
<qgisgrassmodule label="Calculate average of raster within areas with the same category in a user-defined base map" module="r.average" direct="0">
<option key="base" />
<option key="cover" />
<flag key="c" />
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/grass/modules/r.basins.fill.qgm
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE qgisgrassmodule SYSTEM "http://mrcc.com/qgisgrassmodule.dtd">

<qgisgrassmodule label="Create watershed subbasins raster" module="r.basins.fill">
<!-- direct note: the module runs, but it was not tested with real data -->
<qgisgrassmodule label="Create watershed subbasins raster" module="r.basins.fill" direct="1">
<option key="number" />
<option key="c_map" />
<option key="t_map" />
Expand Down
5 changes: 3 additions & 2 deletions src/plugins/grass/modules/r.bilinear.qgm
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE qgisgrassmodule SYSTEM "http://mrcc.com/qgisgrassmodule.dtd">

<qgisgrassmodule label="Bilinear interpolation utility for raster maps" module="r.bilinear">
<!-- The GRASS module r.bilinear fails with fatal error: This module is deprecated. Please use 'r.resamp.interp' instead. -->
<qgisgrassmodule label="Bilinear interpolation utility for raster maps" module="r.bilinear" direct="1">
<option key="input" />
<option key="output" />
</qgisgrassmodule>
</qgisgrassmodule>
2 changes: 1 addition & 1 deletion src/plugins/grass/modules/r.bitpattern.qgm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE qgisgrassmodule SYSTEM "http://mrcc.com/qgisgrassmodule.dtd">

<qgisgrassmodule label="Compares bit patterns with raster" module="r.bitpattern">
<qgisgrassmodule label="Compares bit patterns with raster" module="r.bitpattern" direct="1">
<flag key="q" />
<option key="input" />
<option key="input" />
Expand Down
13 changes: 13 additions & 0 deletions src/providers/gdal/qgsgdalprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,19 @@ QgsGdalProvider::QgsGdalProvider( QString const & uri )
setDataSourceUri( vsiPrefix + uri );
QgsDebugMsg( QString( "Trying %1 syntax, uri= %2" ).arg( vsiPrefix ).arg( dataSourceUri() ) );
}
else
{
// TODO: this constructor is also called for new rasters, in that case GDAL prints error:
// "ERROR 4: `pok.tif' does not exist in the file system, and is not recognised as a supported dataset name."
// To avoid this message, we test first if the file exists at all.
// This should be done better adding static create() method or something like that
if ( !QFile::exists( uri ) )
{
QString msg = QString( "File does not exist: %1" ).arg( dataSourceUri() );
appendError( ERR( msg ) );
return;
}
}

QString gdalUri = dataSourceUri();

Expand Down
2 changes: 2 additions & 0 deletions src/providers/grass/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ SET ( FUNCTIONS
"G_allocate_raster_buf"
"G__calloc"
"G_col_to_easting"
"G_convert_dirseps_to_host"
"G_define_flag"
"G_define_module"
"G_define_option"
"G_define_standard_option"
"G_free"
"G_free_raster_cats"
"G_get_fp_range_min_max"
"G_get_range_min_max"
"G_get_window"
Expand Down
Loading

0 comments on commit cb7d1ec

Please sign in to comment.