How to use the rtree.index.Rtree function in Rtree

To help you get started, we’ve selected a few Rtree examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github rustychris / stompy / stompy / spatial / gen_spatial_index.py View on Github external
def point_index_class_factory(implementation='best'):
    if implementation in ['rtree','best']:
        try:
            from rtree.index import Rtree 

            # try to mimic the Rtree interface - starting by just using it...
            return Rtree
        except ImportError:
            if implementation=='rtree':
                raise
            # otherwise fall through to next best

    if implementation in ['qgis','best']:
        try:
            from . import qgis_spatialindex
            return qgis_spatialindex.RtreeQgis
        except ImportError:
            if implementation=='qgis':
                raise
            # otherwise fall through to next

    if implementation in ['kdtree','best']:
        try:
github NCPP / ocgis / src / ocgis / spatial / index.py View on Github external
def __init__(self, path=None):
        if path is None:
            self._index = index.Index()
        else:
            self._index = index.Rtree(path)