<?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 Finding line intersections in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/finding-line-intersections/m-p/479404#M12988</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Starting with a street line segment from a centerline shapefile, I am trying to determine the intersection points of the intersecting lines from the same layer and determine if these points are vertex points of the original line and intersecting line.&amp;nbsp; I am using ITopologicalOperator.Intersect() and IHitTest.HitTest() methods with varying results.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First off, I do a query using a SpatialFilter of esriSpatialRelEnum.esriSpatialRelIntersects to find all the intersecting lines for the line in question.&amp;nbsp; I then loop thru these resulting lines to determine the intersection point of a line with the original using the ITopologicalOperator.Intersect() method with an ???esri.GeometryDimension.esriGeometry0Dimension???.&amp;nbsp; With that resulting point, I then use the IHitTest.HitTest() method with ???esriGeometryHitPartType.esriGeometryPartVertex??? against both line segments to determine if the ITopologicalOperator.Intersect result is a vertex of either line.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The results that I am seeing is mixed:&amp;nbsp; With a line that I am testing, the first result of the query intersects but not at a vertex point for either line.&amp;nbsp; The resulting HitTest() calls are false for both lines.&amp;nbsp; For the second line from the query, it intersects the original line at a vertex point for both lines and HitTest() returns true for both lines.&amp;nbsp; For the third line from the query, both lines also intersect at a vertex point for both lines but the HitTest() returns false for both lines.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I added logic to spin the vertex points of both lines and display their corresponding (X, Y) values of the vertex points.&amp;nbsp; I am also displaying the (X, Y) for the ITopologicalOperator.Intersect() result.&amp;nbsp; In looking at the vertex (X, Y)s of the two lines, the displayed values for the common vertex points are all the same.&amp;nbsp; For the intersection point (X, Y)s of the lines that return true, those values also match.&amp;nbsp; For the line(s) that return false even though there should be a Hit, the X values are the same but the Y values are just a little off well into the decimal portion of the value (e.g. 123.4567098 instead of 123.4567890).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What am I doing wrong?&amp;nbsp; Is this the right way to do this or should I be doing something?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help/direction would be appreciated.&amp;nbsp; Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 23 Jan 2012 14:29:00 GMT</pubDate>
    <dc:creator>MarkParr</dc:creator>
    <dc:date>2012-01-23T14:29:00Z</dc:date>
    <item>
      <title>Finding line intersections</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/finding-line-intersections/m-p/479404#M12988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Starting with a street line segment from a centerline shapefile, I am trying to determine the intersection points of the intersecting lines from the same layer and determine if these points are vertex points of the original line and intersecting line.&amp;nbsp; I am using ITopologicalOperator.Intersect() and IHitTest.HitTest() methods with varying results.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;First off, I do a query using a SpatialFilter of esriSpatialRelEnum.esriSpatialRelIntersects to find all the intersecting lines for the line in question.&amp;nbsp; I then loop thru these resulting lines to determine the intersection point of a line with the original using the ITopologicalOperator.Intersect() method with an ???esri.GeometryDimension.esriGeometry0Dimension???.&amp;nbsp; With that resulting point, I then use the IHitTest.HitTest() method with ???esriGeometryHitPartType.esriGeometryPartVertex??? against both line segments to determine if the ITopologicalOperator.Intersect result is a vertex of either line.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The results that I am seeing is mixed:&amp;nbsp; With a line that I am testing, the first result of the query intersects but not at a vertex point for either line.&amp;nbsp; The resulting HitTest() calls are false for both lines.&amp;nbsp; For the second line from the query, it intersects the original line at a vertex point for both lines and HitTest() returns true for both lines.&amp;nbsp; For the third line from the query, both lines also intersect at a vertex point for both lines but the HitTest() returns false for both lines.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I added logic to spin the vertex points of both lines and display their corresponding (X, Y) values of the vertex points.&amp;nbsp; I am also displaying the (X, Y) for the ITopologicalOperator.Intersect() result.&amp;nbsp; In looking at the vertex (X, Y)s of the two lines, the displayed values for the common vertex points are all the same.&amp;nbsp; For the intersection point (X, Y)s of the lines that return true, those values also match.&amp;nbsp; For the line(s) that return false even though there should be a Hit, the X values are the same but the Y values are just a little off well into the decimal portion of the value (e.g. 123.4567098 instead of 123.4567890).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What am I doing wrong?&amp;nbsp; Is this the right way to do this or should I be doing something?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any help/direction would be appreciated.&amp;nbsp; Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Jan 2012 14:29:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/finding-line-intersections/m-p/479404#M12988</guid>
      <dc:creator>MarkParr</dc:creator>
      <dc:date>2012-01-23T14:29:00Z</dc:date>
    </item>
  </channel>
</rss>

