[GRASS-dev] [GRASS GIS] #3694: WHERE statement in v.generalize do not work

GRASS GIS trac at osgeo.org
Tue Nov 13 05:16:43 PST 2018


#3694: WHERE statement in v.generalize do not work
--------------------------+-------------------------
 Reporter:  BastienFR     |      Owner:  grass-dev@…
     Type:  defect        |     Status:  new
 Priority:  normal        |  Milestone:
Component:  Default       |    Version:  7.4.1
 Keywords:  v.generalize  |        CPU:  x86-64
 Platform:  MSWindows     |
--------------------------+-------------------------
 The `WHERE` statement from `v.generalize` do not seem to work anymore.

 A good description of the problem was done at:

 https://gis.stackexchange.com/questions/301858/cannot-manage-to-get-the-
 where-statement-to-work-in-v-generalize

 Another example:

 The attached shape was produced in R with:


 {{{
 library(sf)
 library(dplyr)

 # preparing the shapefile
 nc <- st_read(system.file("gpkg/nc.gpkg", package="sf"), quiet = TRUE) %>%
   mutate(CNTY = as.numeric(CNTY_<median(CNTY_))) %>%
   select(CNTY) %>%
   st_transform(st_crs(2264)) %>%
   st_write("d:/temp/NC_test.shp")
 }}}


 Using QGIS to call `v.generalize` (the same problem happens in grass
 directly, however I prefer working directly in QGIS):

 `C:\OSGEO4~1\bin>v.generalize input=vector_5beaccc5750337
 type="line,boundary,area" where="CNTY<1" method="douglas" threshold=15000
 look_ahead=7 reduction=50 slide=0.5 angle_thresh=3 degree_thresh=0
 closeness_thresh=0 betweeness_thresh=0 alpha=1 beta=1 iterations=1 -l
 output=outputdc6669bcd1974052b171ef4c11d51846
 error=errordc6669bcd1974052b171ef4c11d51846 --overwrite`

 I get generalization over all the territory and not just limited to the
 polygons where `CNTY<1`

 (see image attached)

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/3694>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list