{"action":"closed","number":338,"pull_request":{"url":"https://api.github.com/repos/geopandas/geopandas/pulls/338","id":72787540,"node_id":"MDExOlB1bGxSZXF1ZXN0NzI3ODc1NDA=","html_url":"https://github.com/geopandas/geopandas/pull/338","diff_url":"https://github.com/geopandas/geopandas/pull/338.diff","patch_url":"https://github.com/geopandas/geopandas/pull/338.patch","issue_url":"https://api.github.com/repos/geopandas/geopandas/issues/338","number":338,"state":"closed","locked":false,"title":"PERF: improve overlay performance","user":{"login":"jorisvandenbossche","id":1020496,"node_id":"MDQ6VXNlcjEwMjA0OTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1020496?v=4","gravatar_id":"","url":"https://api.github.com/users/jorisvandenbossche","html_url":"https://github.com/jorisvandenbossche","followers_url":"https://api.github.com/users/jorisvandenbossche/followers","following_url":"https://api.github.com/users/jorisvandenbossche/following{/other_user}","gists_url":"https://api.github.com/users/jorisvandenbossche/gists{/gist_id}","starred_url":"https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorisvandenbossche/subscriptions","organizations_url":"https://api.github.com/users/jorisvandenbossche/orgs","repos_url":"https://api.github.com/users/jorisvandenbossche/repos","events_url":"https://api.github.com/users/jorisvandenbossche/events{/privacy}","received_events_url":"https://api.github.com/users/jorisvandenbossche/received_events","type":"User","site_admin":false},"body":"This improves the performance of the overlay on the countries/capitals dataset from 25.9 s to 12.5 s on my computer.\n\nI did not change the logic of the implementation (looking at that could maybe also give some additional performance reduction opportunities), but just optimized the current logic, including:\n- not concatting inside the for loop, but collecting the row labels and concatting once after the for loop\n- using `iat` instead of `ix`\n\nTested with (example from the docs):\n\n```\nimport geopandas as gpd\nworld = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))\ncapitals = gpd.read_file(gpd.datasets.get_path('naturalearth_cities'))\ncountries = world[['geometry', 'name']]\ncountries = countries.to_crs('+init=epsg:3395')[countries.name!=\"Antarctica\"]\ncapitals = capitals.to_crs('+init=epsg:3395')\ncapitals['geometry']= capitals.buffer(500000)\n\ngpd.overlay(countries, capitals, how='intersection')\n```\n\nTODO:\n- [ ] add some more tests (including tests for dataframes with non default (0,1,2, ...) row indices)\n","created_at":"2016-06-06T22:17:13Z","updated_at":"2018-07-15T19:45:45Z","closed_at":"2018-07-15T19:45:45Z","merged_at":null,"merge_commit_sha":"8a3df022028e86ab17af992948394b4351141e49","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":900724808,"node_id":"MDU6TGFiZWw5MDA3MjQ4MDg=","url":"https://api.github.com/repos/geopandas/geopandas/labels/ops:overlay","name":"ops:overlay","color":"bfdadc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/geopandas/geopandas/pulls/338/commits","review_comments_url":"https://api.github.com/repos/geopandas/geopandas/pulls/338/comments","review_comment_url":"https://api.github.com/repos/geopandas/geopandas/pulls/comments{/number}","comments_url":"https://api.github.com/repos/geopandas/geopandas/issues/338/comments","statuses_url":"https://api.github.com/repos/geopandas/geopandas/statuses/ab0a8064c2792934a862e87fc7a7bc18063aff02","head":{"label":"jorisvandenbossche:perf-overlay","ref":"perf-overlay","sha":"ab0a8064c2792934a862e87fc7a7bc18063aff02","user":{"login":"jorisvandenbossche","id":1020496,"node_id":"MDQ6VXNlcjEwMjA0OTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1020496?v=4","gravatar_id":"","url":"https://api.github.com/users/jorisvandenbossche","html_url":"https://github.com/jorisvandenbossche","followers_url":"https://api.github.com/users/jorisvandenbossche/followers","following_url":"https://api.github.com/users/jorisvandenbossche/following{/other_user}","gists_url":"https://api.github.com/users/jorisvandenbossche/gists{/gist_id}","starred_url":"https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorisvandenbossche/subscriptions","organizations_url":"https://api.github.com/users/jorisvandenbossche/orgs","repos_url":"https://api.github.com/users/jorisvandenbossche/repos","events_url":"https://api.github.com/users/jorisvandenbossche/events{/privacy}","received_events_url":"https://api.github.com/users/jorisvandenbossche/received_events","type":"User","site_admin":false},"repo":{"id":33037020,"node_id":"MDEwOlJlcG9zaXRvcnkzMzAzNzAyMA==","name":"geopandas","full_name":"jorisvandenbossche/geopandas","owner":{"login":"jorisvandenbossche","id":1020496,"node_id":"MDQ6VXNlcjEwMjA0OTY=","avatar_url":"https://avatars2.githubusercontent.com/u/1020496?v=4","gravatar_id":"","url":"https://api.github.com/users/jorisvandenbossche","html_url":"https://github.com/jorisvandenbossche","followers_url":"https://api.github.com/users/jorisvandenbossche/followers","following_url":"https://api.github.com/users/jorisvandenbossche/following{/other_user}","gists_url":"https://api.github.com/users/jorisvandenbossche/gists{/gist_id}","starred_url":"https://api.github.com/users/jorisvandenbossche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jorisvandenbossche/subscriptions","organizations_url":"https://api.github.com/users/jorisvandenbossche/orgs","repos_url":"https://api.github.com/users/jorisvandenbossche/repos","events_url":"https://api.github.com/users/jorisvandenbossche/events{/privacy}","received_events_url":"https://api.github.com/users/jorisvandenbossche/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jorisvandenbossche/geopandas","description":"Python tools for geographic data","fork":true,"url":"https://api.github.com/repos/jorisvandenbossche/geopandas","forks_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/forks","keys_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/teams","hooks_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/hooks","issue_events_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/issues/events{/number}","events_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/events","assignees_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/assignees{/user}","branches_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/branches{/branch}","tags_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/tags","blobs_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/git/refs{/sha}","trees_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/statuses/{sha}","languages_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/languages","stargazers_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/stargazers","contributors_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/contributors","subscribers_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/subscribers","subscription_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/subscription","commits_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/commits{/sha}","git_commits_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/git/commits{/sha}","comments_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/comments{/number}","issue_comment_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/issues/comments{/number}","contents_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/contents/{+path}","compare_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/merges","archive_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/downloads","issues_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/issues{/number}","pulls_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/pulls{/number}","milestones_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/milestones{/number}","notifications_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/labels{/name}","releases_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/releases{/id}","deployments_url":"https://api.github.com/repos/jorisvandenbossche/geopandas/deployments","created_at":"2015-03-28T14:51:20Z","updated_at":"2016-05-31T10:20:16Z","pushed_at":"2018-07-15T19:37:34Z","git_url":"git://github.com/jorisvandenbossche/geopandas.git","ssh_url":"git@github.com:jorisvandenbossche/geopandas.git","clone_url":"https://github.com/jorisvandenbossche/geopandas.git","svn_url":"https://github.com/jorisvandenbossche/geopandas","homepage":"","size":5483,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"geopandas:master","ref":"master","sha":"752ab5ddb703eaf6cc8148ea7d588f1ee4499325","user":{"login":"geopandas","id":8130715,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxMzA3MTU=","avatar_url":"https://avatars2.githubusercontent.com/u/8130715?v=4","gravatar_id":"","url":"https://api.github.com/users/geopandas","html_url":"https://github.com/geopandas","followers_url":"https://api.github.com/users/geopandas/followers","following_url":"https://api.github.com/users/geopandas/following{/other_user}","gists_url":"https://api.github.com/users/geopandas/gists{/gist_id}","starred_url":"https://api.github.com/users/geopandas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geopandas/subscriptions","organizations_url":"https://api.github.com/users/geopandas/orgs","repos_url":"https://api.github.com/users/geopandas/repos","events_url":"https://api.github.com/users/geopandas/events{/privacy}","received_events_url":"https://api.github.com/users/geopandas/received_events","type":"Organization","site_admin":false},"repo":{"id":11002815,"node_id":"MDEwOlJlcG9zaXRvcnkxMTAwMjgxNQ==","name":"geopandas","full_name":"geopandas/geopandas","owner":{"login":"geopandas","id":8130715,"node_id":"MDEyOk9yZ2FuaXphdGlvbjgxMzA3MTU=","avatar_url":"https://avatars2.githubusercontent.com/u/8130715?v=4","gravatar_id":"","url":"https://api.github.com/users/geopandas","html_url":"https://github.com/geopandas","followers_url":"https://api.github.com/users/geopandas/followers","following_url":"https://api.github.com/users/geopandas/following{/other_user}","gists_url":"https://api.github.com/users/geopandas/gists{/gist_id}","starred_url":"https://api.github.com/users/geopandas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geopandas/subscriptions","organizations_url":"https://api.github.com/users/geopandas/orgs","repos_url":"https://api.github.com/users/geopandas/repos","events_url":"https://api.github.com/users/geopandas/events{/privacy}","received_events_url":"https://api.github.com/users/geopandas/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geopandas/geopandas","description":"Python tools for geographic data","fork":false,"url":"https://api.github.com/repos/geopandas/geopandas","forks_url":"https://api.github.com/repos/geopandas/geopandas/forks","keys_url":"https://api.github.com/repos/geopandas/geopandas/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geopandas/geopandas/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geopandas/geopandas/teams","hooks_url":"https://api.github.com/repos/geopandas/geopandas/hooks","issue_events_url":"https://api.github.com/repos/geopandas/geopandas/issues/events{/number}","events_url":"https://api.github.com/repos/geopandas/geopandas/events","assignees_url":"https://api.github.com/repos/geopandas/geopandas/assignees{/user}","branches_url":"https://api.github.com/repos/geopandas/geopandas/branches{/branch}","tags_url":"https://api.github.com/repos/geopandas/geopandas/tags","blobs_url":"https://api.github.com/repos/geopandas/geopandas/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geopandas/geopandas/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geopandas/geopandas/git/refs{/sha}","trees_url":"https://api.github.com/repos/geopandas/geopandas/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geopandas/geopandas/statuses/{sha}","languages_url":"https://api.github.com/repos/geopandas/geopandas/languages","stargazers_url":"https://api.github.com/repos/geopandas/geopandas/stargazers","contributors_url":"https://api.github.com/repos/geopandas/geopandas/contributors","subscribers_url":"https://api.github.com/repos/geopandas/geopandas/subscribers","subscription_url":"https://api.github.com/repos/geopandas/geopandas/subscription","commits_url":"https://api.github.com/repos/geopandas/geopandas/commits{/sha}","git_commits_url":"https://api.github.com/repos/geopandas/geopandas/git/commits{/sha}","comments_url":"https://api.github.com/repos/geopandas/geopandas/comments{/number}","issue_comment_url":"https://api.github.com/repos/geopandas/geopandas/issues/comments{/number}","contents_url":"https://api.github.com/repos/geopandas/geopandas/contents/{+path}","compare_url":"https://api.github.com/repos/geopandas/geopandas/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geopandas/geopandas/merges","archive_url":"https://api.github.com/repos/geopandas/geopandas/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geopandas/geopandas/downloads","issues_url":"https://api.github.com/repos/geopandas/geopandas/issues{/number}","pulls_url":"https://api.github.com/repos/geopandas/geopandas/pulls{/number}","milestones_url":"https://api.github.com/repos/geopandas/geopandas/milestones{/number}","notifications_url":"https://api.github.com/repos/geopandas/geopandas/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geopandas/geopandas/labels{/name}","releases_url":"https://api.github.com/repos/geopandas/geopandas/releases{/id}","deployments_url":"https://api.github.com/repos/geopandas/geopandas/deployments","created_at":"2013-06-27T17:03:47Z","updated_at":"2018-07-15T18:46:22Z","pushed_at":"2018-07-15T19:45:45Z","git_url":"git://github.com/geopandas/geopandas.git","ssh_url":"git@github.com:geopandas/geopandas.git","clone_url":"https://github.com/geopandas/geopandas.git","svn_url":"https://github.com/geopandas/geopandas","homepage":"http://geopandas.readthedocs.io/","size":9076,"stargazers_count":1157,"watchers_count":1157,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":249,"mirror_url":null,"archived":false,"open_issues_count":166,"license":{"key":"bsd-3-clause","name":"BSD 3-Clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause","node_id":"MDc6TGljZW5zZTU="},"forks":249,"open_issues":166,"watchers":1157,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/geopandas/geopandas/pulls/338"},"html":{"href":"https://github.com/geopandas/geopandas/pull/338"},"issue":{"href":"https://api.github.com/repos/geopandas/geopandas/issues/338"},"comments":{"href":"https://api.github.com/repos/geopandas/geopandas/issues/338/comments"},"review_comments":{"href":"https://api.github.com/repos/geopandas/geopandas/pulls/338/comments"},"review_comment":{"href":"https://api.github.com/repos/geopandas/geopandas/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/geopandas/geopandas/pulls/338/commits"},"statuses":{"href":"https://api.github.com/repos/geopandas/geopandas/statuses/ab0a8064c2792934a862e87fc7a7bc18063aff02"}},"author_association":"MEMBER","merged":false,"mergeable":false,"rebaseable":false,"mergeable_state":"dirty","merged_by":null,"comments":20,"review_comments":0,"maintainer_can_modify":false,"commits":1,"additions":22,"deletions":29,"changed_files":1}}
{"actor":{"display_login":"jorisvandenbossche"}}