move creation of the spatial index to select feature