write_quadtree_ptr {quadtree}R Documentation

Read/write a Quadtree

Description

This is for debugging only, and users should never need to use this function - use write_quadtree() instead. write_quadtree() serializes the CppQuadtree object (note that the underlying C++ object is actually called QuadtreeWrapper, but it is exposed to R as CppQuadtree) stored in the ptr slot of Quadtree.

This function, however, serializes only the Quadtree object contained by the QuadtreeWrapper.

Usage

## S4 method for signature 'character,Quadtree'
write_quadtree_ptr(x, y)

Arguments

x

character; the filepath to read from or write to

y

a Quadtree

Value

no return value

Examples

library(quadtree)
habitat <- terra::rast(system.file("extdata", "habitat.tif", package="quadtree"))

qt <- quadtree(habitat, .1)

path <- tempfile(fileext = "qtree")
write_quadtree_ptr(path, qt)

[Package quadtree version 0.1.14 Index]