Skip to content

Commit

Permalink
check for invalid geometry in inlet layer
Browse files Browse the repository at this point in the history
  • Loading branch information
ahedhi committed Apr 4, 2016
1 parent a3edd12 commit b668f7c
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions Source/DHI.Urban.Delineation/SetupOp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1038,20 +1038,25 @@ private List<int> _FindDownstreamPipeEnds()
try
{
ISimpleJunctionFeature junction = inlet as ISimpleJunctionFeature;
bool isDownstream = junction.EdgeFeatureCount > 0;
for (int i = 0; i < junction.EdgeFeatureCount; i++)

//Check that inlet is a valid part of network before testing if it is at downstream end
if (!inlet.Shape.IsEmpty && junction.EID != 0)
{
netTopology.GetAdjacentEdge(junction.EID, i, out edgeId, out towardJunction);
if (!towardJunction)
bool isDownstream = junction.EdgeFeatureCount > 0;
for (int i = 0; i < junction.EdgeFeatureCount; i++)
{
isDownstream = false;
break;
netTopology.GetAdjacentEdge(junction.EID, i, out edgeId, out towardJunction);
if (!towardJunction)
{
isDownstream = false;
break;
}
}
}

if (isDownstream)
{
endPointOidList.Add(inlet.OID);
if (isDownstream)
{
endPointOidList.Add(inlet.OID);
}
}
}
finally
Expand Down

0 comments on commit b668f7c

Please sign in to comment.