3

The problem occurs, when using the commands "Smooth geometry" or "v.generalize.smooth" in QGIS.

The shapefile, which I want to smooth, shows a flood water level and looks like this: enter image description here

The water level contains some hard edges, which wouldn't look like this in reality, so I want to smooth those edges a little bit, using the commands I mentioned above. It gives a nice looking result, but unfortunately includes invalid elements.

I uploaded the files at wetransfer: https://we.tl/45WV0KpTLx

  • water_level_HQ30_diff.shp: original file without validity problems
  • water_level_HQ30_smooth.shp: smoothed with v.generalize.smooth (Grass Gis 7 command)
  • water_level_HQ30_smooth_native.shp: smoothed with "Smooth geometry" (QGIS geoalgorithm)

How can I get this vector layer smoothed without getting invalid elements?

  • How do you check validity? And what parameters. Testing the original file brings invalid objects due to some double nodes. The smoothed one was fine actually using the QGIS build in check. – Matte Jan 3 '18 at 7:13
  • Thank you for your quick response! I use the QGIS build in "check validity" with default settings. I get no invalid objects at the original file, but with the smoothed files. How did you find out about the double nodes in the original file? – Christian Jan 3 '18 at 9:25
  • Can you add QGIS version and what geometry errors the tool gave you? I get different outcomes with the tools from QGIS and PostGIS. PostGIS ST-IsValidReason tells that object with id 211 has a self-intersection. In this case i would just add a v.clean after the smoothing. – Matte Jan 3 '18 at 9:49
  • I use QGIS Version 2.18.4. As I said the original file had no invalid elements. water_level_HQ30_smooth.shp gives me one invalid polygon: ID 211. _errors: segments 0 and 24 of line 0 intersect at -75653.325, 187887.566 segments 24 and 35288 of line 0 intersect at -75653.325, 187887.566 segments 25 and 35288 of line 0 intersect at -75653.325, 187887.566 segments 2993 and 3007 of line 0 intersect at -75436... – Christian Jan 3 '18 at 11:01
  • Thank you very much! The command v.clean you suggested, worked for me in this case, but some colleagues warned me about this command. Apparently it's known for "stealing" some elements. – Christian Jan 3 '18 at 11:04

Your Answer

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

Browse other questions tagged or ask your own question.