<?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: Raster SetWidth not working in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/raster-setwidth-not-working/m-p/831714#M3356</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Than,&lt;/P&gt;&lt;P&gt;After you set extent and height, if your new extent is different or your new height is different that will account for the change in Y cell size, i.e. (XMax-XMin)/Height = CellSize Y.&lt;/P&gt;&lt;P&gt;Is what you are seeing not following these rules? Another thing to check if when you set the extent and height if its actually correctly being set. Try getting right after or debug through to see if its correctly set.&lt;/P&gt;&lt;P&gt;-Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 12 Feb 2020 01:41:01 GMT</pubDate>
    <dc:creator>Prashant_MukeshMangtani</dc:creator>
    <dc:date>2020-02-12T01:41:01Z</dc:date>
    <item>
      <title>Raster SetWidth not working</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/raster-setwidth-not-working/m-p/831706#M3348</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to export (SaveAs) a raster as a TIFF.&amp;nbsp; Exporting the whole raster works.&amp;nbsp; Setting the (geographic) extent and exporting works. But setting the Width and Height before exporting only sets teh Height.&lt;/P&gt;&lt;P&gt;This is called from a button AddIn:&lt;/P&gt;&lt;P&gt;System.Uri uri = new Uri("e:\\ESRI_GDB\\Southampton.gdb");&lt;/P&gt;&lt;P&gt;QueuedTask.Run(() =&amp;gt;&lt;BR /&gt; {&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;FileGeodatabaseConnectionPath path = new FileGeodatabaseConnectionPath(uri);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Geodatabase gdb = new Geodatabase(path);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;RasterDataset rasterDataset = gdb.OpenDataset&amp;lt;RasterDataset&amp;gt;("Raster_250");&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Raster raster = rasterDataset.CreateFullRaster();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;SpatialReference spatialReference = SpatialReferenceBuilder.CreateSpatialReference(27700);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;raster.SetSpatialReference(spatialReference);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;Envelope ext = EnvelopeBuilder.CreateEnvelope(400000, 100000, 450000, 150000, spatialReference); // select an area&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;int W = raster.GetWidth(); // original raster is 4040 columns&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;int H = raster.GetHeight(); // 3880 rows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;raster.SetWidth(500);&amp;nbsp;&amp;nbsp;&amp;nbsp;// try to set the size of the output raster&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;raster.SetHeight(500);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;W = raster.GetWidth(); // still 4040 columns&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;H = raster.GetHeight(); // correct at 500 rows&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;raster.SetExtent(ext); //&amp;nbsp;select teh geographic area of interest&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;FileSystemConnectionPath connectionPath = new FileSystemConnectionPath(new System.Uri(@"C:\Dummy"), &amp;nbsp;&amp;nbsp;&amp;nbsp;FileSystemDatastoreType.Raster);&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;FileSystemDatastore dataStore = new FileSystemDatastore(connectionPath);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;RasterStorageDef rasterStorageDef = new RasterStorageDef();&lt;BR /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;rasterStorageDef.SetPyramidLevel(0); // don't want pyramids&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;raster.SaveAs("bbtest.tif", dataStore, "TIFF", rasterStorageDef); // creates long thin distorted raster of the correct geographic area&lt;BR /&gt;&amp;nbsp;&amp;nbsp;});&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm obviously doing something wrong because setting teh raster Width is so simple it shouldn't fail, but I can't for the life of me see what I'm doing wrong.&amp;nbsp; Can anyone help?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Apr 2018 15:38:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/raster-setwidth-not-working/m-p/831706#M3348</guid>
      <dc:creator>ChrisBarrington_Brown</dc:creator>
      <dc:date>2018-04-23T15:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: Raster SetWidth not working</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/raster-setwidth-not-working/m-p/831707#M3349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris. This is a bug which we are aware of. We will try and fix this for the next release of Pro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 24 Apr 2018 22:11:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/raster-setwidth-not-working/m-p/831707#M3349</guid>
      <dc:creator>Prashant_MukeshMangtani</dc:creator>
      <dc:date>2018-04-24T22:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: Raster SetWidth not working</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/raster-setwidth-not-working/m-p/831708#M3350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;P&gt;Many thanks.&amp;nbsp; I’ll stop beating my head against it until 2.2 comes out.&amp;nbsp; As a work-around, is there any way of specifying the Pyramid layer that the Raster is to use?&amp;nbsp; If so I could use set the Extent and then use PixelBlocks to pull out the pixels at the resolution I need.&lt;/P&gt;&lt;P&gt;As a side note, are you aware that if you try to export (SaveAs) the raster using JPG rather than TIFF the call returns a ‘Feature has empty geometry’ error?&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Apr 2018 15:07:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/raster-setwidth-not-working/m-p/831708#M3350</guid>
      <dc:creator>ChrisBarrington_Brown</dc:creator>
      <dc:date>2018-04-25T15:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Raster SetWidth not working</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/raster-setwidth-not-working/m-p/831709#M3351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Chris,&amp;nbsp;&lt;/P&gt;&lt;P&gt;We can confirm this&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;fix is included with the upcoming Pro 2.2 release.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2018 20:58:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/raster-setwidth-not-working/m-p/831709#M3351</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2018-05-25T20:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: Raster SetWidth not working</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/raster-setwidth-not-working/m-p/831710#M3352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 May 2018 09:17:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/raster-setwidth-not-working/m-p/831710#M3352</guid>
      <dc:creator>ChrisBarrington_Brown</dc:creator>
      <dc:date>2018-05-26T09:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Raster SetWidth not working</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/raster-setwidth-not-working/m-p/831711#M3353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Chris,&lt;/P&gt;&lt;P&gt;Regarding the below, JPEG only supports 8bit so if you use it for bit depths other than 8bit then you will get the below error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;"As a side note, are you aware that if you try to export (SaveAs) the raster using JPG rather than TIFF the call returns a ‘Feature has empty geometry’ error?"&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;-Prashant&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 May 2018 23:30:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/raster-setwidth-not-working/m-p/831711#M3353</guid>
      <dc:creator>Prashant_MukeshMangtani</dc:creator>
      <dc:date>2018-05-29T23:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: Raster SetWidth not working</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/raster-setwidth-not-working/m-p/831712#M3354</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;P&gt;That's very useful.&amp;nbsp; I can work with that.&amp;nbsp; Perhaps a more useful error message in a future build?&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 May 2018 08:05:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/raster-setwidth-not-working/m-p/831712#M3354</guid>
      <dc:creator>ChrisBarrington_Brown</dc:creator>
      <dc:date>2018-05-30T08:05:44Z</dc:date>
    </item>
    <item>
      <title>Re: Raster SetWidth not working</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/raster-setwidth-not-working/m-p/831713#M3355</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi @Prashant Mukesh Mangtani,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can manage to save width, height, extent with save as in 2.4.&lt;/P&gt;&lt;P&gt;But somehow it change the cell size Y.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example , original cell size is 299.463 for X, Y. after setting width/height/extent save as another set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cell size become X =&amp;gt; 299.463 and Y =&amp;gt;&amp;nbsp; 28291.448382&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have tried with&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt; rasterDataset.CreateDefaultRaster();&lt;/SPAN&gt; and&amp;nbsp;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #3d3d3d; font-family: arial,helvetica,'helvetica neue',verdana,sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px; word-wrap: break-word;"&gt; rasterDataset.CreateFullRaster();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;What could be the issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have attached the result raster files as well.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Dec 2019 02:40:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/raster-setwidth-not-working/m-p/831713#M3355</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-12-11T02:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: Raster SetWidth not working</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/raster-setwidth-not-working/m-p/831714#M3356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Than,&lt;/P&gt;&lt;P&gt;After you set extent and height, if your new extent is different or your new height is different that will account for the change in Y cell size, i.e. (XMax-XMin)/Height = CellSize Y.&lt;/P&gt;&lt;P&gt;Is what you are seeing not following these rules? Another thing to check if when you set the extent and height if its actually correctly being set. Try getting right after or debug through to see if its correctly set.&lt;/P&gt;&lt;P&gt;-Prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2020 01:41:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/raster-setwidth-not-working/m-p/831714#M3356</guid>
      <dc:creator>Prashant_MukeshMangtani</dc:creator>
      <dc:date>2020-02-12T01:41:01Z</dc:date>
    </item>
  </channel>
</rss>

