Skip to main content
2 of 3
added 56 characters in body
Bastien
  • 649
  • 4
  • 17

Cannot manage to get the WHERE statement to work in v.generalize

I have a shape (its topology is terrible but I don't think it's the problem). I'm trying to simplify it to reduced it's size using v.generalise. I succeeded at reducing the whole shape but I actually want to do a two steps simplification:

  1. simplifying all the shape with threshold 0.0001 first,
  2. simplifying all the polygons with urban=0 further more with threshold 0.0003

The problem is that my second v.generalize call simplifies everything, like if the WHERE call wasn't working.

For this question, we will just focus on the point 2, so here what I do:

A subset of my data can be found here.

And here is some visualization of what I did:

My shape initially:

enter image description here

My v.generalize call:

enter image description here

The result (below) show the blue line the new polygons border which where simplified even if they were not in urban=0.

enter image description here

Just like if the WHERE statement was ignore. I don't see any error in the log specific to that SQL statement. The actual call to GRASS built by QGIS is:

C:\OSGEO4~1\bin>v.generalize input=vector_5be4482a0b8e72 type="line,boundary,area" where="urban=0" method="douglas" threshold=0.0003 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=output96039149be394bdaa48a3ba7d8b849f7 error=error96039149be394bdaa48a3ba7d8b849f7 --overwrite 

I've try multiple WHERE statement (urban="0", urban<1, etc) to try to match the v.generalise tutorial but still no luck. I also tried to do it directly in GRASS bypassing QGIS and the problem persist meaning is not a QGIS problem more than a GRASS problem.

In this example, the urban field is a real number.

Any idea what the problem is?

Bastien
  • 649
  • 4
  • 17