I downloaded the soilAtlas2M zip file, uploaded the .shp to arcgis, created a raster and clipped to my area of interest and made the map to show each soil type(map unit) to be a different colour, created a tiff and then asc file in ArcGIS Pro. When I read the asc into R the plot looks fine, but the extent is not in the format I need. (Data comes from: https://www.asris.csiro.au/themes/Atlas.html)
The asc extent/crs is in the wrong format - how can this be set in arcgis prior to exporting the asc? I have tried to fix the issue in r
I rastered the tif in r.
> s4<- raster("s4.tif")
> s4
class : RasterLayer
band : 1 (of 4 bands)
dimensions : 299, 251, 75049 (nrow, ncol, ncell)
resolution : 5300, 5300 (x, y)
extent : 14365436, 15695736, -4588206, -3003506 (xmin, xmax, ymin, ymax)
crs : +proj=merc +a=6378137 +b=6378137 +lat_ts=0 +lon_0=0 +x_0=0 +y_0=0 +k=1 +units=m +nadgrids=@null +wktext +no_defs
source : s4.tif
names : s4
values : 0, 252 (min, max)
The set the crs:
> s4crs<- projectRaster(s4, crs='+proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs')
> s4crs
class : RasterLayer
dimensions : 310, 261, 80910 (nrow, ncol, ncell)
resolution : 0.0476, 0.0403 (x, y)
extent : 128.8089, 141.2325, -38.28692, -25.79392 (xmin, xmax, ymin, ymax)
crs : +proj=longlat +ellps=GRS80 +no_defs
source : memory
names : s4
values : 0, 255.617 (min, max)
Which affects the resolution. I can set the resolution manually to create another asc file, but lose much quality.
When I read the asc file into r:
s5<- read.asciigrid("~/s5.asc", as.image = FALSE, plot.image = TRUE)
It reads and displays:
Coordinate Reference System (CRS) arguments: NA
> s5rst<- raster(s5)
> s5rst
class : RasterLayer
dimensions : 299, 251, 75049 (nrow, ncol, ncell)
resolution : 5300, 5300 (x, y)
extent : 14365436, 15695736, -4588206, -3003506 (xmin, xmax, ymin, ymax)
crs : NA
source : memory
names : s5.asc
values : 0, 252 (min, max)
The extent of the asc when I make it into a raster:
14365436, 15695736, -4588206, -3003506 (xmin, xmax, ymin, ymax)
The extent I need:
129.0018, 141.0028, -38.06215, -25.99639 (xmin, xmax, ymin, ymax)
Is there a way to define the extent/convert to longitude and latitude in ArcGIS Pro prior to exporting it, or a way to fix the issue in R? I believe ArcGIS has the coordinate system set to WGS_1984_Web_Mercator_auxillary_sphere. I ultimately need an asc file
s4.tif
or the file itself in order to make your example reproducible?