<div dir="ltr">Hi,<div><br></div><div>I am currently working on wrapping some code from a C++ library. I am using RCPP for this work. I have managed to get the wrapping code compiled but I get segfault when I try to use some of the functionality.</div><div><br></div><div>Here is an example of how I have gone about it, though I think I am quite sure I am missing something. Note, I have left out methods in the RCPP_MODULE wrappings. I am happy to share that if needed to get more information.</div><div><br></div><div>In the code below, <b>RasterBase</b> is an abstract class that derives from <b>PropertyMap.</b> I have used Romain Francis's suggestion (<a href="https://stackoverflow.com/questions/24317910/rcpp-module-for-inheritance-class?rq=3" target="_blank">https://stackoverflow.com/questions/24317910/rcpp-module-for-inheritance-class?rq=3</a>) on how to work with derived class and Ralf Stubner's suggestion (<a href="https://stackoverflow.com/questions/54469409/how-to-expose-a-pointer-of-an-abstract-class-using-rcpp" target="_blank">https://stackoverflow.com/questions/54469409/how-to-expose-a-pointer-of-an-abstract-class-using-rcpp</a>) on how to work with an abstract class and got most stuff working.<br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><span style="color:rgb(37,37,37);font-family:sans-serif;font-size:14px;line-height:22.4px"><br></span></div><div><span style="line-height:22.4px"><div style="line-height:19px"><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)"><span style="color:rgb(86,156,214)">typedef</span> <span style="color:rgb(200,200,200)">std</span><span style="color:rgb(180,180,180)">::</span><span style="color:rgb(78,201,176)">reference_wrapper</span><span style="color:rgb(180,180,180)"><</span><span style="color:rgb(78,201,176)">RasterBaseFloat</span><span style="color:rgb(180,180,180)">></span> <span style="color:rgb(78,201,176)">RasterBaseRef</span><span style="color:rgb(180,180,180)">;</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)"><span style="color:rgb(86,156,214)">typedef</span> <span style="color:rgb(200,200,200)">std</span><span style="color:rgb(180,180,180)">::</span><span style="color:rgb(78,201,176)">vector</span><span style="color:rgb(180,180,180)"><</span><span style="color:rgb(78,201,176)">RasterBaseRef</span><span style="color:rgb(180,180,180)">></span> <span style="color:rgb(78,201,176)">RasterBaseRefs</span><span style="color:rgb(180,180,180)">;</span></div><br><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)"><span style="color:rgb(78,201,176)">RasterBaseFloat</span> <span style="color:rgb(180,180,180)">*</span><span style="color:rgb(220,220,170)">newRasterBase</span><span style="color:rgb(180,180,180)">()</span> <span style="color:rgb(180,180,180)">{</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    <span style="color:rgb(216,160,223)">return</span> <span style="color:rgb(86,156,214)">new</span> <span style="color:rgb(78,201,176)">RasterFloat</span><span style="color:rgb(180,180,180)">();</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)"><span style="color:rgb(180,180,180)">}</span></div><br><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)"><span style="color:rgb(86,156,214)">void</span> <span style="color:rgb(220,220,170)">sortColumns</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(78,201,176)">RasterFloat</span><span style="color:rgb(180,180,180)">&</span> <span style="color:rgb(154,154,154)">r</span><span style="color:rgb(180,180,180)">)</span> <span style="color:rgb(180,180,180)">{</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    <span style="color:rgb(200,200,200)">Geostack</span><span style="color:rgb(180,180,180)">::</span><span style="color:rgb(220,220,170)">sortColumns</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(154,154,154)">r</span><span style="color:rgb(180,180,180)">);</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)"><span style="color:rgb(180,180,180)">}</span></div><br><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)"><span style="color:rgb(78,201,176)">RasterBaseFloat</span><span style="color:rgb(180,180,180)">&</span> <span style="color:rgb(220,220,170)">get_raster_ref_from_vec</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(78,201,176)">RasterBaseRefs</span> <span style="color:rgb(180,180,180)">&</span><span style="color:rgb(154,154,154)">v</span><span style="color:rgb(180,180,180)">,</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">                                         <span style="color:rgb(200,200,200)">std</span><span style="color:rgb(180,180,180)">::</span><span style="color:rgb(78,201,176)">size_t</span> <span style="color:rgb(154,154,154)">i</span><span style="color:rgb(180,180,180)">)</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)"><span style="color:rgb(180,180,180)">{</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    <span style="color:rgb(216,160,223)">return</span> <span style="color:rgb(154,154,154)">v</span><span style="color:rgb(180,180,180)">[</span><span style="color:rgb(154,154,154)">i</span><span style="color:rgb(180,180,180)">]</span><span style="color:rgb(180,180,180)">.</span><span style="color:rgb(220,220,170)">get</span><span style="color:rgb(180,180,180)">();</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)"><span style="color:rgb(180,180,180)">}</span></div><br><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)"><span style="color:rgb(86,156,214)">void</span> <span style="color:rgb(220,220,170)">add_ref_to_vec</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(78,201,176)">RasterBaseRefs</span> <span style="color:rgb(180,180,180)">&</span><span style="color:rgb(154,154,154)">v</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(78,201,176)">RasterBaseFloat</span> <span style="color:rgb(180,180,180)">&</span><span style="color:rgb(154,154,154)">rf</span><span style="color:rgb(180,180,180)">)</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)"><span style="color:rgb(180,180,180)">{</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    <span style="color:rgb(154,154,154)">v</span><span style="color:rgb(180,180,180)">.</span><span style="color:rgb(220,220,170)">emplace_back</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(200,200,200)">std</span><span style="color:rgb(180,180,180)">::</span><span style="color:rgb(220,220,170)">ref</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(154,154,154)">rf</span><span style="color:rgb(180,180,180)">));</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)"><span style="color:rgb(180,180,180)">}</span></div><br><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)"><span style="color:rgb(86,156,214)">void</span> <span style="color:rgb(220,220,170)">runScriptNoOut</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(200,200,200)">std</span><span style="color:rgb(180,180,180)">::</span><span style="color:rgb(78,201,176)">string</span> <span style="color:rgb(154,154,154)">script</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(78,201,176)">SEXP</span> <span style="color:rgb(154,154,154)">r_list</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(200,200,200)">std</span><span style="color:rgb(180,180,180)">::</span><span style="color:rgb(78,201,176)">size_t</span> <span style="color:rgb(154,154,154)">param</span><span style="color:rgb(180,180,180)">)</span> <span style="color:rgb(180,180,180)">{</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    <span style="color:rgb(200,200,200)">Rcpp</span><span style="color:rgb(180,180,180)">::</span><span style="color:rgb(78,201,176)">List</span> <span style="color:rgb(156,220,254)">raster_base_list</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(154,154,154)">r_list</span><span style="color:rgb(180,180,180)">);</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    <span style="color:rgb(86,156,214)">int</span> <span style="color:rgb(156,220,254)">n</span> <span style="color:rgb(180,180,180)">=</span> <span style="color:rgb(156,220,254)">raster_base_list</span><span style="color:rgb(180,180,180)">.</span><span style="color:rgb(220,220,170)">size</span><span style="color:rgb(180,180,180)">();</span></div><br><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    <span style="color:rgb(78,201,176)">RasterBaseRefs</span> <span style="color:rgb(156,220,254)">raster_list</span><span style="color:rgb(180,180,180)">;</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    <span style="color:rgb(156,220,254)">raster_list</span><span style="color:rgb(180,180,180)">.</span><span style="color:rgb(220,220,170)">reserve</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(156,220,254)">n</span><span style="color:rgb(180,180,180)">);</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    <span style="color:rgb(200,200,200)">Rcpp</span><span style="color:rgb(180,180,180)">::</span><span style="color:rgb(200,200,200)">Rcout</span> <span style="color:rgb(180,180,180)"><<</span> <span style="color:rgb(156,220,254)">raster_list</span><span style="color:rgb(180,180,180)">.</span><span style="color:rgb(220,220,170)">size</span><span style="color:rgb(180,180,180)">()</span> <span style="color:rgb(180,180,180)"><<</span> <span style="color:rgb(200,200,200)">std</span><span style="color:rgb(180,180,180)">::</span><span style="color:rgb(220,220,170)">endl</span><span style="color:rgb(180,180,180)">;</span></div><br><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    <span style="color:rgb(216,160,223)">for</span> <span style="color:rgb(180,180,180)">(</span><span style="color:rgb(86,156,214)">int</span> <span style="color:rgb(156,220,254)">i</span> <span style="color:rgb(180,180,180)">=</span> <span style="color:rgb(181,206,168)">0</span><span style="color:rgb(180,180,180)">;</span> <span style="color:rgb(156,220,254)">i</span> <span style="color:rgb(180,180,180)"><</span> <span style="color:rgb(156,220,254)">n</span><span style="color:rgb(180,180,180)">;</span> <span style="color:rgb(156,220,254)">i</span><span style="color:rgb(180,180,180)">++)</span> <span style="color:rgb(180,180,180)">{</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">        <span style="color:rgb(78,201,176)">RasterFloat</span> <span style="color:rgb(156,220,254)">r</span> <span style="color:rgb(180,180,180)">=</span> <span style="color:rgb(156,220,254)">raster_base_list</span><span style="color:rgb(180,180,180)">[</span><span style="color:rgb(156,220,254)">i</span><span style="color:rgb(180,180,180)">]</span><span style="color:rgb(180,180,180)">;</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">        <span style="color:rgb(220,220,170)">add_ref_to_vec</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(156,220,254)">raster_list</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(156,220,254)">r</span><span style="color:rgb(180,180,180)">);</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    <span style="color:rgb(180,180,180)">}</span></div><br><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    <span style="color:rgb(200,200,200)">Rcpp</span><span style="color:rgb(180,180,180)">::</span><span style="color:rgb(200,200,200)">Rcout</span> <span style="color:rgb(180,180,180)"><<</span> <span style="color:rgb(156,220,254)">raster_list</span><span style="color:rgb(180,180,180)">.</span><span style="color:rgb(220,220,170)">size</span><span style="color:rgb(180,180,180)">()</span> <span style="color:rgb(180,180,180)"><<</span> <span style="color:rgb(200,200,200)">std</span><span style="color:rgb(180,180,180)">::</span><span style="color:rgb(220,220,170)">endl</span><span style="color:rgb(180,180,180)">;</span></div><br><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    <span style="color:rgb(200,200,200)">Geostack</span><span style="color:rgb(180,180,180)">::</span><span style="color:rgb(220,220,170)">runScriptNoOut</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(154,154,154)">script</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(156,220,254)">raster_list</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(154,154,154)">param</span><span style="color:rgb(180,180,180)">);</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)"><span style="color:rgb(180,180,180)">}</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)"><br></div><div style=""><div style="line-height:19px"><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)"><span style="color:rgb(190,183,255)">RCPP_MODULE</span><span style="color:rgb(180,180,180)">(</span>GS_Raster<span style="color:rgb(180,180,180)">)</span> <span style="color:rgb(180,180,180)">{</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    <span style="color:rgb(78,201,176)">class_</span><span style="color:rgb(180,180,180)"><</span><span style="color:rgb(78,201,176)">PropertyMap</span><span style="color:rgb(180,180,180)">>(</span><span style="color:rgb(232,201,187)">"</span><span style="color:rgb(206,145,120)">PropertyMap</span><span style="color:rgb(232,201,187)">"</span><span style="color:rgb(180,180,180)">)</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    .<span style="color:rgb(220,220,170)">constructor</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(232,201,187)">"</span><span style="color:rgb(206,145,120)">Instantiate property map object</span><span style="color:rgb(232,201,187)">"</span><span style="color:rgb(180,180,180)">)</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)"><span style="color:rgb(180,180,180)"><br></span></div><div style=""><div style="line-height:19px"><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    <span style="color:rgb(78,201,176)">class_</span><span style="color:rgb(180,180,180)"><</span><span style="color:rgb(78,201,176)">RasterBaseFloat</span><span style="color:rgb(180,180,180)">>(</span><span style="color:rgb(232,201,187)">"</span><span style="color:rgb(206,145,120)">RasterBase</span><span style="color:rgb(232,201,187)">"</span><span style="color:rgb(180,180,180)">)</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    .<span style="color:rgb(220,220,170)">derives</span><span style="color:rgb(180,180,180)"><</span><span style="color:rgb(78,201,176)">PropertyMap</span><span style="color:rgb(180,180,180)">>(</span><span style="color:rgb(232,201,187)">"</span><span style="color:rgb(206,145,120)">PropertyMap</span><span style="color:rgb(232,201,187)">"</span><span style="color:rgb(180,180,180)">)</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    .<span style="color:rgb(220,220,170)">factory</span><span style="color:rgb(180,180,180)">(&</span><span style="color:rgb(220,220,170)">newRasterBase</span><span style="color:rgb(180,180,180)">)</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)"><span style="color:rgb(180,180,180)"><br></span></div><div style=""><div style="line-height:19px"><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    <span style="color:rgb(78,201,176)">class_</span><span style="color:rgb(180,180,180)"><</span><span style="color:rgb(78,201,176)">RasterFloat</span><span style="color:rgb(180,180,180)">>(</span><span style="color:rgb(232,201,187)">"</span><span style="color:rgb(206,145,120)">Raster</span><span style="color:rgb(232,201,187)">"</span><span style="color:rgb(180,180,180)">)</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre-wrap;background-color:rgb(30,30,30)">    .<span style="color:rgb(220,220,170)">derives</span><span style="color:rgb(180,180,180)"><</span><span style="color:rgb(78,201,176)">RasterBaseFloat</span><span style="color:rgb(180,180,180)">>(</span><span style="color:rgb(232,201,187)">"</span><span style="color:rgb(206,145,120)">RasterBase</span><span style="color:rgb(232,201,187)">"</span><span style="color:rgb(180,180,180)">)</span></div><div style=""><br></div><div style="">Here is how I have tested the wrappings in R.</div><div style=""><br><span style="color:rgb(220,220,170);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)">library</span><span style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)">(</span><span style="color:rgb(156,220,254);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)">devtools</span><span style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)">)</span><br></div><div style=""><div style="line-height:19px"><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(220,220,170)">setwd</span>(<span style="color:rgb(232,201,187)">"</span><span style="color:rgb(206,145,120)">/home/gar305/Documents/geostack/r_binding/RcppGeostack</span><span style="color:rgb(232,201,187)">"</span>)</div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)">devtools<span style="color:rgb(86,156,214)">::</span><span style="color:rgb(156,220,254)">load_all</span><span style="color:rgb(180,180,180)">()</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(220,220,170)">library</span>(<span style="color:rgb(156,220,254)">Rcpp</span>)</div><br><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(156,220,254)">testA</span> <span style="color:rgb(180,180,180)"><-</span> <span style="color:rgb(220,220,170)">new</span>(<span style="color:rgb(156,220,254)">Raster</span>, <span style="color:rgb(232,201,187)">"</span><span style="color:rgb(206,145,120)">testRaster</span><span style="color:rgb(232,201,187)">"</span>)</div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(156,220,254)">testA</span><span style="color:rgb(86,156,214)">$</span><span style="color:rgb(156,220,254)">init</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(181,206,168)">256</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(181,206,168)">256</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(181,206,168)">4</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(181,206,168)">0.0</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(181,206,168)">0.0</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(181,206,168)">0.0</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(181,206,168)">1.0</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(181,206,168)">1.0</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(181,206,168)">1.0</span><span style="color:rgb(180,180,180)">)</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(156,220,254)">testA</span><span style="color:rgb(86,156,214)">$</span><span style="color:rgb(156,220,254)">setAllCellValues</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(181,206,168)">0.0</span><span style="color:rgb(180,180,180)">)</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(156,220,254)">testA</span><span style="color:rgb(86,156,214)">$</span><span style="color:rgb(156,220,254)">getCellValue</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(181,206,168)">10</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(181,206,168)">10</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(181,206,168)">0</span><span style="color:rgb(180,180,180)">)</span></div><br><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(156,220,254)">dims</span> <span style="color:rgb(180,180,180)"><-</span> <span style="color:rgb(156,220,254)">testA</span><span style="color:rgb(86,156,214)">$</span><span style="color:rgb(156,220,254)">getRasterDimensions</span><span style="color:rgb(180,180,180)">()</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(156,220,254)">dims</span></div><br><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(156,220,254)">projParams</span> <span style="color:rgb(180,180,180)"><-</span> <span style="color:rgb(156,220,254)">fromEPSG</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(232,201,187)">"</span><span style="color:rgb(206,145,120)">4326</span><span style="color:rgb(232,201,187)">"</span><span style="color:rgb(180,180,180)">)</span></div><br><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(156,220,254)">testA</span><span style="color:rgb(86,156,214)">$</span><span style="color:rgb(156,220,254)">setProjectionParameters</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(156,220,254)">projParams</span><span style="color:rgb(180,180,180)">)</span></div><br><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(156,220,254)">proj2</span> <span style="color:rgb(180,180,180)"><-</span> <span style="color:rgb(156,220,254)">testA</span><span style="color:rgb(86,156,214)">$</span><span style="color:rgb(156,220,254)">getProjectionParameters</span><span style="color:rgb(180,180,180)">()</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(156,220,254)">proj2</span></div><br><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(156,220,254)">testA</span><span style="color:rgb(86,156,214)">$</span><span style="color:rgb(156,220,254)">getProperty_String</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(232,201,187)">"</span><span style="color:rgb(206,145,120)">name</span><span style="color:rgb(232,201,187)">"</span><span style="color:rgb(180,180,180)">)</span></div><br><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(156,220,254)">r_list</span> <span style="color:rgb(180,180,180)"><-</span> <span style="color:rgb(86,156,214)">list</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(156,220,254)">testA</span><span style="color:rgb(180,180,180)">)</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(156,220,254)">runScriptNoOut</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(232,201,187)">"</span><span style="color:rgb(206,145,120)">testRaster = randomNormal(0, 1);</span><span style="color:rgb(232,201,187)">"</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(156,220,254)">r_list</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(181,206,168)">0</span><span style="color:rgb(180,180,180)">)</span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(156,220,254)">testA</span><span style="color:rgb(86,156,214)">$</span><span style="color:rgb(156,220,254)">getCellValue</span><span style="color:rgb(180,180,180)">(</span><span style="color:rgb(181,206,168)">10</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(181,206,168)">10</span><span style="color:rgb(180,180,180)">,</span> <span style="color:rgb(181,206,168)">0</span><span style="color:rgb(180,180,180)">)<br></span></div><div style="color:rgb(218,218,218);font-family:"Droid Sans Mono","monospace",monospace;font-size:14px;white-space:pre;background-color:rgb(30,30,30)"><span style="color:rgb(180,180,180)"><br></span></div><br>and here is what I get when I run the above R code</div><div style="line-height:19px"><br></div><div style="line-height:19px"><img src="cid:ii_lt9sasmd0" alt="image.png" width="542" height="151"><br></div><div style="line-height:19px"><br></div><div style="line-height:19px">Any help or suggestions on ways to rectify this issue would be great.</div><div style="line-height:19px"><br></div><div style="line-height:19px">Regards,</div><div style="line-height:19px">Nikhil</div></div></div></div></div></div></div></div></div></span></div></div></div></div></div></div></div></div></div></div>