| 136 | |
| 137 | |
| 138 | CountPointsInPolygon::CountPointsInPolygon(BackgroundMapLayer* _ml, |
| 139 | Project* _project, |
| 140 | std::vector<wxString> join_variable_nm, |
| 141 | std::vector<Operation> _op) |
| 142 | : SpatialJoinWorker(_ml, _project) |
| 143 | { |
| 144 | is_spatial_assign = false; |
| 145 | join_operation = _op; |
| 146 | int n_vars = (int)join_operation.size(); |
| 147 | join_values.resize(n_vars); |
| 148 | join_variable = false; // default false: no need to join variables |
| 149 | for (int i=0; i<join_variable_nm.size(); ++i) { |
| 150 | join_variable = _ml->GetDoubleColumnData(join_variable_nm[i], join_values[i]); |
| 151 | } |
| 152 | |
| 153 | num_polygons = project->GetNumRecords(); |
| 154 | |
| 155 | // using selected layer (points) to create rtree |
| 156 | int n = (int)ml->shapes.size(); |
| 157 | double x, y; |
| 158 | for (int i=0; i<n; i++) { |
| 159 | if (ml->shapes[i]) { |
| 160 | x = ml->shapes[i]->center_o.x; |
| 161 | y = ml->shapes[i]->center_o.y; |
| 162 | rtree.insert(std::make_pair(pt_2d(x,y), i)); |
| 163 | } |
| 164 | } |
| 165 | } |
| 166 | |
| 167 | void CountPointsInPolygon::sub_run(int start, int end) |
| 168 | { |
nothing calls this directly
no test coverage detected