Re: [GRASS-user] Null values in attribute table get converted to 0 (zero) during v.to.rast

2019-11-01 Thread Micha Silver

  
  

On 01/11/2019 9:38, Markus Metz wrote:


  
  

On Fri, Nov 1, 2019 at 12:11 AM Veronica Andreo 
wrote:
>
> Hi Micha
>
> El jue., 31 oct. 2019 a las 22:36, Micha Silver ()
escribió:
>>
>>
>> On 31/10/2019 22:20, Markus Metz wrote:
>>
>>
>>
>> On Tue, Oct 29, 2019 at 7:40 PM Veronica Andreo 
wrote:
>> >
>> > Hi Daniel,
>> >
>> > I agree that if there's a NULL in the column,
there should be NULL in the resulting raster. I suggest to open
a ticket here: https://trac.osgeo.org/grass/
>>
>> easy solution: v.to.rast
where=" is not null"
>>
>> or the new PR #173
>> https://github.com/OSGeo/grass/pull/173
>> if an attribute value is null, the corresponding vector
features will not be rasterized
>>
>> Markus M
>>
>> I'm not sure I agree with the approach that a polygon
with missing attribute should become NULL. In my view, NULL
should be used only for pixels not covered at all by any
polygon.
>
> but in the resulting raster (in rasters in general),
  there's no difference, it's rather NULL or it has a value...
  it does not matter if the null comes from areas originally
  covered by a polygon or not... 



I think it depends on the particular use case if it matters
  where a NULL raster value comes from: a polygon with empty
  attribute or no polygon at all for that cell.



>>
>> Perhaps an additional input parameter
"missing_attribute" so the user can choose a value to enter into
the raster if the attribute is missing. If no parameter is
supplied, and the chosen attribute column has missing values,
I'd prefer that the script exit gracefully, with a message that
a "missing_attribute" value is required.


This can easily be done with existing tools:
- convert only those polygons with a valid attribute value:
  v.to.rast where="attribute is not null"

- replace missing attribute values with a valid value:
  v.db.update where="attribute is null", then v.to.rast



I'm changing my PR to issue a warning if empty attribute
  values are found and replaced with zero.
  



IMHO, that's probably the best way to deal with this.



  


Markus M



>
> yes, this could be a solution to keep track of where you
had polygons, but then you would need to use r.null anyway, no?
I try to think of use cases in which one uses a vector attribute
to convert to raster, but then still needs to know where the
polygons were... because, for example, to query a raster map
with another raster map representing zones one would convert the
vector of polygons using cat and not an attribute, no?
>
> cheers,
> Vero
>>
>>
>> > El jue., 24 oct. 2019 a las 14:40, Daniel Victoria
()
escribió:
>> >>
>> >> Hi list,
>> >>
>> >> I have a vector polygon map that I'm
converting to raster. The attribute column that I process has
some empty rows (no data / null). When I run v.to.rast, these
empty rows become 0 (zero) on my resulting raster map.
>> >>
>> >> Shouldn't v.to.rast respect the empty
attribute table and create null values for those polygons?
>> >>
>> >> For now I'll use r.null to fix this problem.
But what if 0 is a valid value?
>> >>
>> >> Cheers
>> >> Daniel
>> >>
>> >> PS - Running Grass 7.6.1 on Ubuntu
>> >>
___
>> >> grass-user mailing list
>> >> grass-user@lists.osgeo.org
>> >> https://lists.osgeo.org/mailman/listinfo/grass-user
>> >
>> > ___
>> > grass-user mailing list
>> > grass-user@lists.osgeo.org
>> > https://lists.osgeo.org/mailman/listinfo/grass-user
>>
>> ___
>> grass-user mailing list
>> grass-user@lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/grass-user
>>
>> -- 
>> Micha Silver
>> Ben Gurion Univ.
>> Sde Boker, Remote Sensing Lab
>> cell: +972-523-665918

-- 
Micha Silver
Ben Gurion Univ.
Sde

[GRASS-user] WinGRASS build up (WIP)

2019-11-01 Thread Martin Landa
Dear all,

after several months of having WinGRASS builds down I have finally
good news. I am slowly restoring daily builds (including addons). I
will keep you informed.

You can test WinGRASS builds of version 7.8.0 (first Python3-ready
GRASS version!) from OSGeo4W network and standalone installer [1].
Addons for version 7.8.0 will be restored soon.

BIG THANKS especially to Juergen for PR [2] and Helli for testing it!!!

Martin

[1] 
https://grass.osgeo.org/grass78/binary/mswindows/native/x86_64/WinGRASS-7.8.0-1-Setup-x86_64.exe
[2] https://github.com/osgeo/grass/pull/137

-- 
Martin Landa
http://geo.fsv.cvut.cz/gwiki/Landa
http://gismentors.cz/mentors/landa
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user

Re: [GRASS-user] Null values in attribute table get converted to 0 (zero) during v.to.rast

2019-11-01 Thread Markus Metz
On Fri, Nov 1, 2019 at 12:11 AM Veronica Andreo 
wrote:
>
> Hi Micha
>
> El jue., 31 oct. 2019 a las 22:36, Micha Silver ()
escribió:
>>
>>
>> On 31/10/2019 22:20, Markus Metz wrote:
>>
>>
>>
>> On Tue, Oct 29, 2019 at 7:40 PM Veronica Andreo 
wrote:
>> >
>> > Hi Daniel,
>> >
>> > I agree that if there's a NULL in the column, there should be NULL in
the resulting raster. I suggest to open a ticket here:
https://trac.osgeo.org/grass/
>>
>> easy solution: v.to.rast where=" is not null"
>>
>> or the new PR #173
>> https://github.com/OSGeo/grass/pull/173
>> if an attribute value is null, the corresponding vector features will
not be rasterized
>>
>> Markus M
>>
>> I'm not sure I agree with the approach that a polygon with missing
attribute should become NULL. In my view, NULL should be used only for
pixels not covered at all by any polygon.
>
> but in the resulting raster (in rasters in general), there's no
difference, it's rather NULL or it has a value... it does not matter if the
null comes from areas originally covered by a polygon or not...

I think it depends on the particular use case if it matters where a NULL
raster value comes from: a polygon with empty attribute or no polygon at
all for that cell.

>>
>> Perhaps an additional input parameter "missing_attribute" so the user
can choose a value to enter into the raster if the attribute is missing. If
no parameter is supplied, and the chosen attribute column has missing
values, I'd prefer that the script exit gracefully, with a message that a
"missing_attribute" value is required.

This can easily be done with existing tools:
- convert only those polygons with a valid attribute value: v.to.rast
where="attribute is not null"
- replace missing attribute values with a valid value: v.db.update
where="attribute is null", then v.to.rast

I'm changing my PR to issue a warning if empty attribute values are found
and replaced with zero.

Markus M

>
> yes, this could be a solution to keep track of where you had polygons,
but then you would need to use r.null anyway, no? I try to think of use
cases in which one uses a vector attribute to convert to raster, but then
still needs to know where the polygons were... because, for example, to
query a raster map with another raster map representing zones one would
convert the vector of polygons using cat and not an attribute, no?
>
> cheers,
> Vero
>>
>>
>> > El jue., 24 oct. 2019 a las 14:40, Daniel Victoria (<
daniel.victo...@gmail.com>) escribió:
>> >>
>> >> Hi list,
>> >>
>> >> I have a vector polygon map that I'm converting to raster. The
attribute column that I process has some empty rows (no data / null). When
I run v.to.rast, these empty rows become 0 (zero) on my resulting raster
map.
>> >>
>> >> Shouldn't v.to.rast respect the empty attribute table and create null
values for those polygons?
>> >>
>> >> For now I'll use r.null to fix this problem. But what if 0 is a valid
value?
>> >>
>> >> Cheers
>> >> Daniel
>> >>
>> >> PS - Running Grass 7.6.1 on Ubuntu
>> >> ___
>> >> grass-user mailing list
>> >> grass-user@lists.osgeo.org
>> >> https://lists.osgeo.org/mailman/listinfo/grass-user
>> >
>> > ___
>> > grass-user mailing list
>> > grass-user@lists.osgeo.org
>> > https://lists.osgeo.org/mailman/listinfo/grass-user
>>
>> ___
>> grass-user mailing list
>> grass-user@lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/grass-user
>>
>> --
>> Micha Silver
>> Ben Gurion Univ.
>> Sde Boker, Remote Sensing Lab
>> cell: +972-523-665918
___
grass-user mailing list
grass-user@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/grass-user