<?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: How to get raster system-optimized pixel block size programmatically in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-raster-system-optimized-pixel-block/m-p/809174#M2297</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank &lt;A href="https://community.esri.com/migrated-users/267057"&gt;Gintautas Kmieliauskas&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My addin task is to read all the pixels from raster under 64bits.&lt;/P&gt;&lt;P&gt;It look like no defined rules in it so far I chopped into 1000 pixel block and looking good and still quick.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Than&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Mar 2020 03:21:59 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2020-03-23T03:21:59Z</dc:date>
    <item>
      <title>How to get raster system-optimized pixel block size programmatically</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-raster-system-optimized-pixel-block/m-p/809170#M2293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In ArcObject we can get system-optimized pixel block size like this below code.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//00010000000t000000" title="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//00010000000t000000"&gt;ArcObjects 10 .NET SDK Help&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class="" style="background-color: #ffffff; font-size: 12.48px; margin: 0.6em 0.5em;"&gt;&lt;SPAN class="" style="color: #008000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//Create a raster. &lt;/SPAN&gt;        IRaster2 raster2 = rasterDs.CreateFullRaster()&lt;SPAN class="" style="color: #0000ff;"&gt;as&lt;/SPAN&gt; IRaster2;         &lt;SPAN class="" style="color: #008000;"&gt;//Create a raster cursor with a system-optimized pixel block size by passing a null.&lt;/SPAN&gt;        IRasterCursor rasterCursor = raster2.CreateCursorEx(&lt;SPAN class="" style="color: #0000ff;"&gt;null&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In ArcGIS pro sdk how shall we create cursor like this?, it seem width, height are mandatory.&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/index.html#topic15384.html" title="https://pro.arcgis.com/en/pro-app/sdk/api-reference/index.html#topic15384.html"&gt;ArcGIS Pro 2.4 API Reference Guide&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is that different way in ArcGIS pro sdk?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Aug 2019 05:55:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-raster-system-optimized-pixel-block/m-p/809170#M2293</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2019-08-19T05:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to get raster system-optimized pixel block size programmatically</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-raster-system-optimized-pixel-block/m-p/809171#M2294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Than,&lt;/P&gt;&lt;P&gt;Have you tried to look at snippets page?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Raster"&gt;https://github.com/esri/arcgis-pro-sdk/wiki/ProSnippets-Raster&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are few snippets with RasterCursor and PixelBlock&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 19 Aug 2019 09:32:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-raster-system-optimized-pixel-block/m-p/809171#M2294</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2019-08-19T09:32:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to get raster system-optimized pixel block size programmatically</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-raster-system-optimized-pixel-block/m-p/809172#M2295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp; &lt;A href="https://community.esri.com/migrated-users/267057" target="_blank"&gt;Gintautas Kmieliauskas&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, I did read through.&lt;/P&gt;&lt;P&gt;All sample are hardcoded with max size. 1000 or 128 only like below, to create curstor you must define width and height in advance.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="" style="color: #d73a49;"&gt;int&lt;/SPAN&gt; &lt;SPAN class=""&gt;pixelBlockHeight&lt;/SPAN&gt; &lt;SPAN class="" style="color: #d73a49;"&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;raster&lt;/SPAN&gt;.&lt;SPAN class="" style="color: #6f42c1;"&gt;GetHeight&lt;/SPAN&gt;() &lt;SPAN class="" style="color: #d73a49;"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="" style="color: #005cc5;"&gt;1000&lt;/SPAN&gt; &lt;SPAN class="" style="color: #d73a49;"&gt;?&lt;/SPAN&gt; &lt;SPAN class="" style="color: #005cc5;"&gt;1000&lt;/SPAN&gt; &lt;SPAN class="" style="color: #d73a49;"&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;raster&lt;/SPAN&gt;.&lt;SPAN class="" style="color: #6f42c1;"&gt;GetHeight&lt;/SPAN&gt;();   
&lt;SPAN class="" style="color: #d73a49;"&gt;int&lt;/SPAN&gt; &lt;SPAN class=""&gt;pixelBlockWidth&lt;/SPAN&gt; &lt;SPAN class="" style="color: #d73a49;"&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;raster&lt;/SPAN&gt;.&lt;SPAN class="" style="color: #6f42c1;"&gt;GetWidth&lt;/SPAN&gt;() &lt;SPAN class="" style="color: #d73a49;"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="" style="color: #005cc5;"&gt;1000&lt;/SPAN&gt; &lt;SPAN class="" style="color: #d73a49;"&gt;?&lt;/SPAN&gt; &lt;SPAN class="" style="color: #005cc5;"&gt;1000&lt;/SPAN&gt; &lt;SPAN class="" style="color: #d73a49;"&gt;:&lt;/SPAN&gt; &lt;SPAN class=""&gt;raster&lt;/SPAN&gt;.&lt;SPAN class="" style="color: #6f42c1;"&gt;GetWidth&lt;/SPAN&gt;();    
&lt;SPAN class="" style="color: #6a737d;"&gt;// Create the raster cursor using the height and width calculated.&lt;/SPAN&gt;  
&lt;SPAN class="" style="color: #6f42c1;"&gt;RasterCursor&lt;/SPAN&gt; &lt;SPAN class=""&gt;rasterCursor&lt;/SPAN&gt; &lt;SPAN class="" style="color: #d73a49;"&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;raster&lt;/SPAN&gt;.&lt;SPAN class="" style="color: #6f42c1;"&gt;CreateCursor&lt;/SPAN&gt;(&lt;SPAN class=""&gt;pixelBlockWidth&lt;/SPAN&gt;, &lt;SPAN class=""&gt;pixelBlockHeight&lt;/SPAN&gt;);    
&lt;SPAN class="" style="color: #6a737d;"&gt;// Use a do while loop to iterate through the pixel blocks of the raster using the raster cursor.&lt;/SPAN&gt;  
&lt;SPAN class="" style="color: #d73a49;"&gt;do&lt;/SPAN&gt;  {     
&lt;SPAN class="" style="color: #6a737d;"&gt;// Get the current pixel block from the cursor.&lt;/SPAN&gt;    
&lt;SPAN class="" style="color: #6f42c1;"&gt;PixelBlock&lt;/SPAN&gt; &lt;SPAN class=""&gt;currentPixelBlock&lt;/SPAN&gt; &lt;SPAN class="" style="color: #d73a49;"&gt;=&lt;/SPAN&gt; &lt;SPAN class=""&gt;rasterCursor&lt;/SPAN&gt;.&lt;SPAN class=""&gt;Current&lt;/SPAN&gt;;     
&lt;SPAN class="" style="color: #6a737d;"&gt;// Do something with the pixel block...&lt;/SPAN&gt;     
&lt;SPAN class="" style="color: #6a737d;"&gt;// Once you are done, move to the next pixel block.&lt;/SPAN&gt;  
}   &lt;SPAN class="" style="color: #d73a49;"&gt;while&lt;/SPAN&gt; (&lt;SPAN class=""&gt;rasterCursor&lt;/SPAN&gt;.&lt;SPAN class="" style="color: #6f42c1;"&gt;MoveNext&lt;/SPAN&gt;());&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where as In ArcObject like below code, we don't need to define pixelbockwidth or height.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;SPAN class="" style="color: #008000; border: 0px; font-weight: inherit; font-size: 12.48px;"&gt;//Create a raster. &lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
IRaster2 raster2 = rasterDs.CreateFullRaster()&lt;SPAN class="" style="color: #0000ff; border: 0px; font-weight: inherit; font-size: 12.48px;"&gt;as&lt;/SPAN&gt; IRaster2;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;SPAN class="" style="color: #008000; border: 0px; font-weight: inherit; font-size: 12.48px;"&gt;//Create a raster cursor with a system-optimized pixel block size by passing a null.&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
IRasterCursor rasterCursor = raster2.CreateCursorEx(&lt;SPAN class="" style="color: #0000ff; border: 0px; font-weight: inherit; font-size: 12.48px;"&gt;null&lt;/SPAN&gt;);&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any method to generate width and height?&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you know, based on the raster size, pixel block size should be different.&lt;/P&gt;&lt;P&gt;If, there is a formula for me to generate width and height for better performance, that would be great.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 09:28:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-raster-system-optimized-pixel-block/m-p/809172#M2295</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-12T09:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to get raster system-optimized pixel block size programmatically</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-raster-system-optimized-pixel-block/m-p/809173#M2296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Than,&lt;/P&gt;&lt;P&gt;I think pixel block size depends on your task.&lt;/P&gt;&lt;P&gt;If you need specific area which coordinates you know, you can convert them to raster pixels ant then calculate width and height.&lt;/P&gt;&lt;P&gt;If you need all raster try to read all raster at ones. In 64 bits there are no memory limitations so it could work. I am not sure that it is totally rewritten in ArcGIS Pro &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;P&gt;Sometimes I take width as all raster width and height as the best performance value.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Mar 2020 07:44:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-raster-system-optimized-pixel-block/m-p/809173#M2296</guid>
      <dc:creator>GKmieliauskas</dc:creator>
      <dc:date>2020-03-20T07:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to get raster system-optimized pixel block size programmatically</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-raster-system-optimized-pixel-block/m-p/809174#M2297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank &lt;A href="https://community.esri.com/migrated-users/267057"&gt;Gintautas Kmieliauskas&lt;/A&gt;‌,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My addin task is to read all the pixels from raster under 64bits.&lt;/P&gt;&lt;P&gt;It look like no defined rules in it so far I chopped into 1000 pixel block and looking good and still quick.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Than&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Mar 2020 03:21:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/how-to-get-raster-system-optimized-pixel-block/m-p/809174#M2297</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2020-03-23T03:21:59Z</dc:date>
    </item>
  </channel>
</rss>

