#4009: 'where' option in v.to.rast can select wrong feature for raster attribute, in areas where features overlap ------------------------+--------------------------------- Reporter: florisvdh | Owner: grass-dev@… Type: defect | Status: new Priority: normal | Milestone: Component: Vector | Version: svn-releasebranch76 Resolution: | Keywords: v.to.rast sql where CPU: x86-64 | Platform: Linux ------------------------+---------------------------------
Comment (by mlennert): Replying to [ticket:4009 florisvdh]: > I use GRASS 7.6.1 on Linux Mint 18.1, i.e. Ubuntu Xenial (16.04) based. ''(Note, this is my first post here, I'm a beginning GRASS user, mostly working with R)'' > > I applied something like: > > {{{ > v.to.rast input=polygon_layer output=output_x1 where="field1 LIKE 'x1'" \ > use=attr attribute_column=field2 memory=800 --overwrite > }}} > > Importantly, {{{field1}}} in {{{polygon_layer}}} has several possible values such as {{{x1}}}, {{{x2}}}, {{{x3}}} and so on (81 different values in my usecase). > > Moreover, in my usecase several features (polygons) have identical geometry, i.e. many sets of 2 or more polygons exist with 100% overlap among their own polygons (i.e. identical polygons), while each of these polygons has its own specific attributes: different values of {{{field1}}} and so on. The problem that I met occurs for those features; possibly the same problem will occur for overlapping areas between polygons in general. > > While the {{{where}}} option in {{{v.to.rast}}} is effective in ''localizing the correct areas'', i.e. where {{{field1}}} is {{{x1}}}, the **problem** is that the **attribute value** ({{{field2}}}) may come from one of the other (overlapping) features at that place, e.g. where {{{field1}}} is {{{x2}}}. Which feature of an overlapping set is used for the attribute probably depends on the order of those overlapping features. > > From what I've seen, it appears that {{{v.to.rast}}} will select the {{{field2}}} value **from the same feature regardless** of the value for {{{field1}}} in the above {{{where}}} option, as long as ''one'' of those overlapping features meets the {{{where}}} condition. > > If this effectively ''is'' a bug in the program, maybe it happens in other modules as well, where the {{{where}}} option is available. This definitely should not happen. Could you provide the output of: {{{ v.db.select map=polygon_layer where="field1 LIKE 'x1'" \ column=cat,field1,field2 }}} ? -- Ticket URL: <https://trac.osgeo.org/grass/ticket/4009#comment:1> GRASS GIS <https://grass.osgeo.org>
_______________________________________________ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev