Creates an index with the spatial information. Seems to be finished for now