I have a large number of rasters (ca. 6000) representing species distributions that I would need to vectorize, to then do some analyses on the vectors in GRASS GIS. I would need to calculate the distance of the polygons to a set of points. For each vector point I need to find the nearest polygon and save the distance (so I'd use v.distance). I can vectorize the rasters in GRASS GIS using GDAL (which I found faster) using gdal_polygonize, but then if I save the vectors, they occupy a lot of memory (more than 600GB). I thought about creating them as in-memory vectors (but I've never done it, I'm just reading about it), vectorize them, do the analyses I need "on the go", and save just the output. Is this a good way or is there a more efficient one?
EDIT: I added more details based on comments.