<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Spatial reference error with arc.write in R-ArcGIS Questions</title>
    <link>https://community.esri.com/t5/r-arcgis-questions/spatial-reference-error-with-arc-write/m-p/872505#M293</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am getting the following error from arc.write:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Error in .call_proxy("raster.create", .self, source, as.pairlist(args)) : &lt;BR /&gt; No spatial reference exists.&lt;/P&gt;&lt;P&gt;Full call in R:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;arc.write(file.path(pathGDB, rasterNameDefault), &lt;BR /&gt; rasterDefault, &lt;BR /&gt; overwrite = TRUE)&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;"rasterNameDefault" is a&amp;nbsp;character string. "pathGDB" is the full path to the local GDB. (It is a long path.)&amp;nbsp;"rasterDefault" is a raster layer created with the raster package (via dismo::predict).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I verified the raster has&amp;nbsp;a projection assigned.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;gt; rasterDefault&lt;BR /&gt;class : RasterLayer &lt;BR /&gt;dimensions : 240, 130, 31200 (nrow, ncol, ncell)&lt;BR /&gt;resolution : 845.2344, 845.2344 (x, y)&lt;BR /&gt;extent : 353440.7, 463321.2, 4010519, 4213375 (xmin, xmax, ymin, ymax)&lt;BR /&gt;coord. ref. : +proj=utm +zone=11 +datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0 &lt;BR /&gt;data source : in memory&lt;BR /&gt;names : layer &lt;BR /&gt;values : 9.893558e-11, 0.004525617 (min, max)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To be sure, I went back and added this code prior to the arc.write call and reran it. Still get the error on arc.write.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;crsProjection &amp;lt;- CRS("+proj=utm +zone=11 +datum=NAD83 +units=m +no_defs")&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;crs(rasterDefault) &amp;lt;- crsProjection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is doubly strange is that this is the same exact code pattern that I used in another part of the project about a month ago. It worked fine then and I was able to get rasters into ArcGIS Pro with no issues. Fast forward to today and the function does not work with a different set of rasters. I do not recall any updates to R or Pro during that time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Versions:&lt;/P&gt;&lt;P&gt;ArcGIS Pro 2.2.4&lt;/P&gt;&lt;P&gt;R-Bridge 1.0.1.232&lt;/P&gt;&lt;P&gt;Microsoft R 3.51&lt;/P&gt;&lt;P&gt;dismo 1.1-4&lt;/P&gt;&lt;P&gt;raster 1.8-4&lt;/P&gt;&lt;P&gt;sp 1.3-1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code does work and I can add the resulting rasters to ArcPro, but is not as clean as the arc.write in my workflow.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;writeRaster(rasterDefault, file.path(pathMaxEntOutputs, "rasterDefault.bil"), &lt;BR /&gt; format="EHdr", &lt;BR /&gt; overwrite=TRUE, &lt;BR /&gt; progress="text", &lt;BR /&gt; prj=TRUE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thoughts on where I am off here on arc.write?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 11 Jan 2019 00:33:11 GMT</pubDate>
    <dc:creator>CassKalinski</dc:creator>
    <dc:date>2019-01-11T00:33:11Z</dc:date>
    <item>
      <title>Spatial reference error with arc.write</title>
      <link>https://community.esri.com/t5/r-arcgis-questions/spatial-reference-error-with-arc-write/m-p/872505#M293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am getting the following error from arc.write:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;Error in .call_proxy("raster.create", .self, source, as.pairlist(args)) : &lt;BR /&gt; No spatial reference exists.&lt;/P&gt;&lt;P&gt;Full call in R:&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;arc.write(file.path(pathGDB, rasterNameDefault), &lt;BR /&gt; rasterDefault, &lt;BR /&gt; overwrite = TRUE)&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P&gt;"rasterNameDefault" is a&amp;nbsp;character string. "pathGDB" is the full path to the local GDB. (It is a long path.)&amp;nbsp;"rasterDefault" is a raster layer created with the raster package (via dismo::predict).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I verified the raster has&amp;nbsp;a projection assigned.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&amp;gt; rasterDefault&lt;BR /&gt;class : RasterLayer &lt;BR /&gt;dimensions : 240, 130, 31200 (nrow, ncol, ncell)&lt;BR /&gt;resolution : 845.2344, 845.2344 (x, y)&lt;BR /&gt;extent : 353440.7, 463321.2, 4010519, 4213375 (xmin, xmax, ymin, ymax)&lt;BR /&gt;coord. ref. : +proj=utm +zone=11 +datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0 &lt;BR /&gt;data source : in memory&lt;BR /&gt;names : layer &lt;BR /&gt;values : 9.893558e-11, 0.004525617 (min, max)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To be sure, I went back and added this code prior to the arc.write call and reran it. Still get the error on arc.write.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;crsProjection &amp;lt;- CRS("+proj=utm +zone=11 +datum=NAD83 +units=m +no_defs")&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;crs(rasterDefault) &amp;lt;- crsProjection&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is doubly strange is that this is the same exact code pattern that I used in another part of the project about a month ago. It worked fine then and I was able to get rasters into ArcGIS Pro with no issues. Fast forward to today and the function does not work with a different set of rasters. I do not recall any updates to R or Pro during that time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Versions:&lt;/P&gt;&lt;P&gt;ArcGIS Pro 2.2.4&lt;/P&gt;&lt;P&gt;R-Bridge 1.0.1.232&lt;/P&gt;&lt;P&gt;Microsoft R 3.51&lt;/P&gt;&lt;P&gt;dismo 1.1-4&lt;/P&gt;&lt;P&gt;raster 1.8-4&lt;/P&gt;&lt;P&gt;sp 1.3-1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code does work and I can add the resulting rasters to ArcPro, but is not as clean as the arc.write in my workflow.&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;writeRaster(rasterDefault, file.path(pathMaxEntOutputs, "rasterDefault.bil"), &lt;BR /&gt; format="EHdr", &lt;BR /&gt; overwrite=TRUE, &lt;BR /&gt; progress="text", &lt;BR /&gt; prj=TRUE)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thoughts on where I am off here on arc.write?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2019 00:33:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/r-arcgis-questions/spatial-reference-error-with-arc-write/m-p/872505#M293</guid>
      <dc:creator>CassKalinski</dc:creator>
      <dc:date>2019-01-11T00:33:11Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial reference error with arc.write</title>
      <link>https://community.esri.com/t5/r-arcgis-questions/spatial-reference-error-with-arc-write/m-p/872506#M294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Cass,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please try using arc.write with explicit references to raster properties?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have a raster you read in that has the same SR and extents and so forth. I will call that raster object template in the code snippet below&lt;/P&gt;&lt;P&gt;##################################### CODE SNIPPET #########################################&lt;/P&gt;&lt;P&gt;## Create a Blank Raster Conforming to a Pre-existing Raster&lt;/P&gt;&lt;P&gt;output_raster &amp;lt;- arc.raster(NULL, path = 'C:/output_path/Default.gdb/raster_name',&lt;BR /&gt; nrow = template$nrow,&lt;/P&gt;&lt;P&gt;ncol = template$ncol,&lt;/P&gt;&lt;P&gt;pixel_type = template$pixel_type,&lt;/P&gt;&lt;P&gt;nband = 1,&amp;nbsp; ##or how many bands you would like to write&lt;BR /&gt; sr = template$sr$WKID,&lt;/P&gt;&lt;P&gt;extent = template$extent)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;## Add&amp;nbsp;the Data to the Empty Raster&lt;BR /&gt;output_raster$write_pixel_block(raster_data, nrow = template$nrow, ncol = template$ncol)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;## Remove the R object for mid-step raster&lt;BR /&gt;rm(output_raster)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;#################################### END CODE SNIPPET ######################################&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Please let me know if that works or not. Also if you have a repro for me to work on, I would be happy to look at what is going wrong when&amp;nbsp;writing the raster in your analysis as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Orhun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2019 16:41:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/r-arcgis-questions/spatial-reference-error-with-arc-write/m-p/872506#M294</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-01-29T16:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial reference error with arc.write</title>
      <link>https://community.esri.com/t5/r-arcgis-questions/spatial-reference-error-with-arc-write/m-p/872507#M295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the reply Orhun. It may be late next week before I can test this. (Need to get a draft of my thesis to Dr Kemp! &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&amp;nbsp;) Used the work around I noted for now but do want to sort out the bridge problem.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Jan 2019 21:32:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/r-arcgis-questions/spatial-reference-error-with-arc-write/m-p/872507#M295</guid>
      <dc:creator>CassKalinski</dc:creator>
      <dc:date>2019-01-29T21:32:07Z</dc:date>
    </item>
  </channel>
</rss>

