| 190 | |
| 191 | |
| 192 | bool HexBin::createGrid() |
| 193 | { |
| 194 | try |
| 195 | { |
| 196 | if (m_grid->sampling()) |
| 197 | { |
| 198 | // If we ran out of points while sampling, process the points in the sample buffer: |
| 199 | // in stream mode, we can't check this until we've gone through all the points |
| 200 | if (m_sampleSize > m_count) |
| 201 | { |
| 202 | m_grid->flushSamples(); |
| 203 | // Setting this so it gets written to metadata correctly |
| 204 | m_sampleSize = m_count; |
| 205 | } |
| 206 | else |
| 207 | throwError("Sampling for hexbin auto-edge length calculation failed!"); |
| 208 | } |
| 209 | |
| 210 | m_grid->findShapes(); |
| 211 | m_grid->findParentPaths(); |
| 212 | } |
| 213 | catch (hexer::hexer_error& e) |
| 214 | { |
| 215 | m_metadata.add("error", e.what(), |
| 216 | "Hexer threw an error and was unable to compute a boundary"); |
| 217 | m_metadata.add("boundary", "MULTIPOLYGON EMPTY", |
| 218 | "Empty polygon -- unable to compute boundary"); |
| 219 | return false; |
| 220 | } |
| 221 | return true; |
| 222 | } |
| 223 | |
| 224 | void HexBin::done(PointTableRef table) |
| 225 | { |
nothing calls this directly
no test coverage detected