namespace geospatial¶
// namespaces namespace xf::data_analytics::geospatial::internal
knn¶
#include "xf_data_analytics/geospatial/knn.hpp"
template < int CSV_PU_NUM = 2, int MAX_SORT_NUM = 8 > void knn ( ap_uint <128>* csv_buf, ap_uint <8>* schema, float base_x, float base_y, int k, float* sorted_dist_buf, uint32_t* sorted_idx_buf )
K Nearest Neighbors(KNN): find nearest-K points for a given base point.
Parameters:
| CSV_PU_NUM | num of csv parser core used to parallel parse csv data, only support 2/4/8 | 
| MAX_SORT_NUM | the max number of the sequence can be sorted, should be less than 1024 | 
| csv_buf | input csv data | 
| schema | input csv schema | 
| base_x | base point x coordinate | 
| base_y | base point y coordinate | 
| k | num of nearest point, k <= MAX_SORT_NUM | 
| sorted_dist_buf | output distance of nearest-K points | 
| sorted_idx_buf | output index of nearest-K points | 
strtreeTop¶
#include "xf_data_analytics/geospatial/strtree_wrap.hpp"
template < typename KT, typename VT, typename PT, typename NT, int NC, int ISN, int BSN, int MTCN, int MSN > void strtreeTop ( int sz, double* inX, double* inY, double* inZone, PT* extPointBuf0, PT* extPointBuf1, NT* extNodeBuf0, NT* extNodeBuf1, NT* extNodeBuf2 )
strtreeTop strtree (a geospatial index) uses bottom-up way to build an R tree for two-dimensional points
Parameters:
| KT | key type | 
| VT | value type | 
| PT | point type | 
| NT | node type | 
| NC | node capacity | 
| ISN | insert sort length | 
| BSN | block sort length | 
| MTCN | merge tree channel number | 
| NSN | max sort length | 
| sz | real size of inX or inY | 
| inX | all x value | 
| inX | all y value | 
| inZone | points (x, y) limit zone | 
| extPointBuf0 | output ordered points | 
| extPointBuf1 | points buffer | 
| extNodeBuf0 | output ordered nodes | 
| extNodeBuf1 | nodes buffer | 
| extNodeBuf2 | nodes buffer |