From 77ceb54e136ceabb1202190e456276b44e6ae62b Mon Sep 17 00:00:00 2001 From: Tormod Mathiesen Date: Tue, 3 Jun 2025 10:20:40 +0200 Subject: [PATCH 1/2] Update numeric-tower to 0.1.0 and use namespace qualified names in deps --- deps.edn | 13 ++++++++----- project.clj | 2 +- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/deps.edn b/deps.edn index a9b76c4..7b37c82 100644 --- a/deps.edn +++ b/deps.edn @@ -2,17 +2,20 @@ {:1.7 {:extra-deps #:org.clojure{clojure #:mvn{:version "1.7.0"}}}, :1.8 {:extra-deps #:org.clojure{clojure #:mvn{:version "1.8.0"}}}, :1.9 {:extra-deps #:org.clojure{clojure #:mvn{:version "1.9.0"}}}, - :dev {:extra-deps {cheshire #:mvn{:version "5.9.0"}, - codox-theme-rdash #:mvn{:version "0.1.2"}, + :1.10 {:extra-deps #:org.clojure{clojure #:mvn{:version "1.10.0"}}}, + :1.11 {:extra-deps #:org.clojure{clojure #:mvn{:version "1.11.0"}}}, + :1.12 {:extra-deps #:org.clojure{clojure #:mvn{:version "1.12.0"}}}, + :dev {:extra-deps {cheshire/cheshire #:mvn{:version "5.9.0"}, + codox-theme-rdash/codox-theme-rdash #:mvn{:version "0.1.2"}, com.fasterxml.jackson.core/jackson-core #:mvn{:version "2.10.2"}, com.fasterxml.jackson.dataformat/jackson-dataformat-cbor #:mvn{:version "2.10.2"}, com.fasterxml.jackson.dataformat/jackson-dataformat-smile #:mvn{:version "2.10.2"}, - criterium #:mvn{:version "0.4.5"}, - midje #:mvn{:version "1.9.9"}, + criterium/criterium #:mvn{:version "0.4.5"}, + midje/midje #:mvn{:version "1.9.9"}, org.clojure/clojure #:mvn{:version "1.10.1"}}}}, :deps {ch.hsr/geohash #:mvn{:version "1.4.0"}, com.uber/h3 #:mvn{:version "3.6.3"}, - org.clojure/math.numeric-tower #:mvn{:version "0.0.4"}, + org.clojure/math.numeric-tower #:mvn{:version "0.1.0"}, org.locationtech.jts.io/jts-io-common #:mvn{:version "1.16.1"}, org.locationtech.jts/jts-core #:mvn{:version "1.16.1"}, org.locationtech.proj4j/proj4j #:mvn{:version "1.1.0"}, diff --git a/project.clj b/project.clj index 8ce7f1b..ad4a54f 100644 --- a/project.clj +++ b/project.clj @@ -7,7 +7,7 @@ :comments "same as Clojure"} :description "Geospatial operations over points, lines, polys, geohashes, etc." :dependencies - [[org.clojure/math.numeric-tower "0.0.4"] + [[org.clojure/math.numeric-tower "0.1.0"] [ch.hsr/geohash "1.4.0"] [com.uber/h3 "3.6.3"] [org.locationtech.proj4j/proj4j "1.1.0"] From cc3b212dafe865311395cb2789255799231b4621 Mon Sep 17 00:00:00 2001 From: Tormod Mathiesen Date: Tue, 3 Jun 2025 10:21:06 +0200 Subject: [PATCH 2/2] alias numeric-tower to make use of `abs` explicit --- src/geo/spatial.clj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/geo/spatial.clj b/src/geo/spatial.clj index f091842..16bbf8c 100644 --- a/src/geo/spatial.clj +++ b/src/geo/spatial.clj @@ -15,8 +15,8 @@ functions over shapes for their heights, centers, areas, etc. Can also compute relationships between shapes: their intersections, contains, disjoint statuses, etc." - (:use [clojure.math.numeric-tower :only [abs]]) - (:require [geo.crs :as crs] + (:require [clojure.math.numeric-tower :as numeric-tower] + [geo.crs :as crs] [geo.jts :as jts]) (:import (ch.hsr.geohash WGS84Point) (ch.hsr.geohash.util VincentyGeodesy) @@ -318,8 +318,8 @@ ; algorithm, which causes distances at the poles to return ; bad results. In these cases, use spatial4j's spherical vincenty ; distance calculator. - (if (and (<= (abs (latitude a)) 89.99999999999999) - (<= (abs (latitude b)) 89.99999999999999)) + (if (and (<= (numeric-tower/abs (latitude a)) 89.99999999999999) + (<= (numeric-tower/abs (latitude b)) 89.99999999999999)) (VincentyGeodesy/distanceInMeters (to-geohash-point a) (to-geohash-point b))