[GRASS-SVN] r58480 - grass/branches/develbranch_6/vector/v.vol.rst
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Dec 17 07:25:50 PST 2013
Author: annakrat
Date: 2013-12-17 07:25:50 -0800 (Tue, 17 Dec 2013)
New Revision: 58480
Modified:
grass/branches/develbranch_6/vector/v.vol.rst/user1.c
Log:
v.vol.rst: fixed masking with 2D raster: mask rows were intentionally flipped, reason unknown, it does not seem to be related to changes for #1389 (major g3d lib review in G7) because the same problem is in G64.
Modified: grass/branches/develbranch_6/vector/v.vol.rst/user1.c
===================================================================
--- grass/branches/develbranch_6/vector/v.vol.rst/user1.c 2013-12-17 15:22:40 UTC (rev 58479)
+++ grass/branches/develbranch_6/vector/v.vol.rst/user1.c 2013-12-17 15:25:50 UTC (rev 58480)
@@ -65,7 +65,7 @@
struct quadruple *point;
double x, y, z, w, nz = 0., sm;
double c1, c2, c3, c4, c5, c6, nsg;
- int i, j, k = 0, a, irev, cfmask;
+ int i, j, k = 0, a, cfmask;
int ddisk = 0;
double deltx, delty, deltz;
int first_time = 1;
@@ -366,13 +366,12 @@
cellmask = G_allocate_cell_buf();
cfmask = G_open_cell_old(maskmap, mapsetm);
for (i = 0; i < nsizr; i++) {
- irev = nsizr - i - 1;
G_get_map_row(cfmask, cellmask, i);
for (j = 0; j < nsizc; j++) {
if ((cellmask[j] == 0) || G_is_c_null_value(&cellmask[j]))
- BM_set(bitmask, j, irev, 0);
+ BM_set(bitmask, j, i, 0);
else
- BM_set(bitmask, j, irev, 1);
+ BM_set(bitmask, j, i, 1);
}
}
G_message("bitmap mask created");
@@ -441,7 +440,7 @@
cnt = 0;
for (iarc = 0; iarc < nsizl; iarc++) {
- for (y = nsizr - 1; y >= 0; y--) { /* changed by AV */
+ for (y = 0; y < nsizr; y++) {
for (x = 0; x < nsizc; x++) {
if (maskmap != NULL)
bmask = BM_get(bitmask, x, y);
@@ -492,7 +491,7 @@
cnt = 0;
for (iarc = 0; iarc < nsizl; iarc++) {
- for (y = nsizr - 1; y >= 0; y--) { /* changed by AV */
+ for (y = 0; y < nsizr; y++) {
for (x = 0; x < nsizc; x++) {
if (maskmap != NULL)
bmask = BM_get(bitmask, x, y);
@@ -543,7 +542,7 @@
cnt = 0;
for (iarc = 0; iarc < nsizl; iarc++) {
- for (y = nsizr - 1; y >= 0; y--) { /* changed by AV */
+ for (y = 0; y < nsizr; y++) {
for (x = 0; x < nsizc; x++) {
if (maskmap != NULL)
bmask = BM_get(bitmask, x, y);
@@ -594,7 +593,7 @@
cnt = 0;
for (iarc = 0; iarc < nsizl; iarc++) {
- for (y = nsizr - 1; y >= 0; y--) { /* changed by AV */
+ for (y = 0; y < nsizr; y++) {
for (x = 0; x < nsizc; x++) {
if (maskmap != NULL)
bmask = BM_get(bitmask, x, y);
@@ -645,7 +644,7 @@
cnt = 0;
for (iarc = 0; iarc < nsizl; iarc++) {
- for (y = nsizr - 1; y >= 0; y--) { /* changed by AV */
+ for (y = 0; y < nsizr; y++) {
for (x = 0; x < nsizc; x++) {
if (maskmap != NULL)
bmask = BM_get(bitmask, x, y);
@@ -696,7 +695,7 @@
cnt = 0;
for (iarc = 0; iarc < nsizl; iarc++) {
- for (y = nsizr - 1; y >= 0; y--) { /* changed by AV */
+ for (y = 0; y < nsizr; y++) {
for (x = 0; x < nsizc; x++) {
if (maskmap != NULL)
bmask = BM_get(bitmask, x, y);
@@ -747,7 +746,7 @@
cnt = 0;
for (iarc = 0; iarc < nsizl; iarc++) {
- for (y = nsizr - 1; y >= 0; y--) { /* changed by AV */
+ for (y = 0; y < nsizr; y++) {
for (x = 0; x < nsizc; x++) {
if (maskmap != NULL)
bmask = BM_get(bitmask, x, y);
More information about the grass-commit
mailing list