Web Content Display

Web Content Display (CoastWatch User Forum)

The NOAA CoastWatch Forum provides information in several categories.  The information is relevant to CoastWatch products and software (https://coastwatch.noaa.gov)  and vary in technical details.  For questions and issues not addressed here,  start a thread in the appropriate category or contact the CoastWatch HelpDesk (coastwatch.info@noaa.gov).  Please note our Privacy Policy (https://www.noaa.gov/privacy.html) and that this is a public forum.  All information is voluntarily and anonymous submissions are accepted pending review prior to posting. 

Forums

Back

Error using plotBBox

U
Anonymous, modified 3 Years ago.

Error using plotBBox

Hi, 

I am trying to extract SSTA data to my polygon coordinates using your tutorial script. It all seems to work fine until I try to plot in in plotBBox.

Error in UseMethod("st_as_sf") : 
  no applicable method for 'st_as_sf' applied to an object of class "NULL"
In addition: Warning messages:
1: In raster::projectRaster(r, crs = crs_string) :
  input and ouput crs are the same
2: In raster::rasterToPolygons(r) : no values in selection

 

Do you know what might be causing this error?

 

my input file is as follows (not I have not amended the file name from your chl example):

> str(sanctchl1)
List of 6
 $ sstAnomaly : num [1:16, 1:13] NA NA NA NA NA NA NA NA NA NA ...
 $ datasetname: chr "erdAGtanm8day"
 $ longitude  : num [1:16(1d)] -62.4 -62.3 -62.2 -62.1 -62 -61.9 -61.8 -61.7 -61.6 -61.5 ...
 $ latitude   : num [1:13(1d)] -52.5 -52.4 -52.3 -52.2 -52.1 -52 -51.9 -51.8 -51.7 -51.6 ...
 $ altitude   : num [1(1d)] 0
 $ time       : POSIXlt[1:1], format: "2016-04-17"
 - attr(*, "class")= chr [1:2] "list" "rxtracto3D"


plotBBox(sanctchl1, plotColor = 'algae',maxpixels=100000) 


Thanks for your assistance,

Amanda

MA
Melanie Abecassis, modified 3 Years ago.

RE: Error using plotBBox

Youngling Posts: 65 Join Date: 6/12/17 Recent Posts

Hi Amanda,

Can you post your whole script so I can try it out?

Thanks!

Melanie

U
Anonymous, modified 3 Years ago.

RE: Error using plotBBox

That error may mean that R is not seeing any data within the polygon coordinates. You could do a visual confirmation in ERDDAP to ensure there is data in that area at that time. If so, then there may be an issue with the coordinates that we could troubleshoot. The satellite data and the polygon both need to use either 0-360 lon or -180/180 lon. That is a common error that I see.  -Jenn