<?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: Why does IPolygon.Overlap(IPolygon) use reflection to load client assemblies? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-does-ipolygon-overlap-ipolygon-use-reflection/m-p/257686#M6621</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Neil,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, the Inova dll is one of our own low-level DLLs (no ArcGIS in sight) - I couldn't understand why a call to ArcGIS code would end up trying to access it. I can only put it down to the wonders of COM interop.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the end, I applied an ICoordinateXform to my raster (since the output needs to be in the coordinate system of my polygon). Having done that, the problem disappeared.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Jul 2011 14:40:35 GMT</pubDate>
    <dc:creator>SteveStanton</dc:creator>
    <dc:date>2011-07-13T14:40:35Z</dc:date>
    <item>
      <title>Why does IPolygon.Overlap(IPolygon) use reflection to load client assemblies?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-does-ipolygon-overlap-ipolygon-use-reflection/m-p/257683#M6618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a simple piece of code that checks whether an envelope overlaps a polygon:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bool IsOverlap(IPolygon p, IEnvelope e)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IPolygon pe = new PolygonClass();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (pe as ISegmentCollection).SetRectangle(e);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return (pe as IRelationalOperator).Overlaps(p);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;It was working for me this morning. But this afternoon, the call to IRelationalOperator.Overlaps causes a weird exception, apparently due to some problem reflecting on assemblies. The message is &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Could not load file or assembly 'Inova.Core.DataStore.XmlSerializers' or one of its dependencies&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also see &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;Exception from HRESULT: 0x80040215| COM Errorcode -2147220971 [FDO_E_BINDING]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My app does reference a DLL called Inova.Core.DataStore.dll (though I don't know where it's getting the XmlSerializers bit from). The stack trace looks like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; at System.Reflection.RuntimeAssembly.nLoad(...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; at System.Reflection.RuntimeAssembly.LoadWithPartialNameInternal(...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; at ESRI.ArcGIS.Geometry.PolygonClass.Overlaps(IGeometry other)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp; at Firefly.Spatial.Survey.Database.BlockWriter.IsOverlap(IPolygon p, IEnvelope e)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Pity the ArcGIS code is top secret because now I have to ask: what's going on, and what can I do?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 12 Jul 2011 15:20:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-does-ipolygon-overlap-ipolygon-use-reflection/m-p/257683#M6618</guid>
      <dc:creator>SteveStanton</dc:creator>
      <dc:date>2011-07-12T15:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Why does IPolygon.Overlap(IPolygon) use reflection to load client assemblies?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-does-ipolygon-overlap-ipolygon-use-reflection/m-p/257684#M6619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Poking around this morning, I found that the following avoided the error:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int SplitRaster(IRasterDataset rds, IPolygon extent, ...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IRasterProps rasterProps = (IRasterProps)rds.CreateDefaultRaster();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IEnvelope dsExtent = rasterProps.Extent;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // The following leads to weird error
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // if (!IsOverlap(extent, dsExtent))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // This avoids the error
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IEnvelope testExtent = new EnvelopeClass();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; testExtent.PutCoords(dsExtent.XMin, dsExtent.YMin, dsExtent.XMax, dsExtent.YMax);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!IsOverlap(extent, testExtent))
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return 0;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Unfortunately, the result was incorrect. I then noticed that I'd forgotten to copy over the spatial reference. When I did that (i.e. set testExtent.SpatialReference = dsExtent.SpatialReference), the error came back.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So it seems the error is arising during an on-the-fly coordinate conversion (my polygon is NAD27, my raster is NAD83).&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:41:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-does-ipolygon-overlap-ipolygon-use-reflection/m-p/257684#M6619</guid>
      <dc:creator>SteveStanton</dc:creator>
      <dc:date>2021-12-11T12:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: Why does IPolygon.Overlap(IPolygon) use reflection to load client assemblies?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-does-ipolygon-overlap-ipolygon-use-reflection/m-p/257685#M6620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm not familiar with the Inova dll so I don't know what it's for or why it's being called.&amp;nbsp; However, when performing geometric operations with multiple geometries it's usually a good idea to make sure they are all in the same spatial reference.&amp;nbsp; I check the FactoryCodes of the spatial references involved and if they don't match then I call IGeometry.Project to project one of the geometries into the spatial reference of the other.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2011 13:01:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-does-ipolygon-overlap-ipolygon-use-reflection/m-p/257685#M6620</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2011-07-13T13:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: Why does IPolygon.Overlap(IPolygon) use reflection to load client assemblies?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-does-ipolygon-overlap-ipolygon-use-reflection/m-p/257686#M6621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Neil,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, the Inova dll is one of our own low-level DLLs (no ArcGIS in sight) - I couldn't understand why a call to ArcGIS code would end up trying to access it. I can only put it down to the wonders of COM interop.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the end, I applied an ICoordinateXform to my raster (since the output needs to be in the coordinate system of my polygon). Having done that, the problem disappeared.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Jul 2011 14:40:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-does-ipolygon-overlap-ipolygon-use-reflection/m-p/257686#M6621</guid>
      <dc:creator>SteveStanton</dc:creator>
      <dc:date>2011-07-13T14:40:35Z</dc:date>
    </item>
  </channel>
</rss>

