Quantcast
Channel: DotSpatial
Viewing all articles
Browse latest Browse all 3973

Closed Unassigned: Exception when calling Feature.Difference() [63614]

$
0
0
I am checking whether a feature is intersected by another feature, and if so I remove the overlapping part from the first feature. It works for most of the polygons in the feature set I am working with but sometimes the exception "found null Directed Edge" is raised when using a feature's Difference method. Here is example data when it occurs. Note that it works fine in QGis.

```
IFeature intersection = targetFeature.Intersection(clipFeature);
if (intersection != null
{
IFeature diff = feature.Difference(intersection);
...
}
```
Data to reproduce the error:
WKT for targetFeature:
POLYGON ((1301337.9400024400000000 6410458.2880249000000000, 1301341.5162353500000000 6410455.7336425800000000, 1301345.2412109400000000 6410456.1473999000000000, 1301366.6038208000000000 6410458.5209960900000000, 1301384.0258178700000000 6410458.5209960900000000, 1301404.6732177700000000 6410442.0969848600000000, 1301380.2150268600000000 6410396.5476074200000000, 1301373.2139892600000000 6410385.0914306600000000, 1301368.7587890600000000 6410372.3624267600000000, 1301373.2139892600000000 6410353.9053955100000000, 1301365.5765991200000000 6410323.3560180700000000, 1301360.4849853500000000 6410304.2623901400000000, 1301360.4849853500000000 6410298.5344238300000000, 1301391.6710205100000000 6410290.8970336900000000, 1301419.0383911100000000 6410285.1690063500000000, 1301448.3076171900000000 6410285.9910278300000000, 1301442.5634155300000000 6410275.9396362300000000, 1301434.5170288100000000 6410224.9752197300000000, 1301410.4462280300000000 6410225.6610107400000000, 1301374.8052368200000000 6410223.1152343800000000, 1301345.5284423800000000 6410223.1152343800000000, 1301339.8812255900000000 6410225.7623901400000000, 1301323.2114257800000000 6410224.1215820300000000, 1301310.0524292000000000 6410232.3460083000000000, 1301253.5781860400000000 6410246.0532226600000000, 1301220.7355957000000000 6410251.2421875000000000, 1301205.2300415000000000 6410253.6920166000000000, 1301201.6910400400000000 6410252.3917846700000000, 1301174.3237915000000000 6410240.2994384800000000, 1301160.0928344700000000 6410233.9234008800000000, 1301137.4097900400000000 6410249.2095947300000000, 1301156.5426025400000000 6410324.0172119100000000, 1301185.9482421900000000 6410314.5784301800000000, 1301198.0726318400000000 6410310.6865844700000000, 1301227.0217895500000000 6410303.4912109400000000, 1301237.6876220700000000 6410303.2689819300000000, 1301243.0862426800000000 6410303.1564331100000000, 1301263.8358154300000000 6410309.8497924800000000, 1301271.8680419900000000 6410316.5433960000000000, 1301279.9000244100000000 6410333.2770385700000000, 1301295.6296386700000000 6410382.4738159200000000, 1301309.0166015600000000 6410449.7427978500000000, 1301312.4047851600000000 6410465.7742309600000000, 1301337.9400024400000000 6410458.2880249000000000))

WKT for obtained intersection:
POLYGON ((1301247.2989178500000000 6410247.0453155900000000, 1301220.7355957000000000 6410251.2421875000000000, 1301205.2300415000000000 6410253.6920166000000000, 1301201.6910400400000000 6410252.3917846700000000, 1301193.2223569100000000 6410248.6498575900000000, 1301198.0214121100000000 6410259.8480206400000000, 1301198.4467536000000000 6410260.7866030300000000, 1301208.7749058900000000 6410282.3820659000000000, 1301210.4013020700000000 6410287.2612544400000000, 1301212.1243448900000000 6410304.4881202000000000, 1301212.5851548600000000 6410307.0794666000000000, 1301227.0217895500000000 6410303.4912109400000000, 1301237.6876220700000000 6410303.2689819300000000, 1301243.0862426800000000 6410303.1564331100000000, 1301263.8358154300000000 6410309.8497924800000000, 1301271.8680419900000000 6410316.5433960000000000, 1301278.4572851700000000 6410330.2712696800000000, 1301276.7808200400000000 6410317.6963364900000000, 1301275.7039208200000000 6410313.0547693000000000, 1301273.7659515200000000 6410308.7018239900000000, 1301271.0373111500000000 6410304.7956263900000000, 1301267.6171207800000000 6410301.4780737200000000, 1301264.3514945400000000 6410298.8656627700000000, 1301261.4836277900000000 6410295.5879797200000000, 1301259.8756630900000000 6410279.5116572500000000, 1301258.7168667200000000 6410274.0940654000000000, 1301255.7168969100000000 6410265.0941559500000000, 1301254.5532157500000000 6410262.2135583400000000, 1301247.2989178500000000 6410247.0453155900000000))
Comments: https://github.com/DotSpatial/DotSpatial/issues/765

Viewing all articles
Browse latest Browse all 3973

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>