I need to produce a shapefile from a raster. I need to be able to specify either an interval, or manually define the intervals. The input file is a GeoTIFF. I would like to use GDAL and/or Python.
Example raster:

I tried using gdal_contour, which at first glance would have been perfect. However, I want the result to have the same "pixel" definition - that is, the "contours" should maintain the block appearance of the pixels at their extents. For this reason, I can't use gdal_contour, as the results look like this:

Is there another way to do this? My output should be a shapefile that looks like a grid, with only pixels in the same interval connected to each other.
Anyway, the more important part: yes, I do want to directly polygonize the raster. It's not really an elevation, it represents a specific set of data that must go into the final system in this format. I'll take a look at your second link, looks like it might work. Thanks!
– Dan Jun 14 '15 at 23:52