<?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 Re: MapView.Extent is wrong on spatial reference change in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/mapview-extent-is-wrong-on-spatial-reference/m-p/826853#M3097</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, that works! Quite strange behavior since cell size is optional parameter.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Jun 2019 18:47:32 GMT</pubDate>
    <dc:creator>MaxMax2</dc:creator>
    <dc:date>2019-06-17T18:47:32Z</dc:date>
    <item>
      <title>MapView.Extent is wrong on spatial reference change</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/mapview-extent-is-wrong-on-spatial-reference/m-p/826845#M3089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Code for test:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; sr &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; mapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SpatialReference&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; extent &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; mapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Extent&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Steps to reproduce the problem:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Create new project.&amp;nbsp;Variables now will have values:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="449957" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/449957_pastedImage_4.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Add layer with WGS84 spatial reference and zoom to full extent (the issue will be without zooming too). Now execute the code above:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="449959" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/449959_pastedImage_6.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We see that spatial reference now is WGS84, but extent coordinates doesn't correspond to WGS84. Max extent for this sr must be -180 -90 180 90 in degrees, but the values from screenshot are obviously wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;More than that I can't project extent to WGS84, because it's already in WGS84, so coordinates still the same!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:57:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/mapview-extent-is-wrong-on-spatial-reference/m-p/826845#M3089</guid>
      <dc:creator>MaxMax2</dc:creator>
      <dc:date>2021-12-12T09:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: MapView.Extent is wrong on spatial reference change</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/mapview-extent-is-wrong-on-spatial-reference/m-p/826846#M3090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN&gt;Any news on this issue?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2019 10:46:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/mapview-extent-is-wrong-on-spatial-reference/m-p/826846#M3090</guid>
      <dc:creator>MaxMax2</dc:creator>
      <dc:date>2019-06-11T10:46:16Z</dc:date>
    </item>
    <item>
      <title>Re: MapView.Extent is wrong on spatial reference change</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/mapview-extent-is-wrong-on-spatial-reference/m-p/826847#M3091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I cannot reproduce. My results using 2.4:&lt;/P&gt;&lt;P&gt;SR Domain, MapView Extent, layer "QueryExtent"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Initial extent:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/450081_MapExtent1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Zoom to layer extent&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/450082_MapExtent2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pan to date line (or approx) with "Enable wrapping around the date line" enabled&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-3 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/450086_MapExtent3.png" /&gt;&lt;/P&gt;&lt;P&gt;layer properties:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-4 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/450087_layerprops_mapex.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;map properties:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-5 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/450088_Mapprops.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Jun 2019 18:50:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/mapview-extent-is-wrong-on-spatial-reference/m-p/826847#M3091</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2019-06-11T18:50:02Z</dc:date>
    </item>
    <item>
      <title>Re: MapView.Extent is wrong on spatial reference change</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/mapview-extent-is-wrong-on-spatial-reference/m-p/826848#M3092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Charles,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found exact scenario to reproduce issue. I suppose you added feature layer with WGS84 and all is OK. Yes, in this case I see valid values too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if I add raster dataset with WGS84 to new project, values will be invalid:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/450384_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've attached zip archive with GDB with raster dataset to my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Raster dataset created with this code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; fullExtent &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; QueuedTask&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Run&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; EnvelopeBuilder&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreateEnvelope&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;180&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;90&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;180&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;90&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; SpatialReferences&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;WGS84&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; args &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Geoprocessing&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;MakeValueArray&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;datastorePath&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; RasterDatasetName&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"32_BIT_UNSIGNED"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"NONE"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; env &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; Geoprocessing&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;MakeEnvironmentArray&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;outputCoordinateSystem&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; SpatialReferences&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;WGS84&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; extent&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; fullExtent&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; gpResult &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; Geoprocessing&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;ExecuteToolAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"CreateRasterDataset_management"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; args&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; env&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; cancellationToken&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; flags&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; GPExecuteToolFlags&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AddOutputsToMap&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:57:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/mapview-extent-is-wrong-on-spatial-reference/m-p/826848#M3092</guid>
      <dc:creator>MaxMax2</dc:creator>
      <dc:date>2021-12-12T09:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: MapView.Extent is wrong on spatial reference change</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/mapview-extent-is-wrong-on-spatial-reference/m-p/826849#M3093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Max,&amp;nbsp;the layer extent looks bogus:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/450442_BadExtent.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Jun 2019 21:39:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/mapview-extent-is-wrong-on-spatial-reference/m-p/826849#M3093</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2019-06-14T21:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: MapView.Extent is wrong on spatial reference change</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/mapview-extent-is-wrong-on-spatial-reference/m-p/826850#M3094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, but it has been created with Create Raster Dataset tool, so dataset is created in legitimate way. Is it a bug in&amp;nbsp;&lt;SPAN&gt;Create Raster Dataset geoprocessing tool? How can I create valid raster dataset in GDB?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 15 Jun 2019 10:19:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/mapview-extent-is-wrong-on-spatial-reference/m-p/826850#M3094</guid>
      <dc:creator>MaxMax2</dc:creator>
      <dc:date>2019-06-15T10:19:41Z</dc:date>
    </item>
    <item>
      <title>Re: MapView.Extent is wrong on spatial reference change</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/mapview-extent-is-wrong-on-spatial-reference/m-p/826851#M3095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've also checked Create Raster Dataset for GDB and file rasters, and in all cases output dataset has such strange extent. Please give advice how can I create valid raster dataset with valid extent for WGS84?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2019 09:59:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/mapview-extent-is-wrong-on-spatial-reference/m-p/826851#M3095</guid>
      <dc:creator>MaxMax2</dc:creator>
      <dc:date>2019-06-17T09:59:29Z</dc:date>
    </item>
    <item>
      <title>Re: MapView.Extent is wrong on spatial reference change</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/mapview-extent-is-wrong-on-spatial-reference/m-p/826852#M3096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Max, the issue to me looks like you are not specifying a cell size. The resulting cell size of the raster is&amp;nbsp;10600614 which matches the dimension of the raster. I do not know the significance of that number (i.e. why is it&amp;nbsp;used&amp;nbsp;as the default cell size). However, if I do specify a cell size explicitly (eg "90" or "180" ) then the extent of the layer is correct (as, in, it is a proper extent).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As the cell size, in this case because of the projection being used, is in decimal degrees and the WGS projection is wider than it is tall, I assume that the maximum possible cell size will be "180" while still retaining a "real" spatial extent.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example, using your same settings and a cell size of 180:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/450576_GP_inputs.png" /&gt;&lt;IMG alt="" class="image-2 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/450577_raster_layer.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2019 18:26:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/mapview-extent-is-wrong-on-spatial-reference/m-p/826852#M3096</guid>
      <dc:creator>CharlesMacleod</dc:creator>
      <dc:date>2019-06-17T18:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: MapView.Extent is wrong on spatial reference change</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/mapview-extent-is-wrong-on-spatial-reference/m-p/826853#M3097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, that works! Quite strange behavior since cell size is optional parameter.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Jun 2019 18:47:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/mapview-extent-is-wrong-on-spatial-reference/m-p/826853#M3097</guid>
      <dc:creator>MaxMax2</dc:creator>
      <dc:date>2019-06-17T18:47:32Z</dc:date>
    </item>
  </channel>
</rss>

