Fix problem with gdal 1.9 by adding sr from layer.