I downloaded GTOPO30 *.DEM files, and extracted a contour line at 2000m altitude using gdal_contour. In the resulting shapefile, I have many small polygons in areas where the altitude is close to that contour line, and the image looks quite noisy.

How can I, preferably using gdal/ogr or QGis, somehow 'downsample' these contours, so that the picture looks cleaner? I basically want to eliminate all small features.

PS: One way would be to downsample the grid before doing the contour extraction; is this the way to go, or should i rather downsample the shapefile?

When you say "small polygons" I assume they are actually LINESTRING features that form closed boundaries? THese are probably the contours encircling peaks that are just above 2000 m.

A possible solution is to import the shapefile into GRASS, and use the module v.edit tool=delete where="len< (some threshold)
So the steps would be, after you have created a suitable GRASS Location and Mapset: