<?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: arcobjects extract raster by polygon in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-extract-raster-by-polygon/m-p/464038#M12581</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This page shows a C# sample of using the mask: &lt;A href="http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//00010000023w000000" title="http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//00010000023w000000"&gt;ArcObjects Help for .NET developers&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Dec 2014 23:20:22 GMT</pubDate>
    <dc:creator>XanderBakker</dc:creator>
    <dc:date>2014-12-30T23:20:22Z</dc:date>
    <item>
      <title>arcobjects extract raster by polygon</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-extract-raster-by-polygon/m-p/464037#M12580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to extract an area of interest from a raster using arcobjects (C#) to create a Server Object Extension. I can successfully get .Clip to run but it only accepts an envelope and I want to allow the user to provide a polygon for their area of interest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the code that fails and the error that I get back&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;//"error": {
//&amp;nbsp;&amp;nbsp;&amp;nbsp; "code": 500,
//&amp;nbsp;&amp;nbsp;&amp;nbsp; "message": "Error in handling operation GetAreaGreaterLessThan",
//&amp;nbsp;&amp;nbsp;&amp;nbsp; "details": []
//}
IExtractionOp2 extractionOps = new RasterExtractionOpClass();
IGeoDataset extractedRaster = extractionOps.Polygon(rasterToQueryAsGDS, areaOfInterest, true);&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the alternative that kind of works but only allows an envelope and I want to use a polygon geometry&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;//this works
RasterTransformationOpClass rasterTransformationOpClass = new RasterTransformationOpClass();
//clip raster
IGeoDataset clippedRaster = rasterTransformationOpClass.Clip(rasterToQueryAsGDS, areaOfInterest.Envelope);&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As an input the user can provide a polygon geometry (called &lt;SPAN style="color: #303030; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px;"&gt;areaOfInterest)&lt;/SPAN&gt; so I'm not working with any featureclasses by default.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In another section I'm running a ReclassByRemap. Does anyone have an example on how I could use an IPolygon as a mask during the reclass rather than extracting/clipping the raster?&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;IReclassOp reclassOp = new RasterReclassOpClass();
// Reclassify the geodataset
IGeoDataset reclassDataset = reclassOp.ReclassByRemap(clippedRaster, remap, false);&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:36:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-extract-raster-by-polygon/m-p/464037#M12580</guid>
      <dc:creator>JustinShepard</dc:creator>
      <dc:date>2021-12-11T20:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: arcobjects extract raster by polygon</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-extract-raster-by-polygon/m-p/464038#M12581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This page shows a C# sample of using the mask: &lt;A href="http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//00010000023w000000" title="http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//00010000023w000000"&gt;ArcObjects Help for .NET developers&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Dec 2014 23:20:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-extract-raster-by-polygon/m-p/464038#M12581</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2014-12-30T23:20:22Z</dc:date>
    </item>
  </channel>
</rss>

