{"action":"created","comment":{"url":"https://api.github.com/repos/azavea/OpenTripPlanner/pulls/comments/23483802","id":23483802,"diff_hunk":"@@ -349,10 +391,94 @@ public void buildGraph(Graph graph, HashMap<Class<?>, Object> extra) {\n         }\n     }\n \n+    private EnumMap<NihOption, ArrayList<StringAttributeFeatureConverter>> getFieldConverters() {\n+        // if have R/L columns, have list [R, L]\n+        EnumMap<NihOption, ArrayList<StringAttributeFeatureConverter>> converters = new EnumMap(NihOption.class);\n+\n+        final String LEFT_PREFIX = \"L_\";\n+        final String RIGHT_PREFIX = \"R_\";\n+\n+        for (NihOption option : NIH_OPTIONS) {\n+            ArrayList<StringAttributeFeatureConverter> fields = new ArrayList();\n+            if (option.hasLeftRight()) {\n+\n+                if (option.equals(NihOption.TRAFFIC)) {\n+                    continue; // TODO: will this field go into the shapefile eventually? skip it for now.\n+                }\n+\n+                // make two converters, one for each side\n+                fields.add(new StringAttributeFeatureConverter(RIGHT_PREFIX + option.getFieldName(), \"\"));\n+                fields.add(new StringAttributeFeatureConverter(LEFT_PREFIX + option.getFieldName(), \"\"));\n+            } else {\n+                fields.add(new StringAttributeFeatureConverter(option.getFieldName(), \"\"));\n+            }\n+            converters.put(option, fields);\n+        }\n+\n+        return converters;\n+    }\n+\n+    private void setProperties(SimpleFeature feature, Set<StreetEdge> edges, boolean isRightSide) {\n+\n+        if (isRightSide) {\n+            LOG.info(\"Going to set properties on right edges...\");\n+        } else {\n+            LOG.info(\"Going to set properties on left edges...\");\n+        }\n+\n+        // build set of converted values\n+        OptionSet<NihOption> nihOptions = new OptionSet(NihOption.class);\n+\n+        for (NihOption option : NIH_OPTIONS) {\n+            String val = \"\";\n+\n+            if (option.equals(NihOption.TRAFFIC)) {\n+                // TODO: will this column be added to the shapefile?\n+                continue;\n+            }\n+\n+            if (!option.hasLeftRight() || isRightSide) {\n+                val = optionConverters.get(option).get(0).convert(feature);\n+            } else {\n+                // left side is second in list\n+                val = optionConverters.get(option).get(1).convert(feature);\n+            }\n+\n+            if (val.isEmpty()) {\n+                LOG.warn(\"Skipping setting an empty value for option {}.  Was this intentional?\", option.getFieldName());\n+            } else {\n+\n+                // TODO: some better way to correct for left/right values encoded in a single column?\n+                if (val.equals(\"Right\")) {\n+                    if (isRightSide) {\n+                        val = \"Both\";","path":"src/main/java/org/opentripplanner/graph_builder/impl/shapefile/NihShapefileStreetGraphBuilderImpl.java","position":271,"original_position":271,"commit_id":"b1146f72a2ccc5ba2cd7ca6d9bf0c7b8b3a20c11","original_commit_id":"b1146f72a2ccc5ba2cd7ca6d9bf0c7b8b3a20c11","user":{"login":"CloudNiner","id":1818302,"avatar_url":"https://avatars.githubusercontent.com/u/1818302?v=3","gravatar_id":"","url":"https://api.github.com/users/CloudNiner","html_url":"https://github.com/CloudNiner","followers_url":"https://api.github.com/users/CloudNiner/followers","following_url":"https://api.github.com/users/CloudNiner/following{/other_user}","gists_url":"https://api.github.com/users/CloudNiner/gists{/gist_id}","starred_url":"https://api.github.com/users/CloudNiner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CloudNiner/subscriptions","organizations_url":"https://api.github.com/users/CloudNiner/orgs","repos_url":"https://api.github.com/users/CloudNiner/repos","events_url":"https://api.github.com/users/CloudNiner/events{/privacy}","received_events_url":"https://api.github.com/users/CloudNiner/received_events","type":"User","site_admin":false},"body":"I'm not sure what the \"Both\" sprinkled throughout this PR means? Is it insinuating that the attribute is on both sides of the street? But, then here, we set to both if its only right side.\r\n\r\nIs idea what the TODO above is referring to? ","created_at":"2015-01-23T22:01:28Z","updated_at":"2015-01-23T22:01:28Z","html_url":"https://github.com/azavea/OpenTripPlanner/pull/4#discussion_r23483802","pull_request_url":"https://api.github.com/repos/azavea/OpenTripPlanner/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/azavea/OpenTripPlanner/pulls/comments/23483802"},"html":{"href":"https://github.com/azavea/OpenTripPlanner/pull/4#discussion_r23483802"},"pull_request":{"href":"https://api.github.com/repos/azavea/OpenTripPlanner/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/azavea/OpenTripPlanner/pulls/4","id":27957226,"html_url":"https://github.com/azavea/OpenTripPlanner/pull/4","diff_url":"https://github.com/azavea/OpenTripPlanner/pull/4.diff","patch_url":"https://github.com/azavea/OpenTripPlanner/pull/4.patch","issue_url":"https://api.github.com/repos/azavea/OpenTripPlanner/issues/4","number":4,"state":"open","locked":false,"title":"Add optional extra attributes to model and add NIH edge attribute models","user":{"login":"flibbertigibbet","id":960264,"avatar_url":"https://avatars.githubusercontent.com/u/960264?v=3","gravatar_id":"","url":"https://api.github.com/users/flibbertigibbet","html_url":"https://github.com/flibbertigibbet","followers_url":"https://api.github.com/users/flibbertigibbet/followers","following_url":"https://api.github.com/users/flibbertigibbet/following{/other_user}","gists_url":"https://api.github.com/users/flibbertigibbet/gists{/gist_id}","starred_url":"https://api.github.com/users/flibbertigibbet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flibbertigibbet/subscriptions","organizations_url":"https://api.github.com/users/flibbertigibbet/orgs","repos_url":"https://api.github.com/users/flibbertigibbet/repos","events_url":"https://api.github.com/users/flibbertigibbet/events{/privacy}","received_events_url":"https://api.github.com/users/flibbertigibbet/received_events","type":"User","site_admin":false},"body":"* Sets optional additional attributes on StreetEdge (for use in weighting later)\r\n* Defines expected fields and options from NIH segments shapefile\r\n* Reads in attributes from NIH segments shapefile and sets the extra attributes on the StreetEdges","created_at":"2015-01-23T21:33:55Z","updated_at":"2015-01-23T22:01:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a9f7e76355f130d1d0a40f0717a5e9ccd939fb21","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/azavea/OpenTripPlanner/pulls/4/commits","review_comments_url":"https://api.github.com/repos/azavea/OpenTripPlanner/pulls/4/comments","review_comment_url":"https://api.github.com/repos/azavea/OpenTripPlanner/pulls/comments/{number}","comments_url":"https://api.github.com/repos/azavea/OpenTripPlanner/issues/4/comments","statuses_url":"https://api.github.com/repos/azavea/OpenTripPlanner/statuses/b1146f72a2ccc5ba2cd7ca6d9bf0c7b8b3a20c11","head":{"label":"flibbertigibbet:feature/set-shapefile-properties","ref":"feature/set-shapefile-properties","sha":"b1146f72a2ccc5ba2cd7ca6d9bf0c7b8b3a20c11","user":{"login":"flibbertigibbet","id":960264,"avatar_url":"https://avatars.githubusercontent.com/u/960264?v=3","gravatar_id":"","url":"https://api.github.com/users/flibbertigibbet","html_url":"https://github.com/flibbertigibbet","followers_url":"https://api.github.com/users/flibbertigibbet/followers","following_url":"https://api.github.com/users/flibbertigibbet/following{/other_user}","gists_url":"https://api.github.com/users/flibbertigibbet/gists{/gist_id}","starred_url":"https://api.github.com/users/flibbertigibbet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flibbertigibbet/subscriptions","organizations_url":"https://api.github.com/users/flibbertigibbet/orgs","repos_url":"https://api.github.com/users/flibbertigibbet/repos","events_url":"https://api.github.com/users/flibbertigibbet/events{/privacy}","received_events_url":"https://api.github.com/users/flibbertigibbet/received_events","type":"User","site_admin":false},"repo":{"id":9782068,"name":"OpenTripPlanner","full_name":"flibbertigibbet/OpenTripPlanner","owner":{"login":"flibbertigibbet","id":960264,"avatar_url":"https://avatars.githubusercontent.com/u/960264?v=3","gravatar_id":"","url":"https://api.github.com/users/flibbertigibbet","html_url":"https://github.com/flibbertigibbet","followers_url":"https://api.github.com/users/flibbertigibbet/followers","following_url":"https://api.github.com/users/flibbertigibbet/following{/other_user}","gists_url":"https://api.github.com/users/flibbertigibbet/gists{/gist_id}","starred_url":"https://api.github.com/users/flibbertigibbet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flibbertigibbet/subscriptions","organizations_url":"https://api.github.com/users/flibbertigibbet/orgs","repos_url":"https://api.github.com/users/flibbertigibbet/repos","events_url":"https://api.github.com/users/flibbertigibbet/events{/privacy}","received_events_url":"https://api.github.com/users/flibbertigibbet/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/flibbertigibbet/OpenTripPlanner","description":"An open source multi-modal trip planner","fork":true,"url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner","forks_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/forks","keys_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/teams","hooks_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/hooks","issue_events_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/issues/events{/number}","events_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/events","assignees_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/assignees{/user}","branches_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/branches{/branch}","tags_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/tags","blobs_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/git/refs{/sha}","trees_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/statuses/{sha}","languages_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/languages","stargazers_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/stargazers","contributors_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/contributors","subscribers_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/subscribers","subscription_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/subscription","commits_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/commits{/sha}","git_commits_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/git/commits{/sha}","comments_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/comments{/number}","issue_comment_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/issues/comments/{number}","contents_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/contents/{+path}","compare_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/merges","archive_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/downloads","issues_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/issues{/number}","pulls_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/pulls{/number}","milestones_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/milestones{/number}","notifications_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/labels{/name}","releases_url":"https://api.github.com/repos/flibbertigibbet/OpenTripPlanner/releases{/id}","created_at":"2013-04-30T23:13:32Z","updated_at":"2015-01-08T19:59:06Z","pushed_at":"2015-01-23T21:53:49Z","git_url":"git://github.com/flibbertigibbet/OpenTripPlanner.git","ssh_url":"git@github.com:flibbertigibbet/OpenTripPlanner.git","clone_url":"https://github.com/flibbertigibbet/OpenTripPlanner.git","svn_url":"https://github.com/flibbertigibbet/OpenTripPlanner","homepage":"http://www.opentripplanner.org","size":99105,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"azavea:develop","ref":"develop","sha":"77072a5b548e1777b23127ebedfcf08f2461c171","user":{"login":"azavea","id":595231,"avatar_url":"https://avatars.githubusercontent.com/u/595231?v=3","gravatar_id":"","url":"https://api.github.com/users/azavea","html_url":"https://github.com/azavea","followers_url":"https://api.github.com/users/azavea/followers","following_url":"https://api.github.com/users/azavea/following{/other_user}","gists_url":"https://api.github.com/users/azavea/gists{/gist_id}","starred_url":"https://api.github.com/users/azavea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azavea/subscriptions","organizations_url":"https://api.github.com/users/azavea/orgs","repos_url":"https://api.github.com/users/azavea/repos","events_url":"https://api.github.com/users/azavea/events{/privacy}","received_events_url":"https://api.github.com/users/azavea/received_events","type":"Organization","site_admin":false},"repo":{"id":29300755,"name":"OpenTripPlanner","full_name":"azavea/OpenTripPlanner","owner":{"login":"azavea","id":595231,"avatar_url":"https://avatars.githubusercontent.com/u/595231?v=3","gravatar_id":"","url":"https://api.github.com/users/azavea","html_url":"https://github.com/azavea","followers_url":"https://api.github.com/users/azavea/followers","following_url":"https://api.github.com/users/azavea/following{/other_user}","gists_url":"https://api.github.com/users/azavea/gists{/gist_id}","starred_url":"https://api.github.com/users/azavea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azavea/subscriptions","organizations_url":"https://api.github.com/users/azavea/orgs","repos_url":"https://api.github.com/users/azavea/repos","events_url":"https://api.github.com/users/azavea/events{/privacy}","received_events_url":"https://api.github.com/users/azavea/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/azavea/OpenTripPlanner","description":"An open source multi-modal trip planner","fork":true,"url":"https://api.github.com/repos/azavea/OpenTripPlanner","forks_url":"https://api.github.com/repos/azavea/OpenTripPlanner/forks","keys_url":"https://api.github.com/repos/azavea/OpenTripPlanner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/azavea/OpenTripPlanner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/azavea/OpenTripPlanner/teams","hooks_url":"https://api.github.com/repos/azavea/OpenTripPlanner/hooks","issue_events_url":"https://api.github.com/repos/azavea/OpenTripPlanner/issues/events{/number}","events_url":"https://api.github.com/repos/azavea/OpenTripPlanner/events","assignees_url":"https://api.github.com/repos/azavea/OpenTripPlanner/assignees{/user}","branches_url":"https://api.github.com/repos/azavea/OpenTripPlanner/branches{/branch}","tags_url":"https://api.github.com/repos/azavea/OpenTripPlanner/tags","blobs_url":"https://api.github.com/repos/azavea/OpenTripPlanner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/azavea/OpenTripPlanner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/azavea/OpenTripPlanner/git/refs{/sha}","trees_url":"https://api.github.com/repos/azavea/OpenTripPlanner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/azavea/OpenTripPlanner/statuses/{sha}","languages_url":"https://api.github.com/repos/azavea/OpenTripPlanner/languages","stargazers_url":"https://api.github.com/repos/azavea/OpenTripPlanner/stargazers","contributors_url":"https://api.github.com/repos/azavea/OpenTripPlanner/contributors","subscribers_url":"https://api.github.com/repos/azavea/OpenTripPlanner/subscribers","subscription_url":"https://api.github.com/repos/azavea/OpenTripPlanner/subscription","commits_url":"https://api.github.com/repos/azavea/OpenTripPlanner/commits{/sha}","git_commits_url":"https://api.github.com/repos/azavea/OpenTripPlanner/git/commits{/sha}","comments_url":"https://api.github.com/repos/azavea/OpenTripPlanner/comments{/number}","issue_comment_url":"https://api.github.com/repos/azavea/OpenTripPlanner/issues/comments/{number}","contents_url":"https://api.github.com/repos/azavea/OpenTripPlanner/contents/{+path}","compare_url":"https://api.github.com/repos/azavea/OpenTripPlanner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/azavea/OpenTripPlanner/merges","archive_url":"https://api.github.com/repos/azavea/OpenTripPlanner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/azavea/OpenTripPlanner/downloads","issues_url":"https://api.github.com/repos/azavea/OpenTripPlanner/issues{/number}","pulls_url":"https://api.github.com/repos/azavea/OpenTripPlanner/pulls{/number}","milestones_url":"https://api.github.com/repos/azavea/OpenTripPlanner/milestones{/number}","notifications_url":"https://api.github.com/repos/azavea/OpenTripPlanner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/azavea/OpenTripPlanner/labels{/name}","releases_url":"https://api.github.com/repos/azavea/OpenTripPlanner/releases{/id}","created_at":"2015-01-15T14:22:51Z","updated_at":"2015-01-21T15:57:55Z","pushed_at":"2015-01-21T15:57:54Z","git_url":"git://github.com/azavea/OpenTripPlanner.git","ssh_url":"git@github.com:azavea/OpenTripPlanner.git","clone_url":"https://github.com/azavea/OpenTripPlanner.git","svn_url":"https://github.com/azavea/OpenTripPlanner","homepage":"http://www.opentripplanner.org","size":100533,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/azavea/OpenTripPlanner/pulls/4"},"html":{"href":"https://github.com/azavea/OpenTripPlanner/pull/4"},"issue":{"href":"https://api.github.com/repos/azavea/OpenTripPlanner/issues/4"},"comments":{"href":"https://api.github.com/repos/azavea/OpenTripPlanner/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/azavea/OpenTripPlanner/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/azavea/OpenTripPlanner/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/azavea/OpenTripPlanner/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/azavea/OpenTripPlanner/statuses/b1146f72a2ccc5ba2cd7ca6d9bf0c7b8b3a20c11"}}}}