[GRASS-dev] Different v.mkgrid table output depending on grid size

Michel Wortmann wortmann at pik-potsdam.de
Wed Dec 2 14:20:14 PST 2015


Hi Markus, sorry so late. Here is my diff of v.mkgrid/main.c

diff --git a/vector/v.mkgrid/main.c b/vector/v.mkgrid/main.c
index db733fd..5004fa0 100644
--- a/vector/v.mkgrid/main.c
+++ b/vector/v.mkgrid/main.c
@@ -451,7 +451,7 @@ int main(int argc, char *argv[])
                    }
                    else {
                        sprintf(buf, "( %d, %d, %d )",
-                               attCount + 1, i + 1, j + 1);
+                              attCount + 1, grid_info.num_rows - i, j + 1);
                    }
                    if (db_append_string(&sql, buf) != DB_OK)
                        G_fatal_error(_("Unable to fill attribute table"));


It’s just this single line that is changed.
Regards,
Michel


On 28 Nov 2015, at 18:15, Markus Neteler <neteler at osgeo.org> wrote:

> On Sat, Nov 28, 2015 at 11:24 AM, Michel Wortmann
> <wortmann at pik-potsdam.de> wrote:
>> The magical number 27 comes from the fact that it puts letters into rown and
>> coln and the alphabet is exhausted after 27 (although I wonder why the
>> condition is && and not ||?). The inconsistency is just related to the
>> counting of the row, i.e. the second argument to sprintf() in the else
>> statement. So all thats needed is to replace the i + 1 with
>> grid_info.num_rows - i.
> 
> Can you please send a diff?
> 
> Markus

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-dev/attachments/20151202/de4630a8/attachment.html>


More information about the grass-dev mailing list