<?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 for Geoprocessing Task in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-for-geoprocessing-task/m-p/309680#M28479</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the JS 4.0 API and am trying to get the return result from an asynchronous service, but I keep getting the error:&lt;/P&gt;&lt;P class="subLogRow errorTitle focusRow"&gt;&lt;EM&gt;&lt;SPAN class="errorMessage"&gt;TypeError: d.spatialReference is undefined&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;on the result.&lt;/P&gt;&lt;P&gt;When I created the GP task I set the output spatial reference to that of the base map ...&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;gp = new Geoprocessor(testURL);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; gp.outSpatialReference = {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; wkid: 102100&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; };&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;However, when I try to get the result image, I get the error stating that spatialReference is undefined.&amp;nbsp; I am getting the result as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;var resultImage = gp.getResultImageLayer(result.jobId, "myImage", imageParams);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Is there any way to force or set the spatialReference on the return result image?&amp;nbsp; Maybe in the "imageParams"?&amp;nbsp; But the docs on imageParameters don't really seem to say that I can set the spatialReference.&amp;nbsp; Is it possible?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Charlie&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 14 Jun 2016 16:20:47 GMT</pubDate>
    <dc:creator>DougCollins</dc:creator>
    <dc:date>2016-06-14T16:20:47Z</dc:date>
    <item>
      <title>Spatial reference for Geoprocessing Task</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-for-geoprocessing-task/m-p/309680#M28479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using the JS 4.0 API and am trying to get the return result from an asynchronous service, but I keep getting the error:&lt;/P&gt;&lt;P class="subLogRow errorTitle focusRow"&gt;&lt;EM&gt;&lt;SPAN class="errorMessage"&gt;TypeError: d.spatialReference is undefined&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;on the result.&lt;/P&gt;&lt;P&gt;When I created the GP task I set the output spatial reference to that of the base map ...&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;gp = new Geoprocessor(testURL);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; gp.outSpatialReference = {&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; wkid: 102100&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp; };&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;However, when I try to get the result image, I get the error stating that spatialReference is undefined.&amp;nbsp; I am getting the result as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;var resultImage = gp.getResultImageLayer(result.jobId, "myImage", imageParams);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Is there any way to force or set the spatialReference on the return result image?&amp;nbsp; Maybe in the "imageParams"?&amp;nbsp; But the docs on imageParameters don't really seem to say that I can set the spatialReference.&amp;nbsp; Is it possible?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12pt;"&gt;Charlie&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2016 16:20:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-for-geoprocessing-task/m-p/309680#M28479</guid>
      <dc:creator>DougCollins</dc:creator>
      <dc:date>2016-06-14T16:20:47Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial reference for Geoprocessing Task</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-for-geoprocessing-task/m-p/309681#M28480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Try setting the outSpatialReference to an instance of SpatialReference. This property doesn't appear to be autocastable. So instead of this: &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;gp = new Geoprocessor(testURL);&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;gp.outSpatialReference = {&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&amp;nbsp; wkid: 102100&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;};&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;Try this:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; color: #3d3d3d;"&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;gp = new Geoprocessor(testURL);&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;gp.outSpatialReference = new SpatialReference({&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;&amp;nbsp; wkid: 102100&lt;/SPAN&gt;
&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 10pt; font-family: inherit;"&gt;});&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 14:49:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-for-geoprocessing-task/m-p/309681#M28480</guid>
      <dc:creator>KristianEkenes</dc:creator>
      <dc:date>2021-12-11T14:49:05Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial reference for Geoprocessing Task</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-for-geoprocessing-task/m-p/309682#M28481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the reply Kristian.&lt;/P&gt;&lt;P&gt;I tried as you suggested by setting to an instance of SpatialReference, however when I run it, I still get the same error.&amp;nbsp; If I look at the result in Firebug, it shows that the result image has a SpatialReference of 102008 (NAD_1983_Albers).&amp;nbsp; I suspect that because my base map (and 3D view) are Web Mercator (102100), that it will not display and will give me the "&lt;SPAN class="objectBox-errorMessage hasBreakSwitch objectBox"&gt;TypeError: d.spatialReference is undefined" message when I try to do&amp;nbsp;&amp;nbsp; &lt;EM&gt;map.add(resultImage);&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there another way around this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Charlie&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2016 20:52:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-for-geoprocessing-task/m-p/309682#M28481</guid>
      <dc:creator>DougCollins</dc:creator>
      <dc:date>2016-06-14T20:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial reference for Geoprocessing Task</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-for-geoprocessing-task/m-p/309683#M28482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ah. I see now. Yeah. I don't think all of the Geoprocessor code is complete yet, but you can try setting the spatial reference on the ImageParameters using the &lt;STRONG&gt;imageSpatialReference&lt;/STRONG&gt; property. This isn't documented in 4.0, but it may (or may not) work. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another thing to note is that SceneView in global mode does not support projected coordinate systems. However, SceneView in local mode does. So if you switch to a local &lt;STRONG&gt;viewingMode &lt;/STRONG&gt;and add the image to the view, then you may be able to see it then. Keep in mind that the SceneView must be constructed with that SR - &lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;102008 (NAD_1983_Albers). You can't change the spatial reference of the view after it's been created (yet anyway). &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3d3d3d; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;Try those ways and let me know if either of them work out for you.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2016 21:05:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-for-geoprocessing-task/m-p/309683#M28482</guid>
      <dc:creator>KristianEkenes</dc:creator>
      <dc:date>2016-06-14T21:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial reference for Geoprocessing Task</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-for-geoprocessing-task/m-p/309684#M28483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I tried setting the imageSpatialReference property but it gave another error this time:&lt;/P&gt;&lt;P&gt;&lt;SPAN class="objectBox opened objectBox-errorMessage hasTwisty hasBreakSwitch"&gt;"Error: [accessor] cannot access unknown property 'layerDefinitions' on instance of esri.layers.support.ImageParameters."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="objectBox opened objectBox-errorMessage hasTwisty hasBreakSwitch"&gt;So I also tried setting layerDefinitions as well, but I still got the same 'layerDefinitions' error.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="objectBox opened objectBox-errorMessage hasTwisty hasBreakSwitch"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="objectBox opened objectBox-errorMessage hasTwisty hasBreakSwitch"&gt;Maybe I will wait until the 4.0 API is more complete.&amp;nbsp;&amp;nbsp; I hope that they add a bit more documentation to the geoprocessing section as well.&amp;nbsp; Maybe more example snippets would help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="objectBox opened objectBox-errorMessage hasTwisty hasBreakSwitch"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="objectBox opened objectBox-errorMessage hasTwisty hasBreakSwitch"&gt;Thanks for your help.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="objectBox opened objectBox-errorMessage hasTwisty hasBreakSwitch"&gt;Charlie&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2016 22:11:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-for-geoprocessing-task/m-p/309684#M28483</guid>
      <dc:creator>DougCollins</dc:creator>
      <dc:date>2016-06-14T22:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: Spatial reference for Geoprocessing Task</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-for-geoprocessing-task/m-p/309685#M28484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the feedback Charlie. I think it is apparent that our Geoprocessing documentation isn't complete at the moment. We will make sure to revisit it, including with more snippets so it is more clear.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jun 2016 22:17:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/spatial-reference-for-geoprocessing-task/m-p/309685#M28484</guid>
      <dc:creator>KristianEkenes</dc:creator>
      <dc:date>2016-06-14T22:17:22Z</dc:date>
    </item>
  </channel>
</rss>

