going somewhere

This commit is contained in:
didier committed 2025-01-02 13:12:38 -05:00
1 parent a92eee0479
commit f17e7c70fc
3 files changed
+2 -23

No files matched your search

+1 -1
View File
@@ -13,7 +13,7 @@ CREATE OR REPLACE VIEW osm_quebec AS (
CREATE OR REPLACE VIEW roads AS (
WITH
interresting_ways AS (SELECT * FROM osm_quebec
interresting_ways AS (SELECT * FROM osm1_quebec
WHERE (
tags['highway'][1] = 'residential'
OR tags['highway'][1] = 'primary'
-16
View File
@@ -47,21 +47,6 @@
};
data-dir = pkgs.stdenv.mkDerivation {
name = "data-dir";
src = ./scripts;
buildInputs = [ poly2geojson ];
buildPhase = ''
mkdir -p cities/canada/quebec
${pkgs.babashka}/bin/bb to-geojson.clj ${quebec-cities-poly}/canada/québec/* > cities.json
'';
installPhase = ''
mkdir -p $out/data
cp ${quebec-osm-data} $out/data/quebec.osm.pbf
cp cities.json $out/data
'';
};
dati = pkgs.stdenv.mkDerivation {
name = "data-dir";
src = ./scripts;
buildInputs = [ poly2geojson pkgs.jdk23 osmosis ];
@@ -87,7 +72,6 @@
in {
packages = {
default = data-dir;
dati = dati;
poly2geojson = poly2geojson;
osmosis = osmosis;
};
+1 -6
View File
@@ -18,10 +18,6 @@
:province "québec"
:cityName city-name}))
;; ${osmosis}/bin/osmosis --read-pbf-fast file="${quebec-osm-data}" \
;; --bounding-polygon file="cities/canada/quebec/westmount_quebec.poly" \
;; --write-pbf file="cities/canada/quebec/westmount_quebec.osm.pbf"
(defn extract-osm-pbf [osm-file file]
(let [output-file (strings/replace file ".poly" ".osm.pbf")]
(println "Processing " file " file to " output-file)
@@ -33,9 +29,8 @@
"--write-pbf"
(str "file=" output-file))))
(def opts (cli/parse-opts *command-line-args* {:coerce {:paths []}}))
(doall (map
(doall (pmap
#(extract-osm-pbf (:osm-file opts) %)
(:paths opts)))