LineIndex¶
-
class
LineIndex
(lines, reverse=False)¶ Wrapper to scipy.spatial.cKDTree to facilitate systematic processing of a line collection.
Implementation note: we use the available bool array because deleting stuff from the index is costly.
Methods
Initialize self.
- rtype
Check the N nearest lines, hopefully find one that is active.
Find nearest in specific index.
- rtype
- rtype
Find the closest line, assuming a maximum admissible distance.
- rtype
Optional
[ndarray
]
- rtype
ndarray
Attributes
list of weak references to the object (if defined)
Methods¶
-
LineIndex.
__getitem__
(item)¶
-
LineIndex.
__init__
(lines, reverse=False)¶ Initialize self. See help(type(self)) for accurate signature.
-
LineIndex.
_find_nearest_in_index
(p, index)¶ Check the N nearest lines, hopefully find one that is active.
-
LineIndex.
_find_nearest_within_in_index
(p, max_dist, index)¶ Find nearest in specific index. Return (reindex, idx, dist) tuple, where reindex indicates if a reindex is needed.
-
LineIndex.
find_nearest_within
(p, max_dist)¶ Find the closest line, assuming a maximum admissible distance. Returns a tuple of (idx, reverse), where idx may be None if nothing is found. reverse indicates whether or not a line ending has been matched instead of a start. False is always returned if index was created with reverse=False.s
-
LineIndex.
pop_front
()¶ - Return type
ndarray
Attributes¶
-
LineIndex.
__dict__
= mappingproxy({'__module__': 'vpype.line_index', '__doc__': 'Wrapper to scipy.spatial.cKDTree to facilitate systematic processing of a line\n collection.\n\n Implementation note: we use the `available` bool array because deleting stuff from the\n index is costly.\n ', '__init__': <function LineIndex.__init__>, '_make_index': <function LineIndex._make_index>, '_reindex': <function LineIndex._reindex>, '__len__': <function LineIndex.__len__>, '__getitem__': <function LineIndex.__getitem__>, 'pop_front': <function LineIndex.pop_front>, 'pop': <function LineIndex.pop>, 'find_nearest_within': <function LineIndex.find_nearest_within>, '_find_nearest_within_in_index': <function LineIndex._find_nearest_within_in_index>, 'find_nearest': <function LineIndex.find_nearest>, '_find_nearest_in_index': <function LineIndex._find_nearest_in_index>, '__dict__': <attribute '__dict__' of 'LineIndex' objects>, '__weakref__': <attribute '__weakref__' of 'LineIndex' objects>})¶
-
LineIndex.
__doc__
= 'Wrapper to scipy.spatial.cKDTree to facilitate systematic processing of a line\n collection.\n\n Implementation note: we use the `available` bool array because deleting stuff from the\n index is costly.\n '¶
-
LineIndex.
__module__
= 'vpype.line_index'¶
-
LineIndex.
__weakref__
¶ list of weak references to the object (if defined)