Quellcode durchsuchen

Convert tag keys to keywords if possible.

Lucas Stadler vor 12 Jahren
Ursprung
Commit
ef4ee343c6
1 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen
  1. 2 2
      clj/paths.clj

+ 2 - 2
clj/paths.clj

@ -18,10 +18,10 @@
18 18
  (let [tags (filter #(= (:tag %) :tag) (:content osm-element))]
19 19
    (into {} (map #(-> (get+ (:attrs %) [:k :v])
20 20
                       ((fn [[k v]]
21
                          [(keyword k) v])))
21
                          [(or (keyword k) k) v])))
22 22
                  tags))))
23 23
24
(tags-as-map {:content [{:tag :tag, :attrs {:k :hey, :v 1}}, {:tag :tag, :attrs {:k :there, :v 2}}]})
24
(tags-as-map {:content [{:tag :tag, :attrs {:k "hey", :v 1}}, {:tag :tag, :attrs {:k :there, :v 2}}]})
25 25
26 26
(defn dev-prepare [& [path]]
27 27
  (let [path (or path "data/leipzig_highways.osm")]