From 03672af91984c5662cd6ac77ad90346f4e33bc00 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Fri, 7 Dec 2018 02:49:36 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=82=D1=87=20=D0=B4=D0=BB=D1=8F=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=BF=D1=80=D0=B5=D1=82=D0=B0=20=D0=BF=D1=80=D0=BE=D0=B5=D0=B7?= =?UTF-8?q?=D0=B4=D0=B0=20=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20=D1=88=D0=BB?= =?UTF-8?q?=D0=B0=D0=B3=D0=B1=D0=B0=D1=83=D0=BC=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 6 +- private-access.diff | 232 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 236 insertions(+), 2 deletions(-) create mode 100644 private-access.diff diff --git a/Dockerfile b/Dockerfile index dfb1e83..ba312dc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,8 +13,6 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y -q \ DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs gyp && \ apt-get clean && rm -rf /var/lib/apt/lists/* -ADD geos-3.7.diff /home - RUN mkdir /home/valhalla && \ cd /home/valhalla && \ git clone https://github.com/kevinkreiser/prime_server && \ @@ -28,8 +26,12 @@ RUN cd /home/valhalla && \ cd /home/valhalla/valhalla && \ git submodule update --init --recursive +ADD geos-3.7.diff /home +ADD private-access.diff /home + RUN cd /home/valhalla/valhalla && \ patch -p1 < /home/geos-3.7.diff && \ + patch -p1 < /home/private-access.diff && \ npm install node-cmake && \ cd /home/valhalla/valhalla && mkdir build && cd build && cmake .. && make -j4 install && \ tar -cf /home/valhalla/valhalla.tar -T install_manifest.txt && \ diff --git a/private-access.diff b/private-access.diff new file mode 100644 index 0000000..68af23a --- /dev/null +++ b/private-access.diff @@ -0,0 +1,232 @@ +diff --git a/lua/graph.lua b/lua/graph.lua +index 2fa78fe01..dd417d11e 100644 +--- a/lua/graph.lua ++++ b/lua/graph.lua +@@ -76,7 +76,7 @@ default_speed = { + + access = { + ["yes"] = "true", +-["private"] = "true", ++["private"] = "false", + ["no"] = "false", + ["permissive"] = "true", + ["agricultural"] = "false", +@@ -90,7 +90,7 @@ access = { + ["customers"] = "true", + ["official"] = "false", + ["public"] = "true", +-["restricted"] = "true", ++["restricted"] = "false", + ["allowed"] = "true", + ["emergency"] = "false" + } +@@ -133,7 +133,7 @@ use = { + + motor_vehicle = { + ["yes"] = "true", +-["private"] = "true", ++["private"] = "false", + ["no"] = "false", + ["permissive"] = "true", + ["agricultural"] = "false", +@@ -145,14 +145,14 @@ motor_vehicle = { + ["customers"] = "true", + ["official"] = "false", + ["public"] = "true", +-["restricted"] = "true", ++["restricted"] = "false", + ["allowed"] = "true" + } + + moped = { + ["yes"] = "true", + ["designated"] = "true", +-["private"] = "true", ++["private"] = "false", + ["permissive"] = "true", + ["destination"] = "true", + ["delivery"] = "true", +@@ -164,7 +164,7 @@ moped = { + + foot = { + ["yes"] = "true", +-["private"] = "true", ++["private"] = "false", + ["no"] = "false", + ["permissive"] = "true", + ["agricultural"] = "false", +@@ -177,7 +177,7 @@ foot = { + ["customers"] = "true", + ["official"] = "true", + ["public"] = "true", +-["restricted"] = "true", ++["restricted"] = "false", + ["crossing"] = "true", + ["sidewalk"] = "true", + ["allowed"] = "true", +@@ -195,7 +195,7 @@ wheelchair = { + ["public"] = "true", + ["permissive"] = "true", + ["only"] = "true", +-["private"] = "true", ++["private"] = "false", + ["impassable"] = "false", + ["partial"] = "false", + ["bad"] = "false", +@@ -209,7 +209,7 @@ bus = { + ["designated"] = "true", + ["urban"] = "true", + ["permissive"] = "true", +-["restricted"] = "true", ++["restricted"] = "false", + ["destination"] = "true", + ["delivery"] = "false", + ["official"] = "false" +@@ -233,7 +233,7 @@ truck = { + ["delivery"] = "true", + ["local"] = "true", + ["agricultural"] = "false", +-["private"] = "true", ++["private"] = "false", + ["discouraged"] = "false", + ["permissive"] = "false", + ["unsuitable"] = "false", +@@ -281,7 +281,7 @@ bicycle = { + ["share_busway"] = "true", + ["none"] = "false", + ["allowed"] = "true", +-["private"] = "true", ++["private"] = "false", + ["official"] = "true" + } + +@@ -299,7 +299,7 @@ cycleway = { + ["sidepath"] = "true", + ["share_busway"] = "true", + ["allowed"] = "true", +-["private"] = "true", ++["private"] = "false", + ["cyclestreet"] = "true", + ["crossing"] = "true" + } +@@ -372,7 +372,7 @@ toll = { + --node proc needs the same info as above but in the form of a mask so duplicate.. + motor_vehicle_node = { + ["yes"] = 1, +-["private"] = 1, ++["private"] = 0, + ["no"] = 0, + ["permissive"] = 1, + ["agricultural"] = 0, +@@ -384,7 +384,7 @@ motor_vehicle_node = { + ["customers"] = 1, + ["official"] = 0, + ["public"] = 1, +-["restricted"] = 1, ++["restricted"] = 0, + ["allowed"] = 1 + } + +@@ -404,13 +404,13 @@ bicycle_node = { + ["share_busway"] = 4, + ["none"] = 0, + ["allowed"] = 4, +-["private"] = 4, ++["private"] = 0, + ["official"] = 4 + } + + foot_node = { + ["yes"] = 2, +-["private"] = 2, ++["private"] = 0, + ["no"] = 0, + ["permissive"] = 2, + ["agricultural"] = 0, +@@ -423,7 +423,7 @@ foot_node = { + ["customers"] = 2, + ["official"] = 2, + ["public"] = 2, +-["restricted"] = 2, ++["restricted"] = 0, + ["crossing"] = 2, + ["sidewalk"] = 2, + ["allowed"] = 2, +@@ -441,7 +441,7 @@ wheelchair_node = { + ["public"] = 256, + ["permissive"] = 256, + ["only"] = 256, +-["private"] = 256, ++["private"] = 0, + ["impassable"] = 0, + ["partial"] = 0, + ["bad"] = 0, +@@ -452,7 +452,7 @@ wheelchair_node = { + moped_node = { + ["yes"] = 512, + ["designated"] = 512, +-["private"] = 512, ++["private"] = 0, + ["permissive"] = 512, + ["destination"] = 512, + ["delivery"] = 512, +@@ -464,7 +464,7 @@ moped_node = { + + motor_cycle_node = { + ["yes"] = 1024, +-["private"] = 1024, ++["private"] = 0, + ["no"] = 0, + ["permissive"] = 1024, + ["agricultural"] = 0, +@@ -476,7 +476,7 @@ motor_cycle_node = { + ["customers"] = 1024, + ["official"] = 0, + ["public"] = 1024, +-["restricted"] = 1024, ++["restricted"] = 0, + ["allowed"] = 1024 + } + +@@ -486,7 +486,7 @@ bus_node = { + ["designated"] = 64, + ["urban"] = 64, + ["permissive"] = 64, +-["restricted"] = 64, ++["restricted"] = 0, + ["destination"] = 64, + ["delivery"] = 0, + ["official"] = 0, +@@ -500,7 +500,7 @@ truck_node = { + ["delivery"] = 8, + ["local"] = 8, + ["agricultural"] = 0, +-["private"] = 8, ++["private"] = 0, + ["discouraged"] = 0, + ["permissive"] = 0, + ["unsuitable"] = 0, +@@ -1590,6 +1590,13 @@ function nodes_proc (kv, nokeys) + local moped = moped_tag or 512 + local motorcycle = motorcycle_tag or 1024 + ++ --check for gates and bollards ++ local gate = kv["barrier"] == "gate" or kv["barrier"] == "lift_gate" ++ local bollard = false ++ if gate == true and not kv["access"] then ++ access = "false" ++ end ++ + --if access = false use tag if exists, otherwise no access for that mode. + if (access == "false" or kv["vehicle"] == "no" or kv["hov"] == "designated") then + auto = auto_tag or 0 +@@ -1609,9 +1616,6 @@ function nodes_proc (kv, nokeys) + hov = hov_tag or 0 + end + +- --check for gates and bollards +- local gate = kv["barrier"] == "gate" or kv["barrier"] == "lift_gate" +- local bollard = false + if gate == false then + --if there was a bollard cars can't get through it + bollard = kv["barrier"] == "bollard" or kv["barrier"] == "block" or kv["bollard"] == "removable" or false