I am facing a dilemma while trying to use v.generalize to simplify polygons which are similar in size and structure to US Counties or States. Often, I lose polygons from the data set after running either a simplification or smoothing method on them. What troubles me is that there does not seem to be any consistent pattern to this behavior. In some cases the same set of commands applied to different data sets causes causes completely different results. As a result, I am unable to develop a repeatable workflow and am reluctantly starting to look for other simplification tools that preserve topololgy. Here is an example:

v.in.ogr dsn=counties.shp output=county
v.build.polylines input=county output=county_polylines
v.clean input=county_polylines output=county_clean tool=bpol,rmdupl type=boundary

v.generalize input=county_clean output=county_smooth method=sliding_averaging look_ahead=7 slide=1
v.generalize input=county_smooth output=county_general method=douglas threshold=.005

Each of the v.generalize steps results in some of the polygons disappearing. I'd like to understand why this happens. Is it due to features being loaded into insufficient memory? Are my parameters "tight" enough to cause features to be excluded because they've met some sort of geometry criteria? (Note that I'm losing some very large features.) Is there a problem with the topology of the dropped features which causes them to get erased? Related to that last question, I assume that build.polylines and clean operations that I do initially should take care of this, but I'm not entirely certain, and I can't seem to find good instructions that address this. Are there any?

Appreciate any insights people can give, especially those based on personal experience with the v.generalize tool.


  • it looks like your data could be in lat lon. which would be enough to lose data with your .005 threshold. can you verify you are using a planar cs?
    – Brad Nesom
    Oct 10 '11 at 18:44
  • I actually wondered about that and had reprojected to an Albers Equal Area projection before running the above. Here are the projection parameters: USER:100002 (+proj=aea +lat_1=20 +lat_2=-23 +lat_0=0 +lon_0=25 +x_0=0 +y_0=0 +ellps=WGS84 +units=m +no_defs). Still have the same problem. Oct 10 '11 at 19:02
  • I'm wondering why you convert the polygons to polylines. Is there a specific reason why you don't just simplify the polygons directly?
    – underdark
    Oct 10 '11 at 21:45
  • Ok, I pulled out v.build.polylines part, so "county_clean" is now a polygon layer. Still lose a bunch of areas. I had thought initially that it might make the simplification easier, but since "bpol" in v.clean is also breaking the polygons, maybe it doesn't matter. Oct 10 '11 at 23:10
  • 1
    just a stupid question. Are you sure you're loosing data using v.generalize and not v.clean?
    – simo
    Oct 11 '11 at 12:07

Answer from GRASS development team.

"The disappearance of polygons [in v 6.4.1] happened because smoothed boundaries that violated vector topology were deleted, after that all boundaries that were topologically incorrect. Boundaries are now [in 6.4.2] only smoothed/simplified if the modification does not violate vector topology."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.