{"action":"created","issue":{"url":"https://api.github.com/repos/NetTopologySuite/NetTopologySuite/issues/122","repository_url":"https://api.github.com/repos/NetTopologySuite/NetTopologySuite","labels_url":"https://api.github.com/repos/NetTopologySuite/NetTopologySuite/issues/122/labels{/name}","comments_url":"https://api.github.com/repos/NetTopologySuite/NetTopologySuite/issues/122/comments","events_url":"https://api.github.com/repos/NetTopologySuite/NetTopologySuite/issues/122/events","html_url":"https://github.com/NetTopologySuite/NetTopologySuite/issues/122","id":175921620,"number":122,"title":"polygon intersection error","user":{"login":"sendreams","id":4160051,"avatar_url":"https://avatars.githubusercontent.com/u/4160051?v=3","gravatar_id":"","url":"https://api.github.com/users/sendreams","html_url":"https://github.com/sendreams","followers_url":"https://api.github.com/users/sendreams/followers","following_url":"https://api.github.com/users/sendreams/following{/other_user}","gists_url":"https://api.github.com/users/sendreams/gists{/gist_id}","starred_url":"https://api.github.com/users/sendreams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sendreams/subscriptions","organizations_url":"https://api.github.com/users/sendreams/orgs","repos_url":"https://api.github.com/users/sendreams/repos","events_url":"https://api.github.com/users/sendreams/events{/privacy}","received_events_url":"https://api.github.com/users/sendreams/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-09-09T03:48:50Z","updated_at":"2016-09-11T13:20:33Z","closed_at":"2016-09-09T12:03:21Z","body":"Steps to reproduce\r\n\r\ntwo polygon, coordates is below: {LINEARRING (0.0000000000000000 -6.1026585365860800, 3.8000000000000000 -5.7690000000000000, 7.9000000000000000 -5.4090000000000000, 12.0000000000000000 -5.3690000000000000, 16.1000000000000000 -5.0990000000000000, 20.3000000000000000 -5.1390000000000000, 24.5000000000000000 -4.9090000000000000, 28.5000000000000000 -4.6390000000000000, 32.6000000000000000 -4.1890000000000000, 36.6000000000000000 -3.2890000000000000, 40.8000000000000000 -3.1890000000000000, 44.8000000000000000 -2.9490000000000000, 49.0000000000000000 -2.8200000000000000, 53.3000000000000000 -2.3600000000000000, 57.3000000000000000 -2.1400000000000000, 61.3000000000000000 -1.5200000000000000, 65.5000000000000000 -1.3900000000000000, 69.6000000000000000 -1.1700000000000000, 73.6000000000000000 -1.0100000000000000, 77.9000000000000000 -0.9700000000000000, 82.0000000000000000 -0.8000000000000000, 86.2000000000000000 -0.7400000000000000, 90.2000000000000000 -0.6700000000000000, 94.5000000000000000 -0.6000000000000000, 98.6000000000000000 -0.5000000000000000, 102.6000000000000000 -0.3900000000000000, 106.9000000000000000 -0.2400000000000000, 111.1000000000000000 -0.1500000000000000, 115.1000000000000000 -0.1510000000000000, 119.2000000000000000 -0.1510000000000000, 123.1000000000000000 -0.0510000000000000, 127.2000000000000000 0.0590000000000000, 131.2000000000000000 0.2090000000000000, 132.2000000000000000 1.0250000000000000, 132.6000000000000000 2.6400000000000000, 132.6000000000000000 2.6400000000000000, 132.6000000000000000 0.5000000000000000, 128.6000000000000000 0.5000000000000000, 106.2000000000000000 -2.3000000000000000, 49.9000000000000000 -2.3000000000000000, 31.0000000000000000 -5.4500000000000000, 0.0000000000000000 -5.4500000000000000, 0.0000000000000000 -6.1026585365860800)}\r\n{LINEARRING (0.0000000000000000 2.6400000000000000, 0.0000000000000000 -6.0030697674418800, 0.3200000000000000 -5.9800000000000000, 4.6200000000000000 -5.6700000000000000, 8.8100000000000000 -5.1600000000000000, 13.1000000000000000 -5.2100000000000000, 17.1200000000000000 -4.8400000000000000, 21.2800000000000000 -5.1700000000000000, 25.5000000000000000 -5.1600000000000000, 29.7100000000000000 -4.6700000000000000, 34.1300000000000000 -3.9000000000000000, 38.2800000000000000 -3.4800000000000000, 42.6400000000000000 -3.3000000000000000, 46.9800000000000000 -3.2600000000000000, 51.1600000000000000 -2.8900000000000000, 55.3200000000000000 -2.8300000000000000, 59.3000000000000000 -2.9200000000000000, 63.6800000000000000 -2.3600000000000000, 67.4800000000000000 -2.5700000000000000, 70.8900000000000000 -2.4800000000000000, 74.8900000000000000 -2.5500000000000000, 78.8800000000000000 -2.6900000000000000, 82.4400000000000000 -2.4600000000000000, 87.5300000000000000 -2.8100000000000000, 91.6200000000000000 -2.7500000000000000, 95.9000000000000000 -2.1000000000000000, 100.2200000000000000 -2.2100000000000000, 104.4400000000000000 -2.3000000000000000, 109.1500000000000000 -1.9500000000000000, 113.2400000000000000 -2.8200000000000000, 117.2400000000000000 -1.9600000000000000, 120.9400000000000000 -1.3000000000000000, 125.0300000000000000 -0.8200000000000000, 126.6800000000000000 0.1300000000000000, 132.5500000000000000 1.5400000000000000, 132.6000000000000000 2.6400000000000000, 132.6000000000000000 2.6400000000000000, 132.6000000000000000 2.6400000000000000, 0.0000000000000000 2.6400000000000000)}\r\n2. invoke polygon's intersection function, will throw exception\r\n3. the exception stack & message: \r\nfound non-noded intersection between LINESTRING(3.8 -5.769, 7.9 -5.409) and LINESTRING(31 -5.45, 6.4274509803921562 -5.45) [ (7.4330555555555522, -5.45, NaN, NaN) ]\r\n\r\n在 NetTopologySuite.Operation.Overlay.Snap.SnapIfNeededOverlayOp.GetResultGeometry(SpatialFunction opCode)\r\n在 NetTopologySuite.Geometries.Geometry.Intersection(IGeometry other)\r\n在 Ware4u.Geomatics.Section.DotSpatialTest.Clip(GeoRegion region1, GeoRegion region2) 位置 C:\\Users\\hong\\Documents\\Visual Studio 2015\\Projects\\Ware4u.Geomatics\\Ware4u.Geomatics.Section\\DotSpatialTest.cs:行号 23\r\n\r\nDotSpatial version: 1.9\r\n\r\nExpected behaviour\r\n\r\nthe intersection of two polygon, may be one or more ploygons.\r\n\r\nActual behaviour\r\n\r\nthrow exception.\r\n\r\nnet framework 4.0,\r\nwin10 ent 64. \r\nvs2015,"},"comment":{"url":"https://api.github.com/repos/NetTopologySuite/NetTopologySuite/issues/comments/246179954","html_url":"https://github.com/NetTopologySuite/NetTopologySuite/issues/122#issuecomment-246179954","issue_url":"https://api.github.com/repos/NetTopologySuite/NetTopologySuite/issues/122","id":246179954,"user":{"login":"sendreams","id":4160051,"avatar_url":"https://avatars.githubusercontent.com/u/4160051?v=3","gravatar_id":"","url":"https://api.github.com/users/sendreams","html_url":"https://github.com/sendreams","followers_url":"https://api.github.com/users/sendreams/followers","following_url":"https://api.github.com/users/sendreams/following{/other_user}","gists_url":"https://api.github.com/users/sendreams/gists{/gist_id}","starred_url":"https://api.github.com/users/sendreams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sendreams/subscriptions","organizations_url":"https://api.github.com/users/sendreams/orgs","repos_url":"https://api.github.com/users/sendreams/repos","events_url":"https://api.github.com/users/sendreams/events{/privacy}","received_events_url":"https://api.github.com/users/sendreams/received_events","type":"User","site_admin":false},"created_at":"2016-09-11T13:20:33Z","updated_at":"2016-09-11T13:20:33Z","body":"@FObermaier  thank you very much for you reply, i'm a newer for NetTopologySuite, i use your simple data for test, but never successed. my test code is below, is any wrong?\r\nstring r1 = \"0.0000000000000000 -6.1026585365860800, 3.8000000000000000 -5.7690000000000000, 7.9000000000000000 -5.4090000000000000, 12.0000000000000000 -5.3690000000000000, 16.1000000000000000 -5.0990000000000000, 20.3000000000000000 -5.1390000000000000, 24.5000000000000000 -4.9090000000000000, 28.5000000000000000 -4.6390000000000000, 32.6000000000000000 -4.1890000000000000, 36.6000000000000000 -3.2890000000000000, 40.8000000000000000 -3.1890000000000000, 44.8000000000000000 -2.9490000000000000, 49.0000000000000000 -2.8200000000000000, 53.3000000000000000 -2.3600000000000000, 57.3000000000000000 -2.1400000000000000, 61.3000000000000000 -1.5200000000000000, 65.5000000000000000 -1.3900000000000000, 69.6000000000000000 -1.1700000000000000, 73.6000000000000000 -1.0100000000000000, 77.9000000000000000 -0.9700000000000000, 82.0000000000000000 -0.8000000000000000, 86.2000000000000000 -0.7400000000000000, 90.2000000000000000 -0.6700000000000000, 94.5000000000000000 -0.6000000000000000, 98.6000000000000000 -0.5000000000000000, 102.6000000000000000 -0.3900000000000000, 106.9000000000000000 -0.2400000000000000, 111.1000000000000000 -0.1500000000000000, 115.1000000000000000 -0.1510000000000000, 119.2000000000000000 -0.1510000000000000, 123.1000000000000000 -0.0510000000000000, 127.2000000000000000 0.0590000000000000, 131.2000000000000000 0.2090000000000000, 132.2000000000000000 1.0250000000000000, 132.6000000000000000 2.6400000000000000, 132.6000000000000000 2.6400000000000000, 132.6000000000000000 0.5000000000000000, 128.6000000000000000 0.5000000000000000, 106.2000000000000000 -2.3000000000000000, 49.9000000000000000 -2.3000000000000000, 31.0000000000000000 -5.4500000000000000, 0.0000000000000000 -5.4500000000000000, 0.0000000000000000 -6.10265853658608000\";\r\nPolygon region = NtsHelper.ParseFromString(r1);\r\nstring r2 = \"0.0000000000000000 2.6400000000000000, 0.0000000000000000 -6.0030697674418800, 0.3200000000000000 -5.9800000000000000, 4.6200000000000000 -5.6700000000000000, 8.8100000000000000 -5.1600000000000000, 13.1000000000000000 -5.2100000000000000, 17.1200000000000000 -4.8400000000000000, 21.2800000000000000 -5.1700000000000000, 25.5000000000000000 -5.1600000000000000, 29.7100000000000000 -4.6700000000000000, 34.1300000000000000 -3.9000000000000000, 38.2800000000000000 -3.4800000000000000, 42.6400000000000000 -3.3000000000000000, 46.9800000000000000 -3.2600000000000000, 51.1600000000000000 -2.8900000000000000, 55.3200000000000000 -2.8300000000000000, 59.3000000000000000 -2.9200000000000000, 63.6800000000000000 -2.3600000000000000, 67.4800000000000000 -2.5700000000000000, 70.8900000000000000 -2.4800000000000000, 74.8900000000000000 -2.5500000000000000, 78.8800000000000000 -2.6900000000000000, 82.4400000000000000 -2.4600000000000000, 87.5300000000000000 -2.8100000000000000, 91.6200000000000000 -2.7500000000000000, 95.9000000000000000 -2.1000000000000000, 100.2200000000000000 -2.2100000000000000, 104.4400000000000000 -2.3000000000000000, 109.1500000000000000 -1.9500000000000000, 113.2400000000000000 -2.8200000000000000, 117.2400000000000000 -1.9600000000000000, 120.9400000000000000 -1.3000000000000000, 125.0300000000000000 -0.8200000000000000, 126.6800000000000000 0.1300000000000000, 132.5500000000000000 1.5400000000000000, 132.6000000000000000 2.6400000000000000, 132.6000000000000000 2.6400000000000000, 132.6000000000000000 2.6400000000000000, 0.0000000000000000 2.6400000000000000\";\r\nPolygon clipRegion = NtsHelper.ParseFromString(r2);\r\nPolygon innerRegion = region.Intersection(clipRegion) as Polygon;   // this will throw exception.\r\n\r\n`public static Polygon ParseFromString(string str) {\r\n            string[] tmp = str.Split(',');\r\n            List<Coordinate> coords = new List<Coordinate>();\r\n            foreach (string item in tmp) {\r\n                string[] xy = item.Split(new string[] { \" \"}, StringSplitOptions.RemoveEmptyEntries);\r\n                coords.Add(new Coordinate(double.Parse(xy[0]), double.Parse(xy[1])));\r\n            }\r\n            LinearRing lr = new LinearRing(coords.ToArray());\r\n            return new Polygon(lr);\r\n        }`\r\n"}}
{"actor":{"display_login":"sendreams"}}