{"action":"opened","issue":{"url":"https://api.github.com/repos/NetTopologySuite/NetTopologySuite/issues/263","repository_url":"https://api.github.com/repos/NetTopologySuite/NetTopologySuite","labels_url":"https://api.github.com/repos/NetTopologySuite/NetTopologySuite/issues/263/labels{/name}","comments_url":"https://api.github.com/repos/NetTopologySuite/NetTopologySuite/issues/263/comments","events_url":"https://api.github.com/repos/NetTopologySuite/NetTopologySuite/issues/263/events","html_url":"https://github.com/NetTopologySuite/NetTopologySuite/issues/263","id":367843164,"node_id":"MDU6SXNzdWUzNjc4NDMxNjQ=","number":263,"title":"Faster area of intersection computation?","user":{"login":"mj1856","id":1396388,"node_id":"MDQ6VXNlcjEzOTYzODg=","avatar_url":"https://avatars1.githubusercontent.com/u/1396388?v=4","gravatar_id":"","url":"https://api.github.com/users/mj1856","html_url":"https://github.com/mj1856","followers_url":"https://api.github.com/users/mj1856/followers","following_url":"https://api.github.com/users/mj1856/following{/other_user}","gists_url":"https://api.github.com/users/mj1856/gists{/gist_id}","starred_url":"https://api.github.com/users/mj1856/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mj1856/subscriptions","organizations_url":"https://api.github.com/users/mj1856/orgs","repos_url":"https://api.github.com/users/mj1856/repos","events_url":"https://api.github.com/users/mj1856/events{/privacy}","received_events_url":"https://api.github.com/users/mj1856/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-08T15:28:24Z","updated_at":"2018-10-08T15:28:24Z","closed_at":null,"author_association":"NONE","body":"Hi.  In my code, I need to determine the area of a geometry that intersects an envelope.  I do this with:\r\n\r\n```csharp\r\ndouble area = feature.Geometry.Intersection(envelope).Area;\r\n```\r\n\r\nIt works fine, but I have several hundred thousand iterations to perform, and this is where the CPU is spending the vast majority of its time.  I've decreased total run time by using all cores in parallel, via `Parallel.ForEach` in the function that calls this, but it is still super slow at scale.\r\n\r\nElsewhere in my code, I had a call to `geometry.Intersects(envelope)` that was also expensive, until I started using `PreparedGeometry.Intersects` instead.  That made a huge perf difference.  Unfortunately, there doesn't seem to be anything on `PreparedGeometry` that would help with area of intersection.\r\n\r\nI don't actually need the geometry created by the intersection - I only need to know the area that intersects.  Is there any faster API I should be using for this?  Or perhaps there's some technique to apply ahead of time that would make this operation go faster in general?\r\n\r\nI tried simplifying the geometries first, but it didn't seem to help.  The simplification was also expensive, and the computed areas were too different to be useful to me.\r\n\r\nAny ideas would be greatly appreciated.  Thanks. "}}
{"actor":{"display_login":"mj1856"}}