terra package producing weird warnings during extracts - warnings

I have been having a problem using the terra package. When I perform raster extracts on a polygon data set with weights=TRUE, I sometimes get many warning messages. From interpreting the warnings, it seems like perhaps terra is trying to write temporary files to perform this operation (?) and does not have write permissions. So I respecified the tempdir for the terra package to a folder I made that has read and write permissions, yet I still get these warnings.
Has anyone else received similar warnings from terra and know either how to solve the problem, or if these warnings are likely to be of any consequence (i.e. could they affect the reliability of the extract values)?
Thanks for reading.
In the below code bisondist is a raster layer, US.County is a sf object with polygons (10 is the column containing the geometries)
bison.mean.us <- terra::extract(bisondist,vect(US.County[,10]), fun=mean,na.rm=TRUE,weights=TRUE)
warnings()
Warning messages:
1: Attempt to create new tiff file `/spat_j1J6nrrhKYxy9MQ.tif' failed: Read-only file system (GDAL error 4)
2: Pointer 'hDS' is NULL in 'GDALGetRasterBand'.
(GDAL error 10)
3: Pointer 'hObject' is NULL in 'GDALSetDescription'.
(GDAL error 10)
4: Pointer 'hBand' is NULL in 'GDALSetRasterNoDataValue'.
(GDAL error 10)
5: Pointer 'hBand' is NULL in 'GDALFillRaster'.
(GDAL error 10)
6: Pointer 'hDS' is NULL in 'GDALSetGeoTransform'.
(GDAL error 10)
7: Pointer 'hDS' is NULL in 'GDALSetProjection'.
(GDAL error 10)
8: Pointer 'hDS' is NULL in 'GDALGetRasterBand'.
(GDAL error 10)
9: Pointer 'hBand' is NULL in 'GDALGetRasterDataType'.
(GDAL error 10)
10: Pointer 'hBand' is NULL in 'GDALGetRasterNoDataValue'.
(GDAL error 10)
11: Pointer 'hDS' is NULL in 'GDALRasterizeGeometries'.
(GDAL error 10)

This is not a coding question, rather a bug report, and these should be reported here. This was fixed in terra 1.4-13.

Related

Nonzero exit status : 216 (Pascal).. How can i fix this error?

I tried everything : to change the data type, to initialize the variables before using them, but nothing worked, what is the problem?
Program Criptmat;
type Matrice = array[1..20,1..20] of char;
var x : Matrice;
s,s1 : string;
i,j,n,k,l : integer;
f,f1 : text;
begin
assign(f,'criptmat.in');
reset(f);
readln(f,n);
readln(f,s);
close(f);
k:=1;
l:=length(s) div n;
for i:=1 to l do
if i mod 2 = 1 then
for j:=1 to n do
begin
x[i,j]:=s[k];
k:=k+1;
end else
if i mod 2 = 0 then
for j:=n downto 1 do
begin
x[i,j]:=s[k];
k:=k+1;
end;
s1:='';
for j:=1 to n do
for i:=1 to l do
s1:=s1+x[i,j];
assign(f1,'criptmat.out');
rewrite(f1);
writeln(f1,s1);
close(f1);
end.
Please, help me to fix this error to avoid this kind of mistake in the future, thank you!
Error 216 in fpc is an access violation or segment fault, depending on your preferred terminology. This happens when you try to access a memory address that is not valid. Typically that happens when you attempt to access an array outside of its bounds, or access dynamically allocated memory that has already been deallocated.
In your case it is likely that you are accessing the array out of bounds. Use the debugger to locate the point of failure, and inspect the value of your indices at that point of execution. This will tell you which access is invalid, and then you can set about fixing the logic errors that lead to the out of bounds access.
A useful tool to help such debugging is to enable the range checking compilation option. This will inject runtime code to validate every array access. You will find it much easier to debug these faults with that enabled.

Cython file write

I have a sample '.pyx' file
Here, certain mmap operation has been done (via C mmap) and the and 'data_len' has been returned
I want to read from the offset start upto the data_len area, AND dump it to a random file
I am doing this by the following: BUT, getting Syntax error while doing 'write' operation
cdef void *startmmaparea
def do_dump()
offset= <char *> startmmaparea
...
with open('abc.bin','wb') as fdes:
fdes.write(offset.read(data_len))
...
expected to write the mmap content to the file. but getting Syntax error in the 'write' op
Can I write the using the read() as I have done above ?
- Can anyone help me with what I am doing wrong here ?

pycaffe 'solver.step' fails to train using Adam

I am trying to train a model using pycaffe. I use Adam Optimizer
The forward and backward codes work fine:
solver.net.forward()
solver.net.backward()
However on the update step (solver.update()) it fails with the following error:
AttributeError: 'AdamSolver' object has no attribute 'update'
F1102 12:14:25.689537 24420 benchmark.cpp:18] Check failed: error == cudaSuccess (10 vs. 0) invalid device ordinal
When I try the solver.step(1) I gives me:
solver.step(1) failed to work with the following error:
F1101 19:28:43.213888 5038 benchmark.cpp:30] Check failed: error == cudaSuccess (71 vs. 0) operation not supported
*** Check failure stack trace: ***
Aborted (core dumped)
I suspect that there is an installation issue, actually I had few test cases that fails in my runtest, is that related and what I would need to fix if I need to rebuild?
EDIT 1:
I fixed all the issues I have in the runtest, but still having the same problem.
Placecaffe.set_mode_gpu() and caffe.set_device(0) before the caffe.get_solver(solver_path) solved the issue.

MailCore2 MCHTMLCleaner error

While using MailCore2, I started getting an error in MCHTMLCleaner.cc and method HTMLCleaner::cleanHTML. The specific line that is throwing the error is:
rc = tidySetErrorBuffer(tdoc, &errbuf);
and the error being printed is:
'Assertion failed: (option_defs[ optId ].type == TidyInteger), function SetOptionInt, file ../../src/config.c, line 381'
In config.c on line 381 is:
Bool status = ( optId < N_TIDY_OPTIONS );
Occasionally, this will crash the app, which seems contrary to the entire idea of a try/catch block that would make the most sense here.
More often than not, this code/file will not stop the app and instead just print out an error.
What is causing this to crash? Has anyone else experienced this? IS the HTML actually being cleaned or is nothing being returned for you?
Here is a link to the specific file in question on GitHub.

Error #2030: End of file was encountered?

I'm having this problem when i want to send using socket a message...
textField.addEventListener(KeyboardEvent.KEY_DOWN,enterHandler);
function enterHandler(event:KeyboardEvent):void{
if(event.keyCode == Keyboard.ENTER ){
socket.writeUTF(textField.text);
socket.flush();
trace(textField.text); //the output is what input text is, so the input field is right
}
}
The error is this :
Error: Error #2030: End of file was encountered.
at flash.utils::ByteArray/readUnsignedByte()
at socket_fla::MainTimeline/closeListener()
Any Idea?
Edit:
After checking the Java server (RedDwarf) that the client is connected to, it shows that the Message is received, then SEVERE: unknown opcode 0x61
Tried googling it, nothing..
this question may be caused when you haven't addEventListener(ProgressEvent.SOCKET_DATA, data) on the socket in the server. you must read data after you have already got it.