{"action":"created","comment":{"url":"https://api.github.com/repos/graphhopper/graphhopper/pulls/comments/77511837","id":77511837,"diff_hunk":"@@ -0,0 +1,478 @@\n+/*\n+ *  Licensed to GraphHopper GmbH under one or more contributor\n+ *  license agreements. See the NOTICE file distributed with this work for \n+ *  additional information regarding copyright ownership.\n+ * \n+ *  GraphHopper GmbH licenses this file to you under the Apache License, \n+ *  Version 2.0 (the \"License\"); you may not use this file except in \n+ *  compliance with the License. You may obtain a copy of the License at\n+ * \n+ *       http://www.apache.org/licenses/LICENSE-2.0\n+ * \n+ *  Unless required by applicable law or agreed to in writing, software\n+ *  distributed under the License is distributed on an \"AS IS\" BASIS,\n+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ *  See the License for the specific language governing permissions and\n+ *  limitations under the License.\n+ */\n+package com.graphhopper.routing.util;\n+\n+import com.graphhopper.reader.OSMRelation;\n+import com.graphhopper.reader.OSMWay;\n+import com.graphhopper.util.EdgeIteratorState;\n+import java.util.*;\n+import java.util.Map.Entry;\n+\n+/**\n+ * This encoder tries to store all way information into a 64bit value. Later extendable to multiple\n+ * ints or bytes. The assumption is that edge.getFlags is cheap and can be later replaced by e.g.\n+ * one or more (cheap) calls of edge.getData(index).\n+ * <p>\n+ * Currently limited to motor vehicle but later could handle different modes like foot or bike too.\n+ *\n+ * @author Peter Karich\n+ */\n+public class GenericFlagEncoder extends AbstractFlagEncoder\n+{\n+    private long bit0;\n+    private EncodedDoubleValue carFwdMaxspeedEncoder;\n+    private EncodedDoubleValue carBwdMaxspeedEncoder;\n+    private EncodedValue surfaceEncoder;\n+    private final Map<String, Integer> surfaceMap = new HashMap<>();\n+    private EncodedValue highwayEncoder;\n+    private final Map<String, Integer> highwayMap = new HashMap<>();\n+    private EncodedValue transportModeEncoder;\n+    private final List<String> transportModeList = new ArrayList<>();\n+    private final Map<String, Integer> transportModeMap = new HashMap<>();\n+\n+    public GenericFlagEncoder()\n+    {\n+        // TODO include turn information\n+        super(5, 5, 0);\n+\n+        maxPossibleSpeed = 140;\n+\n+        //\n+        // TODO do something about the access values (forestry, agricultural, destination, private, delivery, customers)\n+        //\n+        List<String> highwayList = Arrays.asList(\n+                /* reserve index=0 for unset roads (not accessible) */\n+                \"_default\",\n+                \"motorway\", \"motorway_link\", \"motorroad\",\n+                \"trunk\", \"trunk_link\",\n+                \"primary\", \"primary_link\", \"secondary\", \"secondary_link\", \"tertiary\", \"tertiary_link\",\n+                \"unclassified\", \"residential\", \"living_street\", \"service\", \"road\", \"track\",\n+                \"ferry\", \"shuttle\");","path":"core/src/main/java/com/graphhopper/routing/util/GenericFlagEncoder.java","position":65,"original_position":65,"commit_id":"3874ef86fb177f0dcf260ede32fdcae3615ec714","original_commit_id":"3874ef86fb177f0dcf260ede32fdcae3615ec714","user":{"login":"karussell","id":129644,"avatar_url":"https://avatars.githubusercontent.com/u/129644?v=3","gravatar_id":"","url":"https://api.github.com/users/karussell","html_url":"https://github.com/karussell","followers_url":"https://api.github.com/users/karussell/followers","following_url":"https://api.github.com/users/karussell/following{/other_user}","gists_url":"https://api.github.com/users/karussell/gists{/gist_id}","starred_url":"https://api.github.com/users/karussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karussell/subscriptions","organizations_url":"https://api.github.com/users/karussell/orgs","repos_url":"https://api.github.com/users/karussell/repos","events_url":"https://api.github.com/users/karussell/events{/privacy}","received_events_url":"https://api.github.com/users/karussell/received_events","type":"User","site_admin":false},"body":"> There is no need to be sorry :)\r\n\r\n:) sure :+1: !\r\n\r\nYes, this is used in the route tag but I was trying to avoid a new tag key here as there are no combinations of e.g. motorway and ferry or with shuttle. This is just to avoid using yet another set of bits.","created_at":"2016-09-05T12:02:21Z","updated_at":"2016-09-05T12:02:21Z","html_url":"https://github.com/graphhopper/graphhopper/pull/730#discussion_r77511837","pull_request_url":"https://api.github.com/repos/graphhopper/graphhopper/pulls/730","_links":{"self":{"href":"https://api.github.com/repos/graphhopper/graphhopper/pulls/comments/77511837"},"html":{"href":"https://github.com/graphhopper/graphhopper/pull/730#discussion_r77511837"},"pull_request":{"href":"https://api.github.com/repos/graphhopper/graphhopper/pulls/730"}}},"pull_request":{"url":"https://api.github.com/repos/graphhopper/graphhopper/pulls/730","id":72044819,"html_url":"https://github.com/graphhopper/graphhopper/pull/730","diff_url":"https://github.com/graphhopper/graphhopper/pull/730.diff","patch_url":"https://github.com/graphhopper/graphhopper/pull/730.patch","issue_url":"https://api.github.com/repos/graphhopper/graphhopper/issues/730","number":730,"state":"open","locked":false,"title":"initial work towards generic weighting&encoding ('more flexible' work)","user":{"login":"karussell","id":129644,"avatar_url":"https://avatars.githubusercontent.com/u/129644?v=3","gravatar_id":"","url":"https://api.github.com/users/karussell","html_url":"https://github.com/karussell","followers_url":"https://api.github.com/users/karussell/followers","following_url":"https://api.github.com/users/karussell/following{/other_user}","gists_url":"https://api.github.com/users/karussell/gists{/gist_id}","starred_url":"https://api.github.com/users/karussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karussell/subscriptions","organizations_url":"https://api.github.com/users/karussell/orgs","repos_url":"https://api.github.com/users/karussell/repos","events_url":"https://api.github.com/users/karussell/events{/privacy}","received_events_url":"https://api.github.com/users/karussell/received_events","type":"User","site_admin":false},"body":"See [the forum](https://discuss.graphhopper.com/t/more-flexibility-in-gh/71) for more discussion.\r\n\r\nThere are lots of TODOs and currently no integration tests, so it is not time to merge but to play around for you. You can currently configure the average speed of the highways the (car-like) vehicle should use. E.g. overwrite residential, tertiary and secondary via [this request](http://localhost:8989/?point=52.462913%2C13.387871&point=52.529486%2C13.399372&vehicle=generic&weighting=generic&highways.secondary=35&highways.tertiary=30&highways.residential=30).","created_at":"2016-05-31T16:19:55Z","updated_at":"2016-09-05T12:02:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0e96e124a41c678154db526d27233fddebf75e8c","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/graphhopper/graphhopper/milestones/9","html_url":"https://github.com/graphhopper/graphhopper/milestones/0.8","labels_url":"https://api.github.com/repos/graphhopper/graphhopper/milestones/9/labels","id":1792682,"number":9,"title":"0.8","description":"","creator":{"login":"karussell","id":129644,"avatar_url":"https://avatars.githubusercontent.com/u/129644?v=3","gravatar_id":"","url":"https://api.github.com/users/karussell","html_url":"https://github.com/karussell","followers_url":"https://api.github.com/users/karussell/followers","following_url":"https://api.github.com/users/karussell/following{/other_user}","gists_url":"https://api.github.com/users/karussell/gists{/gist_id}","starred_url":"https://api.github.com/users/karussell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karussell/subscriptions","organizations_url":"https://api.github.com/users/karussell/orgs","repos_url":"https://api.github.com/users/karussell/repos","events_url":"https://api.github.com/users/karussell/events{/privacy}","received_events_url":"https://api.github.com/users/karussell/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":26,"state":"open","created_at":"2016-05-27T19:22:07Z","updated_at":"2016-09-01T08:02:13Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/graphhopper/graphhopper/pulls/730/commits","review_comments_url":"https://api.github.com/repos/graphhopper/graphhopper/pulls/730/comments","review_comment_url":"https://api.github.com/repos/graphhopper/graphhopper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/graphhopper/graphhopper/issues/730/comments","statuses_url":"https://api.github.com/repos/graphhopper/graphhopper/statuses/3874ef86fb177f0dcf260ede32fdcae3615ec714","head":{"label":"graphhopper:flexibility2","ref":"flexibility2","sha":"3874ef86fb177f0dcf260ede32fdcae3615ec714","user":{"login":"graphhopper","id":2264498,"avatar_url":"https://avatars.githubusercontent.com/u/2264498?v=3","gravatar_id":"","url":"https://api.github.com/users/graphhopper","html_url":"https://github.com/graphhopper","followers_url":"https://api.github.com/users/graphhopper/followers","following_url":"https://api.github.com/users/graphhopper/following{/other_user}","gists_url":"https://api.github.com/users/graphhopper/gists{/gist_id}","starred_url":"https://api.github.com/users/graphhopper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphhopper/subscriptions","organizations_url":"https://api.github.com/users/graphhopper/orgs","repos_url":"https://api.github.com/users/graphhopper/repos","events_url":"https://api.github.com/users/graphhopper/events{/privacy}","received_events_url":"https://api.github.com/users/graphhopper/received_events","type":"Organization","site_admin":false},"repo":{"id":3480666,"name":"graphhopper","full_name":"graphhopper/graphhopper","owner":{"login":"graphhopper","id":2264498,"avatar_url":"https://avatars.githubusercontent.com/u/2264498?v=3","gravatar_id":"","url":"https://api.github.com/users/graphhopper","html_url":"https://github.com/graphhopper","followers_url":"https://api.github.com/users/graphhopper/followers","following_url":"https://api.github.com/users/graphhopper/following{/other_user}","gists_url":"https://api.github.com/users/graphhopper/gists{/gist_id}","starred_url":"https://api.github.com/users/graphhopper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphhopper/subscriptions","organizations_url":"https://api.github.com/users/graphhopper/orgs","repos_url":"https://api.github.com/users/graphhopper/repos","events_url":"https://api.github.com/users/graphhopper/events{/privacy}","received_events_url":"https://api.github.com/users/graphhopper/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/graphhopper/graphhopper","description":"Open source routing library and server using OpenStreetMap. #route #planner","fork":false,"url":"https://api.github.com/repos/graphhopper/graphhopper","forks_url":"https://api.github.com/repos/graphhopper/graphhopper/forks","keys_url":"https://api.github.com/repos/graphhopper/graphhopper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/graphhopper/graphhopper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/graphhopper/graphhopper/teams","hooks_url":"https://api.github.com/repos/graphhopper/graphhopper/hooks","issue_events_url":"https://api.github.com/repos/graphhopper/graphhopper/issues/events{/number}","events_url":"https://api.github.com/repos/graphhopper/graphhopper/events","assignees_url":"https://api.github.com/repos/graphhopper/graphhopper/assignees{/user}","branches_url":"https://api.github.com/repos/graphhopper/graphhopper/branches{/branch}","tags_url":"https://api.github.com/repos/graphhopper/graphhopper/tags","blobs_url":"https://api.github.com/repos/graphhopper/graphhopper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/graphhopper/graphhopper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/graphhopper/graphhopper/git/refs{/sha}","trees_url":"https://api.github.com/repos/graphhopper/graphhopper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/graphhopper/graphhopper/statuses/{sha}","languages_url":"https://api.github.com/repos/graphhopper/graphhopper/languages","stargazers_url":"https://api.github.com/repos/graphhopper/graphhopper/stargazers","contributors_url":"https://api.github.com/repos/graphhopper/graphhopper/contributors","subscribers_url":"https://api.github.com/repos/graphhopper/graphhopper/subscribers","subscription_url":"https://api.github.com/repos/graphhopper/graphhopper/subscription","commits_url":"https://api.github.com/repos/graphhopper/graphhopper/commits{/sha}","git_commits_url":"https://api.github.com/repos/graphhopper/graphhopper/git/commits{/sha}","comments_url":"https://api.github.com/repos/graphhopper/graphhopper/comments{/number}","issue_comment_url":"https://api.github.com/repos/graphhopper/graphhopper/issues/comments{/number}","contents_url":"https://api.github.com/repos/graphhopper/graphhopper/contents/{+path}","compare_url":"https://api.github.com/repos/graphhopper/graphhopper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/graphhopper/graphhopper/merges","archive_url":"https://api.github.com/repos/graphhopper/graphhopper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/graphhopper/graphhopper/downloads","issues_url":"https://api.github.com/repos/graphhopper/graphhopper/issues{/number}","pulls_url":"https://api.github.com/repos/graphhopper/graphhopper/pulls{/number}","milestones_url":"https://api.github.com/repos/graphhopper/graphhopper/milestones{/number}","notifications_url":"https://api.github.com/repos/graphhopper/graphhopper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/graphhopper/graphhopper/labels{/name}","releases_url":"https://api.github.com/repos/graphhopper/graphhopper/releases{/id}","deployments_url":"https://api.github.com/repos/graphhopper/graphhopper/deployments","created_at":"2012-02-18T19:57:38Z","updated_at":"2016-09-05T09:36:57Z","pushed_at":"2016-08-30T16:02:10Z","git_url":"git://github.com/graphhopper/graphhopper.git","ssh_url":"git@github.com:graphhopper/graphhopper.git","clone_url":"https://github.com/graphhopper/graphhopper.git","svn_url":"https://github.com/graphhopper/graphhopper","homepage":"https://graphhopper.com/#community","size":99873,"stargazers_count":930,"watchers_count":930,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":399,"mirror_url":null,"open_issues_count":143,"forks":399,"open_issues":143,"watchers":930,"default_branch":"master"}},"base":{"label":"graphhopper:master","ref":"master","sha":"c44a03376fa0f036fd736f2afa40878410da90ae","user":{"login":"graphhopper","id":2264498,"avatar_url":"https://avatars.githubusercontent.com/u/2264498?v=3","gravatar_id":"","url":"https://api.github.com/users/graphhopper","html_url":"https://github.com/graphhopper","followers_url":"https://api.github.com/users/graphhopper/followers","following_url":"https://api.github.com/users/graphhopper/following{/other_user}","gists_url":"https://api.github.com/users/graphhopper/gists{/gist_id}","starred_url":"https://api.github.com/users/graphhopper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphhopper/subscriptions","organizations_url":"https://api.github.com/users/graphhopper/orgs","repos_url":"https://api.github.com/users/graphhopper/repos","events_url":"https://api.github.com/users/graphhopper/events{/privacy}","received_events_url":"https://api.github.com/users/graphhopper/received_events","type":"Organization","site_admin":false},"repo":{"id":3480666,"name":"graphhopper","full_name":"graphhopper/graphhopper","owner":{"login":"graphhopper","id":2264498,"avatar_url":"https://avatars.githubusercontent.com/u/2264498?v=3","gravatar_id":"","url":"https://api.github.com/users/graphhopper","html_url":"https://github.com/graphhopper","followers_url":"https://api.github.com/users/graphhopper/followers","following_url":"https://api.github.com/users/graphhopper/following{/other_user}","gists_url":"https://api.github.com/users/graphhopper/gists{/gist_id}","starred_url":"https://api.github.com/users/graphhopper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/graphhopper/subscriptions","organizations_url":"https://api.github.com/users/graphhopper/orgs","repos_url":"https://api.github.com/users/graphhopper/repos","events_url":"https://api.github.com/users/graphhopper/events{/privacy}","received_events_url":"https://api.github.com/users/graphhopper/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/graphhopper/graphhopper","description":"Open source routing library and server using OpenStreetMap. #route #planner","fork":false,"url":"https://api.github.com/repos/graphhopper/graphhopper","forks_url":"https://api.github.com/repos/graphhopper/graphhopper/forks","keys_url":"https://api.github.com/repos/graphhopper/graphhopper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/graphhopper/graphhopper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/graphhopper/graphhopper/teams","hooks_url":"https://api.github.com/repos/graphhopper/graphhopper/hooks","issue_events_url":"https://api.github.com/repos/graphhopper/graphhopper/issues/events{/number}","events_url":"https://api.github.com/repos/graphhopper/graphhopper/events","assignees_url":"https://api.github.com/repos/graphhopper/graphhopper/assignees{/user}","branches_url":"https://api.github.com/repos/graphhopper/graphhopper/branches{/branch}","tags_url":"https://api.github.com/repos/graphhopper/graphhopper/tags","blobs_url":"https://api.github.com/repos/graphhopper/graphhopper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/graphhopper/graphhopper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/graphhopper/graphhopper/git/refs{/sha}","trees_url":"https://api.github.com/repos/graphhopper/graphhopper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/graphhopper/graphhopper/statuses/{sha}","languages_url":"https://api.github.com/repos/graphhopper/graphhopper/languages","stargazers_url":"https://api.github.com/repos/graphhopper/graphhopper/stargazers","contributors_url":"https://api.github.com/repos/graphhopper/graphhopper/contributors","subscribers_url":"https://api.github.com/repos/graphhopper/graphhopper/subscribers","subscription_url":"https://api.github.com/repos/graphhopper/graphhopper/subscription","commits_url":"https://api.github.com/repos/graphhopper/graphhopper/commits{/sha}","git_commits_url":"https://api.github.com/repos/graphhopper/graphhopper/git/commits{/sha}","comments_url":"https://api.github.com/repos/graphhopper/graphhopper/comments{/number}","issue_comment_url":"https://api.github.com/repos/graphhopper/graphhopper/issues/comments{/number}","contents_url":"https://api.github.com/repos/graphhopper/graphhopper/contents/{+path}","compare_url":"https://api.github.com/repos/graphhopper/graphhopper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/graphhopper/graphhopper/merges","archive_url":"https://api.github.com/repos/graphhopper/graphhopper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/graphhopper/graphhopper/downloads","issues_url":"https://api.github.com/repos/graphhopper/graphhopper/issues{/number}","pulls_url":"https://api.github.com/repos/graphhopper/graphhopper/pulls{/number}","milestones_url":"https://api.github.com/repos/graphhopper/graphhopper/milestones{/number}","notifications_url":"https://api.github.com/repos/graphhopper/graphhopper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/graphhopper/graphhopper/labels{/name}","releases_url":"https://api.github.com/repos/graphhopper/graphhopper/releases{/id}","deployments_url":"https://api.github.com/repos/graphhopper/graphhopper/deployments","created_at":"2012-02-18T19:57:38Z","updated_at":"2016-09-05T09:36:57Z","pushed_at":"2016-08-30T16:02:10Z","git_url":"git://github.com/graphhopper/graphhopper.git","ssh_url":"git@github.com:graphhopper/graphhopper.git","clone_url":"https://github.com/graphhopper/graphhopper.git","svn_url":"https://github.com/graphhopper/graphhopper","homepage":"https://graphhopper.com/#community","size":99873,"stargazers_count":930,"watchers_count":930,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":399,"mirror_url":null,"open_issues_count":143,"forks":399,"open_issues":143,"watchers":930,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/graphhopper/graphhopper/pulls/730"},"html":{"href":"https://github.com/graphhopper/graphhopper/pull/730"},"issue":{"href":"https://api.github.com/repos/graphhopper/graphhopper/issues/730"},"comments":{"href":"https://api.github.com/repos/graphhopper/graphhopper/issues/730/comments"},"review_comments":{"href":"https://api.github.com/repos/graphhopper/graphhopper/pulls/730/comments"},"review_comment":{"href":"https://api.github.com/repos/graphhopper/graphhopper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/graphhopper/graphhopper/pulls/730/commits"},"statuses":{"href":"https://api.github.com/repos/graphhopper/graphhopper/statuses/3874ef86fb177f0dcf260ede32fdcae3615ec714"}}}}
{"actor":{"display_login":"karussell"}}