I'm doing intersection between two polygons, and in some instances I get the follwing error:
found non-noded intersection between LINESTRING...
static void Main(string[] args)
{
const string poly1Wkt = @"POLYGON ((447659.00088514 6232828.85568136, 447661.310889315 6232661.0118306, 447663.82381757 6232509.2309641, 447665.32016632 6232369.69959036, 447666.70195289 6232269.29960783, 447666.690152371 6232241.95127252, 447667.52798224 6232163.8253994, 447667.52798224 6232118.3170907, 447800.87791023 6232122.0212554, 447968.701300134 6232125.715481, 447968.63178764 6232132.83738432, 447962.290733373 6232134.33707906, 447957.64007719 6232141.30566063, 447959.97365113 6232150.62376395, 447968.37098475 6232156.30237139, 447968.345104083 6232160.45717706, 447967.56532022 6232193.9878832, 447967.550605288 6232195.33279361, 447966.94138956 6232218.80988487, 447963.840952101 6232227.33814896, 447966.94138956 6232234.30673053, 447966.941389556 6232251.01368731, 447966.179482514 6232320.65020981, 447961.523869854 6232327.30780043, 447966.049959616 6232332.48829994, 447963.998814869 6232519.95813469, 447961.523869854 6232524.9275755, 447961.523869854 6232528.79678793, 447963.87887844 6232530.92004396, 447962.832244316 6232626.57995612, 447960.311730742 6232628.08657778, 447958.761512014 6232637.42467704, 447961.870195314 6232645.17309987, 447961.870195314 6232714.50898591, 447961.74449003 6232725.998155, 447961.74449003 6232728.1148205, 447961.870195314 6232732.28578422, 447961.870195314 6232738.17416977, 447958.761512014 6232744.37290803, 447957.21129329 6232751.35148756, 447959.55311307 6232756.00054126, 447962.52161701 6232759.55981678, 447962.480387792 6232764.70876873, 447962.480387792 6232764.75875855, 447962.480387792 6232764.81874634, 447962.474320096 6232767.11412815, 447962.47214195 6232767.65816838, 447962.43915857 6232769.02788958, 447962.43091273 6232770.94749885, 447962.404854601 6232773.89637429, 447960.181600783 6232833.47957667, 447880.43723736 6232832.74052964, 447659.00088514 6232828.85568136), (447793.6459701 6232302.2387078, 447794.35152527 6232308.2359268, 447797.87930115 6232318.4664768, 447800.70152185 6232328.3442493, 447801.40707702 6232338.9275769, 447804.93485289 6232344.9247959, 447810.2265167 6232345.9831286, 447816.92929086 6232345.2775735, 447818.34040121 6232338.2220217, 447817.63484603 6232335.399801, 447818.6931788 6232327.2859165, 447814.81262534 6232313.5275906, 447813.40151499 6232309.9998147, 447810.2265167 6232302.2387078, 447808.10985118 6232294.4776009, 447802.11263219 6232290.949825, 447796.11541321 6232293.4192681, 447793.6459701 6232302.2387078), (447811.637626875 6232500.8524926, 447811.284849291 6232518.49137189, 447817.63484586 6232530.8385875, 447827.51261831 6232528.0163668, 447827.86539589 6232514.2580409, 447829.27650624 6232500.499715, 447829.100117447 6232492.38583046, 447826.80706313 6232485.68305626, 447817.28206827 6232483.5663908, 447811.63762688 6232490.2691649, 447811.99040447 6232491.3274977, 447811.637626875 6232500.8524926), (447840.91816652 6232640.9051964, 447842.32927687 6232647.9607481, 447849.03205103 6232658.1912981, 447852.5598269 6232673.713512, 447857.85149071 6232678.6523982, 447866.3181528 6232676.1829551, 447868.08204074 6232666.6579602, 447865.61259763 6232653.6051895, 447857.49871312 6232643.0218619, 447850.79593896 6232637.3774205, 447844.09316481 6232637.3774205, 447840.91816652 6232640.9051964))";
const string poly2Wkt = @"POLYGON ((447961.82530680706 6232833.4948004484, 448204.281525929 6232835.23441344, 448204.57013048 6232775.91648743, 448204.941193473 6232595.93312252, 448206.903704415 6232553.43177355, 448208.940427957 6232208.61196062, 448207.43143845 6232131.64762649, 448207.151079744 6232127.09855244, 448200.570895996 6232127.09855244, 448072.32327966 6232124.77902458, 447968.969867253 6232125.72883125, 447968.63178764074 6232132.8373842416, 447968.76372115 6232119.32013572, 447968.49160828 6232114.25116749, 447701.12010698 6232110.07201814, 447668.35112175 6232109.56212193, 447380.24956789 6232105.06303771, 447288.81964634 6232103.63332872, 447125.30264852 6232100.09980099, 447113.48001323 6232100.09404913, 447102.356369275 6232097.76092161, 447091.23272532 6232092.60557339, 447090.92762908 6232096.15485094, 447088.61879267 6232193.83496844, 447093.075671513 6232288.55415544, 447097.532550355 6232374.80668035, 447105.51720507 6232525.97028132, 447106.44630804 6232553.66172674, 447106.444782067 6232576.42223989, 447105.73770092 6232602.71052892, 447102.912428275 6232651.7593311, 447102.906324384 6232658.84031794, 447127.881994617 6232662.53951074, 447240.346506496 6232681.76091738, 447312.562513589 6232699.76918549, 447323.747998083 6232738.59133125, 447328.24808055 6232761.29641657, 447313.345395715 6232783.64872429, 447287.773357094 6232832.58667079, 447287.429252421 6232838.7403911, 447341.014874881 6232839.19923826, 447387.106122124 6232836.75807906, 447477.148010195 6232835.54733156, 447582.712112107 6232835.04213924, 447687.92343643 6232834.36055812, 447701.01800881 6232837.90032102, 447751.48610462 6232836.49520419, 447790.31254005 6232832.97342183, 447962.34988663 6232835.08226668, 447962.3493503 6232833.49856044, 447961.82530680706 6232833.4948004484), (447964.739749129 6232531.69619776, 447964.640798997 6232541.6941627, 447964.640798997 6232541.74415253, 447964.640798997 6232541.82413625, 447964.59956982225 6232545.5433750348, 447964.739749129 6232531.69619776), (447964.739749129 6232531.69619776, 447961.52386985 6232528.79678793, 447961.52386985 6232524.9275755, 447964.87992848 6232518.18894712, 447964.9211577 6232514.59967771, 447966.67752254 6232333.20659975, 447961.52386985 6232327.30780043, 447966.80945605 6232319.74933893, 447966.94138956 6232306.28208015, 447966.94138956 6232234.30673053, 447963.8409521 6232227.33814896, 447966.94138956 6232218.80988487, 447968.310199709 6232166.0606218679, 447968.310199709 6232223.21898741, 447971.410637165 6232225.54851324, 447971.410637165 6232229.8076463, 447969.860418437 6232232.90701544, 447967.642286321 6232235.12656365, 447967.634040477 6232235.81642323, 447967.634040477 6232235.85641509, 447967.551582034 6232243.58484199, 447965.861183953 6232518.31892067, 447969.340930246 6232519.4786846, 447972.820676539 6232524.90757957, 447970.091302077 6232529.55663326, 447964.113064963 6232530.32647656, 447964.154294184 6232531.16630562, 447964.739749129 6232531.69619776), (447962.480387792 6232764.81874634, 447962.472141948 6232767.9381114, 447962.463896103 6232768.64796691, 447962.340208439 6232781.45536001, 447962.340208439 6232781.53534373, 447962.33547563286 6232781.7476666747, 447962.43091273 6232770.94749885, 447962.43915857 6232769.02788958, 447962.47214195 6232767.65816838, 447962.480387792 6232764.81874634), (447964.162540028 6232591.7239794973, 447964.162540028 6232592.05391212, 447963.840952101 6232626.596881, 447968.920392187 6232633.57546053, 447968.161774512 6232642.21370224, 447962.900925851 6232646.97273355, 447962.752500654 6232738.90402121, 447969.29145518 6232744.51287954, 447966.990864622 6232752.65122301, 447962.950400917 6232757.84016681, 447962.480387792 6232764.70876873, 447962.52161701 6232759.55981678, 447959.55311307 6232756.00054126, 447957.21129329 6232751.35148756, 447958.76151201 6232744.37290803, 447961.87019531 6232738.17416977, 447961.87019531 6232645.17309987, 447958.76151201 6232637.42467704, 447960.31173074 6232628.08657778, 447963.8409521 6232625.97700718, 447964.162540028 6232591.7239794973), (447968.37098474993 6232156.3023713976, 447968.400903996 6232156.33260194, 447968.310199712 6232166.06062151, 447968.37098474993 6232156.3023713976), (447968.631787637 6232132.8373843208, 447968.631787637 6232132.85738025, 447968.631787637 6232132.87737618, 447973.34016473 6232133.31728664, 447978.741192744 6232143.00531467, 447975.673738666 6232150.87371308, 447968.359674775 6232153.07326536, 447968.351428931 6232156.28261211, 447968.37098472653 6232156.3023713743, 447959.97365113 6232150.62376395, 447957.64007719 6232141.30566063, 447962.29073337 6232134.33707906, 447968.631787637 6232132.8373843208), (447407.00173461 6232812.0023283, 447414.93923033 6232807.2398309, 447428.16838985 6232807.2398309, 447431.34338814 6232817.2939922, 447427.992001057 6232819.41065768, 447410.882288075 6232819.76343526, 447407.00173461 6232812.0023283))";
IGeometryFactory factory = GeometryFactory.Default;
WKTReader reader = new WKTReader(factory);
IGeometry poly1 = reader.Read(poly1Wkt);
Assert.IsTrue(poly1.IsValid);
Assert.IsTrue(poly1 is IPolygon);
IGeometry poly2 = reader.Read(poly2Wkt);
Assert.IsTrue(poly2.IsValid);
Assert.IsTrue(poly2 is IPolygon);
var intersection = poly1.Intersection(poly2);
var intersectionWKT = intersection.AsText();
}
found non-noded intersection between LINESTRING(447968.351428931 6232156.28261211, 447968.37098472641 6232156.3023713743) and LINESTRING(447968.37098472653 6232156.3023713743, 447959.97365113 6232150.62376395) [ (447968.37098472618, 6232156.3023713743, NaN) ]
at NetTopologySuite.Operation.Overlay.Snap.SnapIfNeededOverlayOp.GetResultGeometry(SpatialFunction opCode)
at NetTopologySuite.Operation.Overlay.Snap.SnapIfNeededOverlayOp.Overlay(IGeometry g0, IGeometry g1, SpatialFunction opCode)
at NetTopologySuite.Geometries.Geometry.Intersection(IGeometry other)
at NtsTestProjekt.Program.Main(String[] args)
I've tried the same instersection example with GeoServer WPS and Qgis, which uses JTS and a port of JTS, and in both instances the intersection did not fail.