MCPcopy Create free account
hub / github.com/PDAL/PDAL / localReady

Method localReady

plugins/tiledb/io/TileDBReader.cpp:267–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267void TileDBReader::localReady()
268{
269
270 m_query.reset(new tiledb::Query(*m_ctx, *m_array));
271 m_query->set_layout(TILEDB_UNORDERED);
272
273 for (auto& buffer : m_dims)
274 {
275 buffer->resizeBuffer(m_args->m_chunkSize);
276 buffer->setQueryBuffer(*m_query.get());
277 }
278
279 // Set the subarray to query. The default for each dimension is to query
280 // the entire dimension domain unless a range is explicitly set on it.
281 tiledb::Subarray subarray(*m_ctx, *m_array);
282 const auto ndim_bbox = m_args->m_bbox.ndim();
283 const auto domain = m_array->schema().domain();
284 switch (m_args->m_bbox.ndim())
285 {
286 case 4:
287 if (domain.has_dimension("GpsTime"))
288 subarray.add_range("GpsTime", m_args->m_bbox.minGpsTime(),
289 m_args->m_bbox.maxGpsTime());
290 [[fallthrough]];
291 case 3:
292 if (domain.has_dimension("Z"))
293 subarray.add_range("Z", m_args->m_bbox.minZ(),
294 m_args->m_bbox.maxZ());
295 [[fallthrough]];
296 case 2:
297 if (domain.has_dimension("Y"))
298 subarray.add_range("Y", m_args->m_bbox.minY(),
299 m_args->m_bbox.maxY());
300 [[fallthrough]];
301 case 1:
302 if (domain.has_dimension("X"))
303 subarray.add_range("X", m_args->m_bbox.minX(),
304 m_args->m_bbox.maxX());
305 }
306 m_query->set_subarray(subarray);
307
308 // read spatial reference
309 NL::json meta = nullptr;
310
311 tiledb_datatype_t v_type = TILEDB_UINT8;
312 const void* v_r;
313 uint32_t v_num;
314 m_array->get_metadata("_pdal", &v_type, &v_num, &v_r);
315
316 if (v_r != NULL)
317 meta = NL::json::parse(static_cast<const char*>(v_r));
318
319 if ((meta != nullptr) && (meta.count("root") > 0) &&
320 (meta["root"].count("writers.tiledb") > 0) &&
321 (meta["root"]["writers.tiledb"].count("spatialreference") > 0))
322 {
323 SpatialReference ref(
324 meta["root"]["writers.tiledb"]["spatialreference"]);

Callers

nothing calls this directly

Calls 15

ndimMethod · 0.80
minGpsTimeMethod · 0.80
maxGpsTimeMethod · 0.80
parseFunction · 0.50
setSpatialReferenceFunction · 0.50
resetMethod · 0.45
resizeBufferMethod · 0.45
setQueryBufferMethod · 0.45
getMethod · 0.45
minZMethod · 0.45
maxZMethod · 0.45
minYMethod · 0.45

Tested by

no test coverage detected