[GRASS-SVN] r38130 - in grass/trunk: include lib/raster
vector/v.drape vector/v.extrude vector/v.sample
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Jun 30 13:39:57 EDT 2009
Author: martinl
Date: 2009-06-30 13:39:56 -0400 (Tue, 30 Jun 2009)
New Revision: 38130
Modified:
grass/trunk/include/raster.h
grass/trunk/lib/raster/sample.c
grass/trunk/vector/v.drape/main.c
grass/trunk/vector/v.extrude/main.c
grass/trunk/vector/v.sample/main.c
Log:
rasterlib: fns from samle.c renamed, see
http://trac.osgeo.org/grass/wiki/Grass7/RasterLib
Modified: grass/trunk/include/raster.h
===================================================================
--- grass/trunk/include/raster.h 2009-06-30 17:25:23 UTC (rev 38129)
+++ grass/trunk/include/raster.h 2009-06-30 17:39:56 UTC (rev 38130)
@@ -492,10 +492,10 @@
int Rast_put_reclass(const char *, const struct Reclass *);
/* sample.c */
-DCELL Rast_get_raster_sample_nearest(int, const struct Cell_head *, struct Categories *, double, double, int);
-DCELL Rast_get_raster_sample_bilinear(int, const struct Cell_head *, struct Categories *, double, double, int);
-DCELL Rast_get_raster_sample_cubic(int, const struct Cell_head *, struct Categories *, double, double, int);
-DCELL Rast_get_raster_sample(int, const struct Cell_head *, struct Categories *, double, double, int, INTERP_TYPE);
+DCELL Rast_get_sample_nearest(int, const struct Cell_head *, struct Categories *, double, double, int);
+DCELL Rast_get_sample_bilinear(int, const struct Cell_head *, struct Categories *, double, double, int);
+DCELL Rast_get_sample_cubic(int, const struct Cell_head *, struct Categories *, double, double, int);
+DCELL Rast_get_sample(int, const struct Cell_head *, struct Categories *, double, double, int, INTERP_TYPE);
/* set_window.c */
int Rast_set_window(struct Cell_head *);
Modified: grass/trunk/lib/raster/sample.c
===================================================================
--- grass/trunk/lib/raster/sample.c 2009-06-30 17:25:23 UTC (rev 38129)
+++ grass/trunk/lib/raster/sample.c 2009-06-30 17:39:56 UTC (rev 38130)
@@ -47,7 +47,7 @@
*
* \return cell value at given position
*/
-DCELL Rast_get_raster_sample(int fd,
+DCELL Rast_get_sample(int fd,
const struct Cell_head *window,
struct Categories *cats,
double north, double east,
@@ -57,16 +57,16 @@
switch (itype) {
case NEAREST:
- retval = Rast_get_raster_sample_nearest(fd, window, cats, north, east, usedesc);
+ retval = Rast_get_sample_nearest(fd, window, cats, north, east, usedesc);
break;
case BILINEAR:
- retval = Rast_get_raster_sample_bilinear(fd, window, cats, north, east, usedesc);
+ retval = Rast_get_sample_bilinear(fd, window, cats, north, east, usedesc);
break;
case CUBIC:
- retval = Rast_get_raster_sample_cubic(fd, window, cats, north, east, usedesc);
+ retval = Rast_get_sample_cubic(fd, window, cats, north, east, usedesc);
break;
default:
- G_fatal_error("Rast_get_raster_sample: %s",
+ G_fatal_error("Rast_get_sample: %s",
_("Unknown interpolation type"));
}
@@ -88,7 +88,7 @@
*
* \return cell value at given position
*/
-DCELL Rast_get_raster_sample_nearest(int fd,
+DCELL Rast_get_sample_nearest(int fd,
const struct Cell_head *window,
struct Categories *cats,
double north, double east, int usedesc)
@@ -146,7 +146,7 @@
*
* \return cell value at given position
*/
-DCELL Rast_get_raster_sample_bilinear(int fd,
+DCELL Rast_get_sample_bilinear(int fd,
const struct Cell_head *window,
struct Categories *cats,
double north, double east, int usedesc)
@@ -235,7 +235,7 @@
*
* \return cell value at given position
*/
-DCELL Rast_get_raster_sample_cubic(int fd,
+DCELL Rast_get_sample_cubic(int fd,
const struct Cell_head *window,
struct Categories *cats,
double north, double east, int usedesc)
Modified: grass/trunk/vector/v.drape/main.c
===================================================================
--- grass/trunk/vector/v.drape/main.c 2009-06-30 17:25:23 UTC (rev 38129)
+++ grass/trunk/vector/v.drape/main.c 2009-06-30 17:39:56 UTC (rev 38130)
@@ -53,7 +53,7 @@
/* sample raster at this point, and update the z-coordinate
* (note that input vector should not be 3D!)
*/
- estimated_elevation = scale * Rast_get_raster_sample(
+ estimated_elevation = scale * Rast_get_sample(
fdrast, &window, NULL, Points->y[0], Points->x[0], 0, method);
/* Elevation value has to be meaningfull */
if (Rast_is_d_null_value(&estimated_elevation)) {
@@ -76,7 +76,7 @@
/* loop through each point in a line */
for (j = 0; j < Points->n_points; j++) {
/* sample raster at this point, and update the z-coordinate (note that input vector should not be 3D!) */
- estimated_elevation = scale * Rast_get_raster_sample(
+ estimated_elevation = scale * Rast_get_sample(
fdrast, &window, NULL, Points->y[j], Points->x[j], 0, method);
if (Rast_is_d_null_value(&estimated_elevation)) {
@@ -100,7 +100,7 @@
/* loop through each point in a line */
for (j = 0; j < Points->n_points; j++) {
/* sample raster at this point, and update the z-coordinate (note that input vector should not be 3D!) */
- estimated_elevation = scale * Rast_get_raster_sample(
+ estimated_elevation = scale * Rast_get_sample(
fdrast, &window, NULL, Points->y[j], Points->x[j], 0, method);
if (Rast_is_d_null_value(&estimated_elevation)) {
Modified: grass/trunk/vector/v.extrude/main.c
===================================================================
--- grass/trunk/vector/v.extrude/main.c 2009-06-30 17:25:23 UTC (rev 38129)
+++ grass/trunk/vector/v.extrude/main.c 2009-06-30 17:39:56 UTC (rev 38130)
@@ -392,7 +392,7 @@
/* do not trace -> calculate minumum dem offset */
if (fdrast && !trace) {
for (k = 0; k < Points->n_points; k++) {
- voffset_curr = Rast_get_raster_sample(fdrast, &window, NULL,
+ voffset_curr = Rast_get_sample(fdrast, &window, NULL,
Points->y[k], Points->x[k], 0,
NEAREST);
if (Rast_is_d_null_value(&voffset_curr))
@@ -415,12 +415,12 @@
/* trace */
if (fdrast && trace) {
- voffset_curr = Rast_get_raster_sample(fdrast, &window, NULL,
+ voffset_curr = Rast_get_sample(fdrast, &window, NULL,
Points->y[k], Points->x[k], 0,
NEAREST);
if (type != GV_POINT) {
- voffset_next = Rast_get_raster_sample(fdrast, &window, NULL,
+ voffset_next = Rast_get_sample(fdrast, &window, NULL,
Points->y[k + 1],
Points->x[k + 1], 0,
NEAREST);
Modified: grass/trunk/vector/v.sample/main.c
===================================================================
--- grass/trunk/vector/v.sample/main.c 2009-06-30 17:25:23 UTC (rev 38129)
+++ grass/trunk/vector/v.sample/main.c 2009-06-30 17:39:56 UTC (rev 38130)
@@ -256,7 +256,7 @@
G_debug(4, "actual = %e", actual);
/* find predicted value */
- predicted = Rast_get_raster_sample(fdrast, &window, NULL, Points->y[0],
+ predicted = Rast_get_sample(fdrast, &window, NULL, Points->y[0],
Points->x[0], 0, method);
if (Rast_is_d_null_value(&predicted))
continue;
More information about the grass-commit
mailing list