From f17e7c70fc32965610cfdc07ad98dc42a340cb35 Mon Sep 17 00:00:00 2001 From: didier amyot Date: Thu, 2 Jan 2025 13:12:38 -0500 Subject: [PATCH] going somewhere --- duckdb/metro.sql | 2 +- flake.nix | 16 ---------------- scripts/to-geojson.clj | 7 +------ 3 files changed, 2 insertions(+), 23 deletions(-) diff --git a/duckdb/metro.sql b/duckdb/metro.sql index c2e10fa..3d557e5 100644 --- a/duckdb/metro.sql +++ b/duckdb/metro.sql @@ -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' diff --git a/flake.nix b/flake.nix index 36f0eb1..ad37df5 100644 --- a/flake.nix +++ b/flake.nix @@ -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; }; diff --git a/scripts/to-geojson.clj b/scripts/to-geojson.clj index d211de0..c338283 100644 --- a/scripts/to-geojson.clj +++ b/scripts/to-geojson.clj @@ -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)))