{"action":"created","issue":{"url":"https://api.github.com/repos/OsmSharp/core/issues/51","repository_url":"https://api.github.com/repos/OsmSharp/core","labels_url":"https://api.github.com/repos/OsmSharp/core/issues/51/labels{/name}","comments_url":"https://api.github.com/repos/OsmSharp/core/issues/51/comments","events_url":"https://api.github.com/repos/OsmSharp/core/issues/51/events","html_url":"https://github.com/OsmSharp/core/issues/51","id":315853245,"number":51,"title":"LinearRing creating failed when the number of coordinates equals 3 in DefaultFeatureInterpreter","user":{"login":"ComMouse","id":9015818,"avatar_url":"https://avatars2.githubusercontent.com/u/9015818?v=4","gravatar_id":"","url":"https://api.github.com/users/ComMouse","html_url":"https://github.com/ComMouse","followers_url":"https://api.github.com/users/ComMouse/followers","following_url":"https://api.github.com/users/ComMouse/following{/other_user}","gists_url":"https://api.github.com/users/ComMouse/gists{/gist_id}","starred_url":"https://api.github.com/users/ComMouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ComMouse/subscriptions","organizations_url":"https://api.github.com/users/ComMouse/orgs","repos_url":"https://api.github.com/users/ComMouse/repos","events_url":"https://api.github.com/users/ComMouse/events{/privacy}","received_events_url":"https://api.github.com/users/ComMouse/received_events","type":"User","site_admin":false},"labels":[{"id":252555267,"url":"https://api.github.com/repos/OsmSharp/core/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":{"login":"xivk","id":1128068,"avatar_url":"https://avatars2.githubusercontent.com/u/1128068?v=4","gravatar_id":"","url":"https://api.github.com/users/xivk","html_url":"https://github.com/xivk","followers_url":"https://api.github.com/users/xivk/followers","following_url":"https://api.github.com/users/xivk/following{/other_user}","gists_url":"https://api.github.com/users/xivk/gists{/gist_id}","starred_url":"https://api.github.com/users/xivk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xivk/subscriptions","organizations_url":"https://api.github.com/users/xivk/orgs","repos_url":"https://api.github.com/users/xivk/repos","events_url":"https://api.github.com/users/xivk/events{/privacy}","received_events_url":"https://api.github.com/users/xivk/received_events","type":"User","site_admin":false},"assignees":[{"login":"xivk","id":1128068,"avatar_url":"https://avatars2.githubusercontent.com/u/1128068?v=4","gravatar_id":"","url":"https://api.github.com/users/xivk","html_url":"https://github.com/xivk","followers_url":"https://api.github.com/users/xivk/followers","following_url":"https://api.github.com/users/xivk/following{/other_user}","gists_url":"https://api.github.com/users/xivk/gists{/gist_id}","starred_url":"https://api.github.com/users/xivk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xivk/subscriptions","organizations_url":"https://api.github.com/users/xivk/orgs","repos_url":"https://api.github.com/users/xivk/repos","events_url":"https://api.github.com/users/xivk/events{/privacy}","received_events_url":"https://api.github.com/users/xivk/received_events","type":"User","site_admin":false}],"milestone":null,"comments":0,"created_at":"2018-04-19T12:22:30Z","updated_at":"2018-04-19T17:06:55Z","closed_at":null,"author_association":"NONE","body":"I'm using OsmSharp in one project and trying to extract FeatureSource from `.osm` files (similar to the __GeometryStream__ sample). In some cases I have got the following exception when running the  `ToFeatureSource()` method:\r\n\r\n```\r\nSystem.ArgumentException: Number of points must be 0 or >3\r\n  at NetTopologySuite.Geometries.LinearRing.ValidateConstruction () [0x00037] in <88415ec09cd24df3957abfca9e43fb89>:0 \r\n  at NetTopologySuite.Geometries.LinearRing..ctor (GeoAPI.Geometries.ICoordinateSequence points, GeoAPI.Geometries.IGeometryFactory factory) [0x00008] in <88415ec09cd24df3957abfca9e43fb89>:0 \r\n  at NetTopologySuite.Geometries.LinearRing..ctor (GeoAPI.Geometries.Coordinate[] points) [0x00011] in <88415ec09cd24df3957abfca9e43fb89>:0 \r\n  at OsmSharp.Geo.DefaultFeatureInterpreter.Interpret (OsmSharp.Complete.ICompleteOsmGeo osmObject) [0x00401] in D:\\Projects\\OsmSharp\\core\\src\\OsmSharp.Geo\\DefaultFeatureInterpreter.cs:129 \r\n  at OsmSharp.Geo.Streams.Features.Interpreted.InterpretedFeatureStreamSource.MoveNext () [0x0005e] in D:\\Projects\\OsmSharp\\core\\src\\OsmSharp.Geo\\Streams\\Features\\Interpreted\\InterpretedFeatureStreamSource.cs:163 \r\n```\r\n\r\nWhen I checked the constructor of `LinearRing` ([code here](https://github.com/NetTopologySuite/NetTopologySuite/blob/543b56b20c8c83df9d7ae12cf2ac3a15590c349f/NetTopologySuite/Geometries/LinearRing.cs#L55)), I found that `LinearRing` had set a limit of at least 4 points to create a ring. However, the [code](https://github.com/OsmSharp/core/blob/e951c41f824aa4dc3afd79538ae29f3c1edf627a/src/OsmSharp.Geo/DefaultFeatureInterpreter.cs#L120) in `DefaultFeatureInterpreter` only checks whether the number of coordinates is less than 3, which causes this exception.\r\n\r\nIf this is a bug, please help fix this problem. Thank you."},"comment":{"url":"https://api.github.com/repos/OsmSharp/core/issues/comments/382810664","html_url":"https://github.com/OsmSharp/core/issues/51#issuecomment-382810664","issue_url":"https://api.github.com/repos/OsmSharp/core/issues/51","id":382810664,"user":{"login":"xivk","id":1128068,"avatar_url":"https://avatars2.githubusercontent.com/u/1128068?v=4","gravatar_id":"","url":"https://api.github.com/users/xivk","html_url":"https://github.com/xivk","followers_url":"https://api.github.com/users/xivk/followers","following_url":"https://api.github.com/users/xivk/following{/other_user}","gists_url":"https://api.github.com/users/xivk/gists{/gist_id}","starred_url":"https://api.github.com/users/xivk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xivk/subscriptions","organizations_url":"https://api.github.com/users/xivk/orgs","repos_url":"https://api.github.com/users/xivk/repos","events_url":"https://api.github.com/users/xivk/events{/privacy}","received_events_url":"https://api.github.com/users/xivk/received_events","type":"User","site_admin":false},"created_at":"2018-04-19T17:06:55Z","updated_at":"2018-04-19T17:06:55Z","author_association":"CONTRIBUTOR","body":"I think this is a bug, in a ring the first coordinate should always equal the first. The means a rectangle, the smallest possible ring, has to have at least 4 coordinates. The same is valid in OSM, that 3 should be a 4.\r\n\r\nThat being said, building geometries, especially areas can be very complex based on OSM. The code here is just by example and should probably be move elsewhere or we need to find someone to properly maintain it."}}
{"actor":{"display_login":"xivk"}}