[Git][debian-gis-team/proj][experimental] 2 commits: Add upstream patch to fix test failures on arm/mips.

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Wed Feb 22 17:59:22 GMT 2023



Bas Couwenberg pushed to branch experimental at Debian GIS Project / proj


Commits:
f5bd49a9 by Bas Couwenberg at 2023-02-22T18:43:35+01:00
Add upstream patch to fix test failures on arm/mips.

- - - - -
7a17a235 by Bas Couwenberg at 2023-02-22T18:43:47+01:00
Set distribution to experimental.

- - - - -


3 changed files:

- debian/changelog
- + debian/patches/pr3633.patch
- + debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,9 @@
+proj (9.2.0~rc1-1~exp2) experimental; urgency=medium
+
+  * Add upstream patch to fix test failures on arm/mips.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Wed, 22 Feb 2023 18:43:36 +0100
+
 proj (9.2.0~rc1-1~exp1) experimental; urgency=medium
 
   * New upstream release candidate.


=====================================
debian/patches/pr3633.patch
=====================================
@@ -0,0 +1,84 @@
+Description: JSON/WKT: avoid precision issues on non-Intel architectures on coordinate epochs
+Author: Even Rouault <even.rouault at spatialys.com>
+Origin: https://github.com/OSGeo/PROJ/pull/3633
+Bug: https://github.com/OSGeo/PROJ/issues/3632
+
+--- a/src/iso19111/coordinates.cpp
++++ b/src/iso19111/coordinates.cpp
+@@ -40,6 +40,7 @@
+ 
+ #include "proj_json_streaming_writer.hpp"
+ 
++#include <cmath>
+ #include <limits>
+ 
+ using namespace NS_PROJ::internal;
+@@ -149,6 +150,17 @@ CoordinateMetadata::coordinateEpoch() PR
+ 
+ // ---------------------------------------------------------------------------
+ 
++// Avoid rounding issues due to year -> second (SI unit) -> year roundtrips
++static double getRoundedEpochInDecimalYear(double year) {
++    // Try to see if the value is close to xxxx.yyy decimal year.
++    if (std::fabs(1000 * year - std::round(1000 * year)) <= 1e-3) {
++        year = std::round(1000 * year) / 1000.0;
++    }
++    return year;
++}
++
++// ---------------------------------------------------------------------------
++
+ /** \brief Get the coordinate epoch associated with this CoordinateMetadata
+  * object, as decimal year.
+  *
+@@ -157,8 +169,9 @@ CoordinateMetadata::coordinateEpoch() PR
+  */
+ double CoordinateMetadata::coordinateEpochAsDecimalYear() PROJ_PURE_DEFN {
+     if (d->coordinateEpoch_.has_value()) {
+-        return d->coordinateEpoch_->coordinateEpoch().convertToUnit(
+-            common::UnitOfMeasure::YEAR);
++        return getRoundedEpochInDecimalYear(
++            d->coordinateEpoch_->coordinateEpoch().convertToUnit(
++                common::UnitOfMeasure::YEAR));
+     }
+     return std::numeric_limits<double>::quiet_NaN();
+ }
+--- a/src/iso19111/datum.cpp
++++ b/src/iso19111/datum.cpp
+@@ -119,11 +119,23 @@ void Datum::Private::exportAnchorDefinit
+ 
+ // ---------------------------------------------------------------------------
+ 
++// Avoid rounding issues due to year -> second (SI unit) -> year roundtrips
++static double getRoundedEpochInDecimalYear(double year) {
++    // Try to see if the value is close to xxxx.yyy decimal year.
++    if (std::fabs(1000 * year - std::round(1000 * year)) <= 1e-3) {
++        year = std::round(1000 * year) / 1000.0;
++    }
++    return year;
++}
++
++// ---------------------------------------------------------------------------
++
+ void Datum::Private::exportAnchorEpoch(io::WKTFormatter *formatter) const {
+     if (anchorEpoch->has_value()) {
+         formatter->startNode(io::WKTConstants::ANCHOREPOCH, false);
+-        formatter->add(
+-            (*anchorEpoch)->convertToUnit(common::UnitOfMeasure::YEAR));
++        const double year =
++            (*anchorEpoch)->convertToUnit(common::UnitOfMeasure::YEAR);
++        formatter->add(getRoundedEpochInDecimalYear(year));
+         formatter->endNode();
+     }
+ }
+@@ -145,7 +157,9 @@ void Datum::Private::exportAnchorEpoch(i
+     if (anchorEpoch->has_value()) {
+         auto writer = formatter->writer();
+         writer->AddObjKey("anchor_epoch");
+-        writer->Add((*anchorEpoch)->convertToUnit(common::UnitOfMeasure::YEAR));
++        const double year =
++            (*anchorEpoch)->convertToUnit(common::UnitOfMeasure::YEAR);
++        writer->Add(getRoundedEpochInDecimalYear(year));
+     }
+ }
+ 


=====================================
debian/patches/series
=====================================
@@ -0,0 +1 @@
+pr3633.patch



View it on GitLab: https://salsa.debian.org/debian-gis-team/proj/-/compare/7193dfb870e0a2d5a8511b93e32e1428b8692828...7a17a2359423b3dfa6b37e3107e3bd7d0c7bd1ad

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/proj/-/compare/7193dfb870e0a2d5a8511b93e32e1428b8692828...7a17a2359423b3dfa6b37e3107e3bd7d0c7bd1ad
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20230222/36ad913e/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list