function to create range-value polygons from a raster (level-contour polygons)