ffnord / ffmap-backend

THIS PROJECT DOESN'T HAVE A MAINTAINER!
Other
20 stars 59 forks source link

Blacklist for some nodes or coordinates for the map #50

Closed rubo77 closed 9 years ago

rubo77 commented 9 years ago

I can think of three reasons, why you want to hide the coordinates from the map:

We would need a functionality to blacklist certain nodes on the map for cases

  1. the node is too far away from the community center so you don't want to stretch the map so far to include this node
  2. Some third party legal request forces the community to hide the coordinates from public
  3. the coords are at the wrong place so they create wrong links all across the area that don't really exist and you cannot reach the owner to correct them or the node is placed in a special place where there is no access anymore to.

solutions for those:

  1. the first comment by @mweinelt: https://github.com/ffnord/ffmap-d3/issues/112#issuecomment-87007554

    It could exclude coordinates for nodes that are farther away than $x km from a given center. The center could also be determined automatically by the use of basic stochastic.

    Someone would have to build that logic though. And maybe present a warning somewhere about bogus coordinates.

  2. Remove the illegal coordinates completely from the generated json data
  3. Those coordinates should be removed from the data too, but only as long as the owner doesn't correct them (also in the backend), so If they are corrected one day, they re-appear on the map

so the blacklist would have to have two options:

(This was preciedingly posted at https://github.com/ffnord/ffmap-d3/issues/112)

rubo77 commented 9 years ago

This patch will simply add a file blacklist in the main folder that contains the wrong and correct longitude and latitude values each in one line with a slash between. Then this file wil be used to replace the wrong coordinates with the correct:

create a file blacklist like

54.357991097/54.32738396458
10.134319067/10.13090193271

and add this line in mkmap.sh:

cat blacklist|while read geo ; do if [ "$geo" != "" ]; then sed -i s/$geo/ json/nodes.json; fi; done

Where json/nodes.json is the generated nodes.json file.

Here is our git patch:

 blacklist | 3 +++
 mkmap.sh  | 5 +++++
 2 files changed, 8 insertions(+)
 create mode 100644 blacklist

diff --git a/blacklist b/blacklist
new file mode 100644
index 0000000..d03fe7e
--- /dev/null
+++ b/blacklist
@@ -0,0 +1,3 @@
+54.357991097/54.32738396458
+10.134319067/10.13090193271
+
diff --git a/mkmap.sh b/mkmap.sh
index 97fe040..f120107 100755
--- a/mkmap.sh
+++ b/mkmap.sh
@@ -17,3 +17,8 @@ jq -c 'with_entries(select(.value.vpn == true) | {key, value: {"vpn": .value.vpn

 ./bat2nodes.py --alfred json/alfred.158.json --aliases json/aliases.json --mesh json/batman.json -d $DEST

+# the file blacklist contains long and latitude values, that should be replaced in the form
+# 53.123456/53.456789
+# 10.123456/10.456789
+cat blacklist|while read geo ; do if [ "$geo" != "" ]; then sed -i s/$geo/ json/nodes.json; fi; done
+
-- 
2.1.4
tcatm commented 9 years ago

Es gibt gar keine mkmap.sh mehr im repository.

mweinelt commented 9 years ago

mkmap.sh/bat2nodes sind Teil des deprecated branches, der nicht mehr maintained wird.

rubo77 commented 9 years ago

Ich hab das hier einfach mal gepostet falls das jemand braucht.

Ich weis: es ist ein Hack und es wäre sauberer, wenn man die Knotenbetreiber erreichte um die Koordinaten zu korrigieren, aber manchmal ist dies einfach nicht mehr möglich, und es bliebe als alternative nur noch, die Keys aller angrenzenden uplinks zu sperren (meisst unakzeptabel)

Dieses alte Backend wird mit der übernächsten Gluon Version nicht mehr Funktionieren, man sollte also auf den meshviewer für den Graphen und die Liste umsteigen und die http://freifunk-karte.de für die Map (http://www.freifunk-emskirchen.de/de-map/)