fix spatial indexing with multiple spatial dims