{"action":"created","comment":{"url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/pulls/comments/59891419","id":59891419,"diff_hunk":"@@ -56,13 +56,28 @@ def transform(shape, func):\n     raise ValueError('Unknown geometry type, \"%s\"' % shape.type)\n \n \n+def on_invalid_geometry_raise(shape):\n+    raise Exception('Invalid geometry: %s' % shape.wkt)\n+\n+\n+def on_invalid_geometry_ignore(shape):\n+    return None\n+\n+\n+def on_invalid_geometry_make_valid(shape):\n+    if shape.type in ('Polygon', 'MultiPolygon'):\n+        shape = shape.buffer(0)","path":"mapbox_vector_tile/encoder.py","position":14,"original_position":14,"commit_id":"6a1e8e0486e1be9da09fe2d1cbc3b33be30d911e","original_commit_id":"d1aaa2d72b1dd389b02b15d039b5b5e66474387a","user":{"login":"zerebubuth","id":271360,"avatar_url":"https://avatars.githubusercontent.com/u/271360?v=3","gravatar_id":"","url":"https://api.github.com/users/zerebubuth","html_url":"https://github.com/zerebubuth","followers_url":"https://api.github.com/users/zerebubuth/followers","following_url":"https://api.github.com/users/zerebubuth/following{/other_user}","gists_url":"https://api.github.com/users/zerebubuth/gists{/gist_id}","starred_url":"https://api.github.com/users/zerebubuth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zerebubuth/subscriptions","organizations_url":"https://api.github.com/users/zerebubuth/orgs","repos_url":"https://api.github.com/users/zerebubuth/repos","events_url":"https://api.github.com/users/zerebubuth/events{/privacy}","received_events_url":"https://api.github.com/users/zerebubuth/received_events","type":"User","site_admin":false},"body":"If I had to _guess_, I'd assume that it would preserve the winding order... But it's entirely possible that it doesn't, or resets it to the more usual clockwise. It probably doesn't stick to integer coordinates either. We should probably be taking the output and re-quantizing it, orienting it and re-checking its validity. :scream_cat:","created_at":"2016-04-15T15:21:50Z","updated_at":"2016-04-15T15:21:50Z","html_url":"https://github.com/mapzen/mapbox-vector-tile/pull/46#discussion_r59891419","pull_request_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/pulls/46","_links":{"self":{"href":"https://api.github.com/repos/mapzen/mapbox-vector-tile/pulls/comments/59891419"},"html":{"href":"https://github.com/mapzen/mapbox-vector-tile/pull/46#discussion_r59891419"},"pull_request":{"href":"https://api.github.com/repos/mapzen/mapbox-vector-tile/pulls/46"}}},"pull_request":{"url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/pulls/46","id":66546803,"html_url":"https://github.com/mapzen/mapbox-vector-tile/pull/46","diff_url":"https://github.com/mapzen/mapbox-vector-tile/pull/46.diff","patch_url":"https://github.com/mapzen/mapbox-vector-tile/pull/46.patch","issue_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/issues/46","number":46,"state":"open","locked":false,"title":"Add customizable invalid geometry handling","user":{"login":"rmarianski","id":53770,"avatar_url":"https://avatars.githubusercontent.com/u/53770?v=3","gravatar_id":"","url":"https://api.github.com/users/rmarianski","html_url":"https://github.com/rmarianski","followers_url":"https://api.github.com/users/rmarianski/followers","following_url":"https://api.github.com/users/rmarianski/following{/other_user}","gists_url":"https://api.github.com/users/rmarianski/gists{/gist_id}","starred_url":"https://api.github.com/users/rmarianski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rmarianski/subscriptions","organizations_url":"https://api.github.com/users/rmarianski/orgs","repos_url":"https://api.github.com/users/rmarianski/repos","events_url":"https://api.github.com/users/rmarianski/events{/privacy}","received_events_url":"https://api.github.com/users/rmarianski/received_events","type":"User","site_admin":false},"body":"Connects to https://github.com/mapzen/mapbox-vector-tile/issues/45\n\n@zerebubuth could you review please?","created_at":"2016-04-14T20:16:51Z","updated_at":"2016-04-15T15:21:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5dcce5bba7d47b8674a8e85104374283bb9fb364","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/pulls/46/commits","review_comments_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/pulls/46/comments","review_comment_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/issues/46/comments","statuses_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/statuses/6a1e8e0486e1be9da09fe2d1cbc3b33be30d911e","head":{"label":"mapzen:invalid-geometry-handling","ref":"invalid-geometry-handling","sha":"6a1e8e0486e1be9da09fe2d1cbc3b33be30d911e","user":{"login":"mapzen","id":5435747,"avatar_url":"https://avatars.githubusercontent.com/u/5435747?v=3","gravatar_id":"","url":"https://api.github.com/users/mapzen","html_url":"https://github.com/mapzen","followers_url":"https://api.github.com/users/mapzen/followers","following_url":"https://api.github.com/users/mapzen/following{/other_user}","gists_url":"https://api.github.com/users/mapzen/gists{/gist_id}","starred_url":"https://api.github.com/users/mapzen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapzen/subscriptions","organizations_url":"https://api.github.com/users/mapzen/orgs","repos_url":"https://api.github.com/users/mapzen/repos","events_url":"https://api.github.com/users/mapzen/events{/privacy}","received_events_url":"https://api.github.com/users/mapzen/received_events","type":"Organization","site_admin":false},"repo":{"id":26827282,"name":"mapbox-vector-tile","full_name":"mapzen/mapbox-vector-tile","owner":{"login":"mapzen","id":5435747,"avatar_url":"https://avatars.githubusercontent.com/u/5435747?v=3","gravatar_id":"","url":"https://api.github.com/users/mapzen","html_url":"https://github.com/mapzen","followers_url":"https://api.github.com/users/mapzen/followers","following_url":"https://api.github.com/users/mapzen/following{/other_user}","gists_url":"https://api.github.com/users/mapzen/gists{/gist_id}","starred_url":"https://api.github.com/users/mapzen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapzen/subscriptions","organizations_url":"https://api.github.com/users/mapzen/orgs","repos_url":"https://api.github.com/users/mapzen/repos","events_url":"https://api.github.com/users/mapzen/events{/privacy}","received_events_url":"https://api.github.com/users/mapzen/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapzen/mapbox-vector-tile","description":"Python package for encoding & decoding Mapbox Vector Tiles","fork":false,"url":"https://api.github.com/repos/mapzen/mapbox-vector-tile","forks_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/forks","keys_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/teams","hooks_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/hooks","issue_events_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/issues/events{/number}","events_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/events","assignees_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/assignees{/user}","branches_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/branches{/branch}","tags_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/tags","blobs_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/statuses/{sha}","languages_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/languages","stargazers_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/stargazers","contributors_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/contributors","subscribers_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/subscribers","subscription_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/subscription","commits_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/contents/{+path}","compare_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/merges","archive_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/downloads","issues_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/issues{/number}","pulls_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/pulls{/number}","milestones_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/milestones{/number}","notifications_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/labels{/name}","releases_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/releases{/id}","deployments_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/deployments","created_at":"2014-11-18T19:57:49Z","updated_at":"2016-03-29T07:40:07Z","pushed_at":"2016-04-15T15:03:25Z","git_url":"git://github.com/mapzen/mapbox-vector-tile.git","ssh_url":"git@github.com:mapzen/mapbox-vector-tile.git","clone_url":"https://github.com/mapzen/mapbox-vector-tile.git","svn_url":"https://github.com/mapzen/mapbox-vector-tile","homepage":"","size":264,"stargazers_count":36,"watchers_count":36,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":6,"forks":14,"open_issues":6,"watchers":36,"default_branch":"master"}},"base":{"label":"mapzen:master","ref":"master","sha":"773dbfdc38e75ab08f572f6a1c5fc321007dc252","user":{"login":"mapzen","id":5435747,"avatar_url":"https://avatars.githubusercontent.com/u/5435747?v=3","gravatar_id":"","url":"https://api.github.com/users/mapzen","html_url":"https://github.com/mapzen","followers_url":"https://api.github.com/users/mapzen/followers","following_url":"https://api.github.com/users/mapzen/following{/other_user}","gists_url":"https://api.github.com/users/mapzen/gists{/gist_id}","starred_url":"https://api.github.com/users/mapzen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapzen/subscriptions","organizations_url":"https://api.github.com/users/mapzen/orgs","repos_url":"https://api.github.com/users/mapzen/repos","events_url":"https://api.github.com/users/mapzen/events{/privacy}","received_events_url":"https://api.github.com/users/mapzen/received_events","type":"Organization","site_admin":false},"repo":{"id":26827282,"name":"mapbox-vector-tile","full_name":"mapzen/mapbox-vector-tile","owner":{"login":"mapzen","id":5435747,"avatar_url":"https://avatars.githubusercontent.com/u/5435747?v=3","gravatar_id":"","url":"https://api.github.com/users/mapzen","html_url":"https://github.com/mapzen","followers_url":"https://api.github.com/users/mapzen/followers","following_url":"https://api.github.com/users/mapzen/following{/other_user}","gists_url":"https://api.github.com/users/mapzen/gists{/gist_id}","starred_url":"https://api.github.com/users/mapzen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapzen/subscriptions","organizations_url":"https://api.github.com/users/mapzen/orgs","repos_url":"https://api.github.com/users/mapzen/repos","events_url":"https://api.github.com/users/mapzen/events{/privacy}","received_events_url":"https://api.github.com/users/mapzen/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapzen/mapbox-vector-tile","description":"Python package for encoding & decoding Mapbox Vector Tiles","fork":false,"url":"https://api.github.com/repos/mapzen/mapbox-vector-tile","forks_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/forks","keys_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/teams","hooks_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/hooks","issue_events_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/issues/events{/number}","events_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/events","assignees_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/assignees{/user}","branches_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/branches{/branch}","tags_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/tags","blobs_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/statuses/{sha}","languages_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/languages","stargazers_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/stargazers","contributors_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/contributors","subscribers_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/subscribers","subscription_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/subscription","commits_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/contents/{+path}","compare_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/merges","archive_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/downloads","issues_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/issues{/number}","pulls_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/pulls{/number}","milestones_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/milestones{/number}","notifications_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/labels{/name}","releases_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/releases{/id}","deployments_url":"https://api.github.com/repos/mapzen/mapbox-vector-tile/deployments","created_at":"2014-11-18T19:57:49Z","updated_at":"2016-03-29T07:40:07Z","pushed_at":"2016-04-15T15:03:25Z","git_url":"git://github.com/mapzen/mapbox-vector-tile.git","ssh_url":"git@github.com:mapzen/mapbox-vector-tile.git","clone_url":"https://github.com/mapzen/mapbox-vector-tile.git","svn_url":"https://github.com/mapzen/mapbox-vector-tile","homepage":"","size":264,"stargazers_count":36,"watchers_count":36,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":6,"forks":14,"open_issues":6,"watchers":36,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapzen/mapbox-vector-tile/pulls/46"},"html":{"href":"https://github.com/mapzen/mapbox-vector-tile/pull/46"},"issue":{"href":"https://api.github.com/repos/mapzen/mapbox-vector-tile/issues/46"},"comments":{"href":"https://api.github.com/repos/mapzen/mapbox-vector-tile/issues/46/comments"},"review_comments":{"href":"https://api.github.com/repos/mapzen/mapbox-vector-tile/pulls/46/comments"},"review_comment":{"href":"https://api.github.com/repos/mapzen/mapbox-vector-tile/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapzen/mapbox-vector-tile/pulls/46/commits"},"statuses":{"href":"https://api.github.com/repos/mapzen/mapbox-vector-tile/statuses/6a1e8e0486e1be9da09fe2d1cbc3b33be30d911e"}}}}