<?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: Intersect two polylines to produce third polyline on 10.1 is broken in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/intersect-two-polylines-to-produce-third-polyline/m-p/485387#M13118</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;In Java, I would have to put some of that in a try-catch block.&amp;nbsp; Does .NET not have AutomationExceptions?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My concern is not about handling the exception.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My question is why I cannot do intersection of two polylines to produce a polyline in 10.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And thanks for your help, but I know how to do exception handling, and I am not that stupid to ask how to do exception handling in .net on ESRI forum&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 01 Mar 2013 15:53:27 GMT</pubDate>
    <dc:creator>GhassanKarwchan</dc:creator>
    <dc:date>2013-03-01T15:53:27Z</dc:date>
    <item>
      <title>Intersect two polylines to produce third polyline on 10.1 is broken</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/intersect-two-polylines-to-produce-third-polyline/m-p/485385#M13116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;So, I am migrating code from 9.3 to 10.1 SP1.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The code is working on 9.3, but not on 10.1 SP1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After long fight I narrow the problem to this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In 10.1 I cannot do intersection between two polylines to produce third polyline.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is that correct?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I wrote below very simple Visual Studio console application that is doing intersection between two polylines.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I created very two simple polylines, using WKT library , which you can &lt;/SPAN&gt;&lt;A href="https://github.com/blah238/DnrGps_Wkt" rel="nofollow noopener noreferrer" target="_blank"&gt;get it from here&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway you can replace it with any code that generate simple polylines.&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; static void Main(string[] args)
&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; //ESRI License Initializer generated code.
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_AOLicenseInitializer.InitializeApplication(new esriLicenseProductCode[] { esriLicenseProductCode.esriLicenseProductCodeStandard, esriLicenseProductCode.esriLicenseProductCodeAdvanced },
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; new esriLicenseExtensionCode[] { });

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var geom1 = "LINESTRING (2 1, 7 1)".ToGeometry();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var geom2 = "LINESTRING (3 1, 6 1)".ToGeometry();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var targetOperator = (ITopologicalOperator)geom1;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; targetOperator.Simplify();

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IGeometry intersectGeometry = targetOperator.Intersect(geom2, esriGeometryDimension.esriGeometryNoDimension );
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine(intersectGeometry.ToWellKnownText());


&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; m_AOLicenseInitializer.ShutdownApplication();

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The above code generate this COM Exception&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Error HRESULT E_FAIL has been returned from a call to a COM component.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;With error code&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-2147467259&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 21:23:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/intersect-two-polylines-to-produce-third-polyline/m-p/485385#M13116</guid>
      <dc:creator>GhassanKarwchan</dc:creator>
      <dc:date>2021-12-11T21:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: Intersect two polylines to produce third polyline on 10.1 is broken</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/intersect-two-polylines-to-produce-third-polyline/m-p/485386#M13117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In Java, I would have to put some of that in a try-catch block.&amp;nbsp; Does .NET not have AutomationExceptions?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 15:38:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/intersect-two-polylines-to-produce-third-polyline/m-p/485386#M13117</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-03-01T15:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: Intersect two polylines to produce third polyline on 10.1 is broken</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/intersect-two-polylines-to-produce-third-polyline/m-p/485387#M13118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;In Java, I would have to put some of that in a try-catch block.&amp;nbsp; Does .NET not have AutomationExceptions?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My concern is not about handling the exception.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;My question is why I cannot do intersection of two polylines to produce a polyline in 10.1&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And thanks for your help, but I know how to do exception handling, and I am not that stupid to ask how to do exception handling in .net on ESRI forum&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 15:53:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/intersect-two-polylines-to-produce-third-polyline/m-p/485387#M13118</guid>
      <dc:creator>GhassanKarwchan</dc:creator>
      <dc:date>2013-03-01T15:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Intersect two polylines to produce third polyline on 10.1 is broken</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/intersect-two-polylines-to-produce-third-polyline/m-p/485388#M13119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;My question is why I cannot do intersection of two polylines to produce a polyline in 10.1&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know.&amp;nbsp; Probably something you are missing.&amp;nbsp; Based on the code you posted, I can't tell.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm sure ESRI would not leave the ability to use the intersect method broken through a major upgrade to 10.1 and SP1.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 16:16:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/intersect-two-polylines-to-produce-third-polyline/m-p/485388#M13119</guid>
      <dc:creator>LeoDonahue</dc:creator>
      <dc:date>2013-03-01T16:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Intersect two polylines to produce third polyline on 10.1 is broken</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/intersect-two-polylines-to-produce-third-polyline/m-p/485389#M13120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I believe this is a special case.&amp;nbsp; Both input lines are horizontal and overlapping with each other.&amp;nbsp; This can causes the crash as you mentioned.&amp;nbsp; The problem has already been addressed in 10.2.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 17:16:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/intersect-two-polylines-to-produce-third-polyline/m-p/485389#M13120</guid>
      <dc:creator>WeifengHe</dc:creator>
      <dc:date>2013-03-01T17:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: Intersect two polylines to produce third polyline on 10.1 is broken</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/intersect-two-polylines-to-produce-third-polyline/m-p/485390#M13121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I believe this is a special case.&amp;nbsp; Both input lines are horizontal and overlapping with each other.&amp;nbsp; This can causes the crash as you mentioned.&amp;nbsp; The problem has already been addressed in 10.2.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am wondering if there is a work around&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In my case, I am having input from the users.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It is happening on horizontal or vertical lines.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;They are few but the exists, and I need to process them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 18:16:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/intersect-two-polylines-to-produce-third-polyline/m-p/485390#M13121</guid>
      <dc:creator>GhassanKarwchan</dc:creator>
      <dc:date>2013-03-01T18:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Intersect two polylines to produce third polyline on 10.1 is broken</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/intersect-two-polylines-to-produce-third-polyline/m-p/485391#M13122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The easiest way right now to deal with these situations is to work on a pre 10.1 set up, say 10.0 or 9.3, until 10.2 comes out.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The work around probably won't be pretty.&amp;nbsp; To make it work in 10.1, you might want to avoid the cases such as the bounding box or the envelope which holds the 2 input polylines has an area equal to 0.&amp;nbsp; For example, in your case, you can add an extra non-horizontal segment to one of the input lines.&amp;nbsp; Or rotate-intersect-rotate back?&amp;nbsp; Maybe you have better idea.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 01 Mar 2013 21:11:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/intersect-two-polylines-to-produce-third-polyline/m-p/485391#M13122</guid>
      <dc:creator>WeifengHe</dc:creator>
      <dc:date>2013-03-01T21:11:29Z</dc:date>
    </item>
  </channel>
</rss>

