{"action":"created","comment":{"url":"https://api.github.com/repos/agrc/wri-web/pulls/comments/39434223","id":39434223,"diff_hunk":"@@ -0,0 +1,90 @@\n+#!/usr/bin/env python\n+# -*- coding: utf-8 -*-\n+\n+'''\n+zipToGraphics\n+----------------------------------\n+Given a .zip file with a shapefile it validates and then returns the feature as a graphic\n+'''\n+from zipfile import ZipFile\n+from os.path import join\n+import arcpy\n+\n+\n+required_files = ['shp', 'dbf', 'prj', 'shx']\n+wgs = arcpy.SpatialReference(3857)\n+\n+multiple_warning = 'warning:Multiple features were found in the uploaded shapefile but only the first was returned.'\n+categories = {\n+    'Terrestrial Treatment Area': ['Polygon'],\n+    'Aquatic/Riparian Treatment Area': ['Polygon'],\n+    'Affected Area': ['Polygon'],\n+    'Easement/Acquisition': ['Polygon'],\n+    'Guzzler': ['Point', 'Multipoint'],\n+    'Trough': ['Point', 'Multipoint'],\n+    'Water control structure': ['Point', 'Multipoint'],\n+    'Other point feature': ['Point', 'Multipoint'],\n+    'Fish passage structure': ['Point', 'Multipoint'],\n+    'Fence': ['Polyline'],\n+    'Pipeline': ['Polyline'],\n+    'Dam': ['Polyline'],\n+    'Research': ['Polygon']\n+}\n+\n+def main(zfilepath, category):\n+    messages = []\n+\n+    # open zip file and get paths\n+    zfile = ZipFile(zfilepath)\n+    zfilenames = zfile.namelist()\n+    zfile_exts = [name.split('.')[1] for name in zfilenames]\n+    zfile_name = zfilenames[0].split('.')[0]","path":"scripts/ZipToGraphics/zipToGraphics.py","position":41,"original_position":41,"commit_id":"4314cc89b8c48b4c3e6de432213a94d8f74a4d21","original_commit_id":"925f725cccef8c0b3771d5b5075e21ed273d0270","user":{"login":"stdavis","id":1326248,"avatar_url":"https://avatars.githubusercontent.com/u/1326248?v=3","gravatar_id":"","url":"https://api.github.com/users/stdavis","html_url":"https://github.com/stdavis","followers_url":"https://api.github.com/users/stdavis/followers","following_url":"https://api.github.com/users/stdavis/following{/other_user}","gists_url":"https://api.github.com/users/stdavis/gists{/gist_id}","starred_url":"https://api.github.com/users/stdavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stdavis/subscriptions","organizations_url":"https://api.github.com/users/stdavis/orgs","repos_url":"https://api.github.com/users/stdavis/repos","events_url":"https://api.github.com/users/stdavis/events{/privacy}","received_events_url":"https://api.github.com/users/stdavis/received_events","type":"User","site_admin":false},"body":"Noted. I will use that in the future.","created_at":"2015-09-14T19:12:09Z","updated_at":"2015-09-14T19:12:09Z","html_url":"https://github.com/agrc/wri-web/pull/98#discussion_r39434223","pull_request_url":"https://api.github.com/repos/agrc/wri-web/pulls/98","_links":{"self":{"href":"https://api.github.com/repos/agrc/wri-web/pulls/comments/39434223"},"html":{"href":"https://github.com/agrc/wri-web/pull/98#discussion_r39434223"},"pull_request":{"href":"https://api.github.com/repos/agrc/wri-web/pulls/98"}}},"pull_request":{"url":"https://api.github.com/repos/agrc/wri-web/pulls/98","id":44486623,"html_url":"https://github.com/agrc/wri-web/pull/98","diff_url":"https://github.com/agrc/wri-web/pull/98.diff","patch_url":"https://github.com/agrc/wri-web/pull/98.patch","issue_url":"https://api.github.com/repos/agrc/wri-web/issues/98","number":98,"state":"open","locked":false,"title":"New feature: shapefile upload","user":{"login":"stdavis","id":1326248,"avatar_url":"https://avatars.githubusercontent.com/u/1326248?v=3","gravatar_id":"","url":"https://api.github.com/users/stdavis","html_url":"https://github.com/stdavis","followers_url":"https://api.github.com/users/stdavis/followers","following_url":"https://api.github.com/users/stdavis/following{/other_user}","gists_url":"https://api.github.com/users/stdavis/gists{/gist_id}","starred_url":"https://api.github.com/users/stdavis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stdavis/subscriptions","organizations_url":"https://api.github.com/users/stdavis/orgs","repos_url":"https://api.github.com/users/stdavis/repos","events_url":"https://api.github.com/users/stdavis/events{/privacy}","received_events_url":"https://api.github.com/users/stdavis/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-09-08T21:41:14Z","updated_at":"2015-09-14T19:12:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b41248442e410f218a9ce82009835c20504dfcce","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/agrc/wri-web/pulls/98/commits","review_comments_url":"https://api.github.com/repos/agrc/wri-web/pulls/98/comments","review_comment_url":"https://api.github.com/repos/agrc/wri-web/pulls/comments{/number}","comments_url":"https://api.github.com/repos/agrc/wri-web/issues/98/comments","statuses_url":"https://api.github.com/repos/agrc/wri-web/statuses/4314cc89b8c48b4c3e6de432213a94d8f74a4d21","head":{"label":"agrc:new-features","ref":"new-features","sha":"4314cc89b8c48b4c3e6de432213a94d8f74a4d21","user":{"login":"agrc","id":709415,"avatar_url":"https://avatars.githubusercontent.com/u/709415?v=3","gravatar_id":"","url":"https://api.github.com/users/agrc","html_url":"https://github.com/agrc","followers_url":"https://api.github.com/users/agrc/followers","following_url":"https://api.github.com/users/agrc/following{/other_user}","gists_url":"https://api.github.com/users/agrc/gists{/gist_id}","starred_url":"https://api.github.com/users/agrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agrc/subscriptions","organizations_url":"https://api.github.com/users/agrc/orgs","repos_url":"https://api.github.com/users/agrc/repos","events_url":"https://api.github.com/users/agrc/events{/privacy}","received_events_url":"https://api.github.com/users/agrc/received_events","type":"Organization","site_admin":false},"repo":{"id":33880292,"name":"wri-web","full_name":"agrc/wri-web","owner":{"login":"agrc","id":709415,"avatar_url":"https://avatars.githubusercontent.com/u/709415?v=3","gravatar_id":"","url":"https://api.github.com/users/agrc","html_url":"https://github.com/agrc","followers_url":"https://api.github.com/users/agrc/followers","following_url":"https://api.github.com/users/agrc/following{/other_user}","gists_url":"https://api.github.com/users/agrc/gists{/gist_id}","starred_url":"https://api.github.com/users/agrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agrc/subscriptions","organizations_url":"https://api.github.com/users/agrc/orgs","repos_url":"https://api.github.com/users/agrc/repos","events_url":"https://api.github.com/users/agrc/events{/privacy}","received_events_url":"https://api.github.com/users/agrc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/agrc/wri-web","description":"Mapping portion of the WRI web application.","fork":false,"url":"https://api.github.com/repos/agrc/wri-web","forks_url":"https://api.github.com/repos/agrc/wri-web/forks","keys_url":"https://api.github.com/repos/agrc/wri-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agrc/wri-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agrc/wri-web/teams","hooks_url":"https://api.github.com/repos/agrc/wri-web/hooks","issue_events_url":"https://api.github.com/repos/agrc/wri-web/issues/events{/number}","events_url":"https://api.github.com/repos/agrc/wri-web/events","assignees_url":"https://api.github.com/repos/agrc/wri-web/assignees{/user}","branches_url":"https://api.github.com/repos/agrc/wri-web/branches{/branch}","tags_url":"https://api.github.com/repos/agrc/wri-web/tags","blobs_url":"https://api.github.com/repos/agrc/wri-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agrc/wri-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agrc/wri-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/agrc/wri-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agrc/wri-web/statuses/{sha}","languages_url":"https://api.github.com/repos/agrc/wri-web/languages","stargazers_url":"https://api.github.com/repos/agrc/wri-web/stargazers","contributors_url":"https://api.github.com/repos/agrc/wri-web/contributors","subscribers_url":"https://api.github.com/repos/agrc/wri-web/subscribers","subscription_url":"https://api.github.com/repos/agrc/wri-web/subscription","commits_url":"https://api.github.com/repos/agrc/wri-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/agrc/wri-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/agrc/wri-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/agrc/wri-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/agrc/wri-web/contents/{+path}","compare_url":"https://api.github.com/repos/agrc/wri-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agrc/wri-web/merges","archive_url":"https://api.github.com/repos/agrc/wri-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agrc/wri-web/downloads","issues_url":"https://api.github.com/repos/agrc/wri-web/issues{/number}","pulls_url":"https://api.github.com/repos/agrc/wri-web/pulls{/number}","milestones_url":"https://api.github.com/repos/agrc/wri-web/milestones{/number}","notifications_url":"https://api.github.com/repos/agrc/wri-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agrc/wri-web/labels{/name}","releases_url":"https://api.github.com/repos/agrc/wri-web/releases{/id}","created_at":"2015-04-13T16:34:30Z","updated_at":"2015-09-13T04:02:40Z","pushed_at":"2015-09-14T17:18:21Z","git_url":"git://github.com/agrc/wri-web.git","ssh_url":"git@github.com:agrc/wri-web.git","clone_url":"https://github.com/agrc/wri-web.git","svn_url":"https://github.com/agrc/wri-web","homepage":null,"size":1596,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"agrc:master","ref":"master","sha":"fa7b81ea21572c48d00c1c9c473a20dc30c53568","user":{"login":"agrc","id":709415,"avatar_url":"https://avatars.githubusercontent.com/u/709415?v=3","gravatar_id":"","url":"https://api.github.com/users/agrc","html_url":"https://github.com/agrc","followers_url":"https://api.github.com/users/agrc/followers","following_url":"https://api.github.com/users/agrc/following{/other_user}","gists_url":"https://api.github.com/users/agrc/gists{/gist_id}","starred_url":"https://api.github.com/users/agrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agrc/subscriptions","organizations_url":"https://api.github.com/users/agrc/orgs","repos_url":"https://api.github.com/users/agrc/repos","events_url":"https://api.github.com/users/agrc/events{/privacy}","received_events_url":"https://api.github.com/users/agrc/received_events","type":"Organization","site_admin":false},"repo":{"id":33880292,"name":"wri-web","full_name":"agrc/wri-web","owner":{"login":"agrc","id":709415,"avatar_url":"https://avatars.githubusercontent.com/u/709415?v=3","gravatar_id":"","url":"https://api.github.com/users/agrc","html_url":"https://github.com/agrc","followers_url":"https://api.github.com/users/agrc/followers","following_url":"https://api.github.com/users/agrc/following{/other_user}","gists_url":"https://api.github.com/users/agrc/gists{/gist_id}","starred_url":"https://api.github.com/users/agrc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agrc/subscriptions","organizations_url":"https://api.github.com/users/agrc/orgs","repos_url":"https://api.github.com/users/agrc/repos","events_url":"https://api.github.com/users/agrc/events{/privacy}","received_events_url":"https://api.github.com/users/agrc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/agrc/wri-web","description":"Mapping portion of the WRI web application.","fork":false,"url":"https://api.github.com/repos/agrc/wri-web","forks_url":"https://api.github.com/repos/agrc/wri-web/forks","keys_url":"https://api.github.com/repos/agrc/wri-web/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agrc/wri-web/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agrc/wri-web/teams","hooks_url":"https://api.github.com/repos/agrc/wri-web/hooks","issue_events_url":"https://api.github.com/repos/agrc/wri-web/issues/events{/number}","events_url":"https://api.github.com/repos/agrc/wri-web/events","assignees_url":"https://api.github.com/repos/agrc/wri-web/assignees{/user}","branches_url":"https://api.github.com/repos/agrc/wri-web/branches{/branch}","tags_url":"https://api.github.com/repos/agrc/wri-web/tags","blobs_url":"https://api.github.com/repos/agrc/wri-web/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agrc/wri-web/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agrc/wri-web/git/refs{/sha}","trees_url":"https://api.github.com/repos/agrc/wri-web/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agrc/wri-web/statuses/{sha}","languages_url":"https://api.github.com/repos/agrc/wri-web/languages","stargazers_url":"https://api.github.com/repos/agrc/wri-web/stargazers","contributors_url":"https://api.github.com/repos/agrc/wri-web/contributors","subscribers_url":"https://api.github.com/repos/agrc/wri-web/subscribers","subscription_url":"https://api.github.com/repos/agrc/wri-web/subscription","commits_url":"https://api.github.com/repos/agrc/wri-web/commits{/sha}","git_commits_url":"https://api.github.com/repos/agrc/wri-web/git/commits{/sha}","comments_url":"https://api.github.com/repos/agrc/wri-web/comments{/number}","issue_comment_url":"https://api.github.com/repos/agrc/wri-web/issues/comments{/number}","contents_url":"https://api.github.com/repos/agrc/wri-web/contents/{+path}","compare_url":"https://api.github.com/repos/agrc/wri-web/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agrc/wri-web/merges","archive_url":"https://api.github.com/repos/agrc/wri-web/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agrc/wri-web/downloads","issues_url":"https://api.github.com/repos/agrc/wri-web/issues{/number}","pulls_url":"https://api.github.com/repos/agrc/wri-web/pulls{/number}","milestones_url":"https://api.github.com/repos/agrc/wri-web/milestones{/number}","notifications_url":"https://api.github.com/repos/agrc/wri-web/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agrc/wri-web/labels{/name}","releases_url":"https://api.github.com/repos/agrc/wri-web/releases{/id}","created_at":"2015-04-13T16:34:30Z","updated_at":"2015-09-13T04:02:40Z","pushed_at":"2015-09-14T17:18:21Z","git_url":"git://github.com/agrc/wri-web.git","ssh_url":"git@github.com:agrc/wri-web.git","clone_url":"https://github.com/agrc/wri-web.git","svn_url":"https://github.com/agrc/wri-web","homepage":null,"size":1596,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/agrc/wri-web/pulls/98"},"html":{"href":"https://github.com/agrc/wri-web/pull/98"},"issue":{"href":"https://api.github.com/repos/agrc/wri-web/issues/98"},"comments":{"href":"https://api.github.com/repos/agrc/wri-web/issues/98/comments"},"review_comments":{"href":"https://api.github.com/repos/agrc/wri-web/pulls/98/comments"},"review_comment":{"href":"https://api.github.com/repos/agrc/wri-web/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/agrc/wri-web/pulls/98/commits"},"statuses":{"href":"https://api.github.com/repos/agrc/wri-web/statuses/4314cc89b8c48b4c3e6de432213a94d8f74a4d21"}}}}