Skip to content

Collection of functions to speed up spatial point operations

Notifications You must be signed in to change notification settings

epifanio/numba_spatial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

numba_spatial

DOI

Compile with:

python3.6 nbspatial_src.py

Example:

import nbspatial
import numpy as np
lenpoly = 10000
polygon = np.array([[np.sin(x)+0.5,np.cos(x)+0.5] for x in np.linspace(0,2*np.pi,lenpoly)[:-1]])
N = 1000000
points = zip(np.random.random(N),np.random.random(N))
result = [nbspatial.ray_tracing(point[0], point[1], polygon) for point in points]
# result=get_spatial_selection_cpu=get_spatial_selection_cpu(points,polygon)