update db to shp function