(draw_polygon_shape) (point_in_polygon_shape, shape_centroid): Raise an exception if the shape can't be read. Previously invalid shape ids would lead to a segfault.