How to project sf object to extract cell data from raster using polygons in exact extractor R

Viewed 310

I need to extract raster cell data on a county basis.

dd <- exact_extract(tmax,counties,c('mean','max'))

I'm using the exact extractor package, which keeps giving me this warning:

Warning message:
In .exact_extract(x, y, fun = fun, ..., include_xy = include_xy,  :
Polygons transformed to raster CRS (EPSG:NA)

The county file I have has a CRS of "+proj=longlat +ellps=WGS84 +no_defs". I believe this is also known as EPSG 4326. I even transformed the county polygon file using the following code, and I still get this error.

new_sf_counties <- st_transform(sf_counties, crs = 4326)

Is this a warning I need to worry about? If so, how do I fix it? The county shapefile can be downloaded from https://www2.census.gov/geo/tiger/TIGER2019/COUNTY/. Thank you.

0 Answers
Related