def _index_n_query(geoms1, geoms2):
    if (geoms1.shape[0] > geoms2.shape[0]):
        large = geoms1
        small = geoms2
    else:
        large = geoms2
        small = geoms1
    (qry_polyIDs, tree_polyIDs) = large.sindex.query_bulk(small, predicate='intersects')
    large_global_ids = large.iloc[tree_polyIDs].index.values
    small_global_ids = small.iloc[qry_polyIDs].index.values
    if (geoms1.shape[0] > geoms2.shape[0]):
        return np.array([large_global_ids, small_global_ids]).T
    else:
        return np.array([small_global_ids, large_global_ids]).T
def _index_n_query(geoms1, geoms2):
    if (geoms1.shape[0] > geoms2.shape[0]):
        large = geoms1
        small = geoms2
    else:
        large = geoms2
        small = geoms1
    (qry_polyIDs, tree_polyIDs) = large.sindex.query_bulk(small, predicate='intersects')
    large_global_ids = large.iloc[tree_polyIDs].index.values
    small_global_ids = small.iloc[qry_polyIDs].index.values
    if (geoms1.shape[0] > geoms2.shape[0]):
        return np.array([large_global_ids, small_global_ids]).T
    else:
        return np.array([small_global_ids, large_global_ids]).T