Details Ticket 5184


Comment | Reply | Take | Resolve


Serial Number 5184
Subject r.null -n: always creates a null bitmap - no matter if it already exists
Area grass6
Queue grass
Requestors joel.pitt@gmail.com,tutey@o2.pl
Owner none
Status open
Last User Contact Tue Oct 3 19:35:31 2006 (2 yr ago)
Current Priority 30
Final Priority 70
Due No date assigned
Last Action Wed Oct 4 00:46:31 2006 (2 yr ago)
Created Tue Oct 3 11:58:53 2006 (2 yr ago)

Transaction History Ticket 5184


Tue, Oct 3 2006 11:58:53    Request created by msieczka  
Subject: r.null -n: always creates a null bitmap - no matter if it already exists
(filling a bug report for Benjamin Ducke)

Platform: GNU/Linux/x86_64
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: GRASS 6.1.cvs (2006)

the -n option is supposed to only do work (ie create a null bitmap) if
the null bitmap doesn't already exist. Currently it always does it.

only_null is the flag option and is only referred to in null.c in the
following if statement:


if(only_null && !G_find_file(element, "null", mapset))
{
    sprintf (buf, "%s doesn't have null bitmap file! Exiting", name);
    G_warning(buf);
    exit(0);
}

It should probably be:

if(!only_null && !G_find_file(element, "null", mapset))
{
    sprintf (buf, "%s doesn't have null bitmap file! Exiting", name);
    G_warning(buf);
    exit(0);
}

and have another test for checking whether the file does exist and -n
is set. i.e.

if(only_null && G_find_file(element, "null", mapset))
{
    exit(0);
}
Tue, Oct 3 2006 19:35:31    Mail sent by glynn@gclements.plus.com  
Return-Path <glynn@gclements.plus.com>
Delivered-To grass-bugs@lists.intevation.de
From Glynn Clements <glynn@gclements.plus.com>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Message-ID <17698.40799.230356.773827@cerise.gclements.plus.com>
Date Tue, 3 Oct 2006 18:35:27 +0100
To Request Tracker <grass-bugs@intevation.de>
Cc grass-dev@grass.itc.it
Subject Re: [GRASS-dev] [bug #5184] (grass) r.null -n: always creates a null bitmap - no matter if it already exists
In-Reply-To <20061003095853.BDC321005C3@lists.intevation.de>
References <20061003095853.BDC321005C3@lists.intevation.de>
X-Mailer VM 7.07 under 21.4 (patch 17) "Jumbo Shrimp" XEmacs Lucid
X-Virus-Scanned by amavisd-new at intevation.de
X-Spam-Status No, hits=-5 tagged_above=-999 required=3 tests=[BAYES_00=-5]
X-Spam-Level
Request Tracker wrote:

> this bug's URL: http://intevation.de/rt/webrt?serial_num=5184
> -------------------------------------------------------------------------
> 
> Subject: r.null -n: always creates a null bitmap - no matter if it already
exists
> 
> (filling a bug report for Benjamin Ducke)
> 
> Platform: GNU/Linux/x86_64
> grass obtained from: CVS
> grass binary for platform: Compiled from Sources
> GRASS Version: GRASS 6.1.cvs (2006)
> 
> the -n option is supposed to only do work (ie create a null bitmap) if
> the null bitmap doesn't already exist. Currently it always does it.
> 
> only_null is the flag option and is only referred to in null.c in the
> following if statement:
> 
> 
> if(only_null && !G_find_file(element, "null", mapset))
> {
>     sprintf (buf, "%s doesn't have null bitmap file! Exiting", name);
>     G_warning(buf);
>     exit(0);
> }
> 
> It should probably be:
> 
> if(!only_null && !G_find_file(element, "null", mapset))
> {
>     sprintf (buf, "%s doesn't have null bitmap file! Exiting", name);
>     G_warning(buf);
>     exit(0);
> }

No; according to the flag's description, it should be:

if(only_null && G_find_file(element, "null", mapset))
{
     sprintf (buf, "%s already has a null bitmap file! Exiting", name);
     G_warning(buf);
     exit(0);
}

-- 
Glynn Clements <glynn@gclements.plus.com>


Wed, Oct 4 2006 00:46:31    Mail sent by joel.pitt@gmail.com  
Return-Path <joel.pitt@gmail.com>
Delivered-To grass-bugs@lists.intevation.de
DomainKey-Signature a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=YraXDyh1i2St14pB4Hrl3O1bKluUL5KeLV/BKakLBUd3YZBFOCwp2mI9MzmjvD2LRBa64V4TJ4NC/84A34FB/2nIoxsO4YQlgPQlg44NXTNi347nbVrVl6P6QMABrEln+LBGj6rHJZYwXr/ulHBqJ5w8ovAuRfQori4qDTszgiA=
Message-ID <d7e54a6c0610031546g144502f0k3f25155b55775006@mail.gmail.com>
Date Wed, 4 Oct 2006 11:46:29 +1300
From "Joel Pitt" <joel.pitt@gmail.com>
Reply-To joel.pitt@gmail.com
To "Glynn Clements via RT" <grass-bugs@intevation.de>
Subject Re: [bug #5184] (grass) r.null -n: always creates a null
Cc tutey@o2.pl
In-Reply-To <20061003173531.0D3261006A3@lists.intevation.de>
MIME-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Content-Disposition inline
References <20061003173531.0D3261006A3@lists.intevation.de>
X-Virus-Scanned by amavisd-new at intevation.de
X-Spam-Status No, hits=-4.933 tagged_above=-999 required=3 tests=[BAYES_00=-5, RCVD_BY_IP=0.067]
X-Spam-Level
On 10/4/06, Glynn Clements via RT <grass-bugs@intevation.de> wrote:
>
> Request Tracker wrote:
>
> > this bug's URL: http://intevation.de/rt/webrt?serial_num=5184
> > -------------------------------------------------------------------------
> >
> > Subject: r.null -n: always creates a null bitmap - no matter if it already
exists
> >
> > (filling a bug report for Benjamin Ducke)
> >
> > Platform: GNU/Linux/x86_64
> > grass obtained from: CVS
> > grass binary for platform: Compiled from Sources
> > GRASS Version: GRASS 6.1.cvs (2006)
> >
> > the -n option is supposed to only do work (ie create a null bitmap) if
> > the null bitmap doesn't already exist. Currently it always does it.
> >
> > only_null is the flag option and is only referred to in null.c in the
> > following if statement:
> >
> >
> > if(only_null && !G_find_file(element, "null", mapset))
> > {
> >     sprintf (buf, "%s doesn't have null bitmap file! Exiting", name);
> >     G_warning(buf);
> >     exit(0);
> > }
> >
> > It should probably be:
> >
> > if(!only_null && !G_find_file(element, "null", mapset))
> > {
> >     sprintf (buf, "%s doesn't have null bitmap file! Exiting", name);
> >     G_warning(buf);
> >     exit(0);
> > }
>
> No; according to the flag's description, it should be:
>
> if(only_null && G_find_file(element, "null", mapset))
> {
>      sprintf (buf, "%s already has a null bitmap file! Exiting", name);
>      G_warning(buf);
>      exit(0);
> }
>
> --
> Glynn Clements <glynn@gclements.plus.com>

Ok, but I think that the warning should still be removed, since the
user is explicitly asking the r.null to not do work when a null bitmap
file exists.

Maybe there should also be a logic check in case the user specifies -r
(remove null bitmask) and -n (Only do the work if the map doesn't have
a NULL-value bitmap file) at the same time?

-- 
-Joel

"Wish not to seem, but to be, the best."
                -- Aeschylus


Comment | Reply | Take | Resolve

You are currently authenticated as guest.
[Show Configuration] [Login as another user]

Users Guide - Mail Commands - Homepage of RequestTracker 1.0.7 - list any request