[Git][debian-gis-team/proj][experimental] 3 commits: Add upstream patch to implement fuzzy proj string comparison.

Bas Couwenberg gitlab at salsa.debian.org
Mon Feb 18 09:16:01 GMT 2019


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


Commits:
4188d34b by Bas Couwenberg at 2019-02-18T09:02:41Z
Add upstream patch to implement fuzzy proj string comparison.

- - - - -
dc4c589d by Bas Couwenberg at 2019-02-18T09:03:33Z
Update symbols for other architectures.

- - - - -
4b6c4da0 by Bas Couwenberg at 2019-02-18T09:03:43Z
Set distribution to experimental.

- - - - -


4 changed files:

- debian/changelog
- debian/libproj15.symbols
- + debian/patches/0001-tests-implement-fuzzy-proj-string-comparison-in-a-fe.patch
- debian/patches/series


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+proj (6.0.0~rc1-1~exp3) experimental; urgency=medium
+
+  * Add upstream patch to implement fuzzy proj string comparison.
+  * Update symbols for other architectures.
+
+ -- Bas Couwenberg <sebastic at debian.org>  Mon, 18 Feb 2019 10:03:34 +0100
+
 proj (6.0.0~rc1-1~exp2) experimental; urgency=medium
 
   * Add upstream patch to fix uniconvert test failure on some architectures.


=====================================
debian/libproj15.symbols
=====================================
The diff for this file was not included because it is too large.

=====================================
debian/patches/0001-tests-implement-fuzzy-proj-string-comparison-in-a-fe.patch
=====================================
@@ -0,0 +1,292 @@
+Description: tests: implement fuzzy proj string comparison in a few problematic test cases on non-x86 arch
+Author: Even Rouault <even.rouault at spatialys.com>
+Origin: https://github.com/OSGeo/proj.4/commit/1b272fc9ee5d25a0cb07d6d12df13c6a77eeb7f0
+Bug: https://github.com/OSGeo/proj.4/issues/1275
+
+--- a/test/unit/Makefile.am
++++ b/test/unit/Makefile.am
+@@ -2,7 +2,7 @@ AUTOMAKE_OPTIONS = subdir-objects
+ 
+ EXTRA_DIST = CMakeLists.txt
+ 
+-noinst_HEADERS = gtest_include.h
++noinst_HEADERS = gtest_include.h test_primitives.hpp
+ 
+ AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/include -I$(top_srcdir)/test @GTEST_CFLAGS@ @SQLITE3_CFLAGS@
+ AM_CXXFLAGS = @CXX_WFLAGS@ @NO_ZERO_AS_NULL_POINTER_CONSTANT_FLAG@
+--- a/test/unit/test_factory.cpp
++++ b/test/unit/test_factory.cpp
+@@ -28,6 +28,8 @@
+ 
+ #include "gtest_include.h"
+ 
++#include "test_primitives.hpp"
++
+ #include "proj/common.hpp"
+ #include "proj/coordinateoperation.hpp"
+ #include "proj/coordinatesystem.hpp"
+@@ -991,10 +993,12 @@ TEST(factory, AuthorityFactory_test_uom_
+     auto factory = AuthorityFactory::create(DatabaseContext::create(), "EPSG");
+     // This tests conversion from unit of measure EPSG:9110 DDD.MMSSsss
+     auto crs = factory->createProjectedCRS("2172");
+-    EXPECT_EQ(crs->exportToPROJString(PROJStringFormatter::create().get()),
+-              "+proj=sterea +lat_0=53.0019444444444 +lon_0=21.5027777777778 "
+-              "+k=0.9998 +x_0=4603000 +y_0=5806000 +ellps=krass +units=m "
+-              "+no_defs +type=crs");
++    EXPECT_PRED_FORMAT2(
++        ComparePROJString,
++        crs->exportToPROJString(PROJStringFormatter::create().get()),
++        "+proj=sterea +lat_0=53.0019444444444 +lon_0=21.5027777777778 "
++        "+k=0.9998 +x_0=4603000 +y_0=5806000 +ellps=krass +units=m "
++        "+no_defs +type=crs");
+ }
+ 
+ // ---------------------------------------------------------------------------
+--- a/test/unit/test_operation.cpp
++++ b/test/unit/test_operation.cpp
+@@ -28,8 +28,12 @@
+ 
+ #include "gtest_include.h"
+ 
++#include "test_primitives.hpp"
++
+ // to be able to use internal::replaceAll
++#ifndef FROM_PROJ_CPP
+ #define FROM_PROJ_CPP
++#endif
+ 
+ #include "proj/common.hpp"
+ #include "proj/coordinateoperation.hpp"
+@@ -4861,11 +4865,13 @@ TEST(operation, geocentricCRS_to_geocent
+         authFactory->createCoordinateReferenceSystem("4896"), ctxt);
+     ASSERT_EQ(list.size(), 1U);
+     EXPECT_EQ(list[0]->nameStr(), "ITRF2000 to ITRF2005 (1)");
+-    EXPECT_EQ(list[0]->exportToPROJString(PROJStringFormatter::create().get()),
+-              "+proj=helmert +x=-0.0001 "
+-              "+y=0.0008 +z=0.0058 +rx=0 +ry=0 +rz=0 +s=-0.0004 +dx=0.0002 "
+-              "+dy=-0.0001 +dz=0.0018 +drx=0 +dry=0 +drz=0 +ds=-8e-05 "
+-              "+t_epoch=2000 +convention=position_vector");
++    EXPECT_PRED_FORMAT2(
++        ComparePROJString,
++        list[0]->exportToPROJString(PROJStringFormatter::create().get()),
++        "+proj=helmert +x=-0.0001 "
++        "+y=0.0008 +z=0.0058 +rx=0 +ry=0 +rz=0 +s=-0.0004 +dx=0.0002 "
++        "+dy=-0.0001 +dz=0.0018 +drx=0 +dry=0 +drz=0 +ds=-8e-05 "
++        "+t_epoch=2000 +convention=position_vector");
+ }
+ 
+ // ---------------------------------------------------------------------------
+@@ -4904,15 +4910,17 @@ TEST(operation,
+               "Conversion from ITRF2000 (geog3D) to ITRF2000 (geocentric) + "
+               "ITRF2000 to ITRF2005 (1) + "
+               "Conversion from ITRF2005 (geocentric) to ITRF2005 (geog3D)");
+-    EXPECT_EQ(list[0]->exportToPROJString(PROJStringFormatter::create().get()),
+-              "+proj=pipeline +step +proj=axisswap +order=2,1 +step "
+-              "+proj=unitconvert +xy_in=deg +z_in=m +xy_out=rad +z_out=m "
+-              "+step +proj=cart +ellps=GRS80 +step +proj=helmert +x=-0.0001 "
+-              "+y=0.0008 +z=0.0058 +rx=0 +ry=0 +rz=0 +s=-0.0004 +dx=0.0002 "
+-              "+dy=-0.0001 +dz=0.0018 +drx=0 +dry=0 +drz=0 +ds=-8e-05 "
+-              "+t_epoch=2000 +convention=position_vector +step +inv "
+-              "+proj=cart +ellps=GRS80 +step +proj=unitconvert +xy_in=rad "
+-              "+z_in=m +xy_out=deg +z_out=m +step +proj=axisswap +order=2,1");
++    EXPECT_PRED_FORMAT2(
++        ComparePROJString,
++        list[0]->exportToPROJString(PROJStringFormatter::create().get()),
++        "+proj=pipeline +step +proj=axisswap +order=2,1 +step "
++        "+proj=unitconvert +xy_in=deg +z_in=m +xy_out=rad +z_out=m "
++        "+step +proj=cart +ellps=GRS80 +step +proj=helmert +x=-0.0001 "
++        "+y=0.0008 +z=0.0058 +rx=0 +ry=0 +rz=0 +s=-0.0004 +dx=0.0002 "
++        "+dy=-0.0001 +dz=0.0018 +drx=0 +dry=0 +drz=0 +ds=-8e-05 "
++        "+t_epoch=2000 +convention=position_vector +step +inv "
++        "+proj=cart +ellps=GRS80 +step +proj=unitconvert +xy_in=rad "
++        "+z_in=m +xy_out=deg +z_out=m +step +proj=axisswap +order=2,1");
+ }
+ 
+ // ---------------------------------------------------------------------------
+@@ -4930,13 +4938,15 @@ TEST(operation, geogCRS_to_geocentricCRS
+     EXPECT_EQ(list[0]->nameStr(),
+               "Conversion from ITRF2000 (geog3D) to ITRF2000 (geocentric) + "
+               "ITRF2000 to ITRF2005 (1)");
+-    EXPECT_EQ(list[0]->exportToPROJString(PROJStringFormatter::create().get()),
+-              "+proj=pipeline +step +proj=axisswap +order=2,1 +step "
+-              "+proj=unitconvert +xy_in=deg +z_in=m +xy_out=rad +z_out=m "
+-              "+step +proj=cart +ellps=GRS80 +step +proj=helmert +x=-0.0001 "
+-              "+y=0.0008 +z=0.0058 +rx=0 +ry=0 +rz=0 +s=-0.0004 +dx=0.0002 "
+-              "+dy=-0.0001 +dz=0.0018 +drx=0 +dry=0 +drz=0 +ds=-8e-05 "
+-              "+t_epoch=2000 +convention=position_vector");
++    EXPECT_PRED_FORMAT2(
++        ComparePROJString,
++        list[0]->exportToPROJString(PROJStringFormatter::create().get()),
++        "+proj=pipeline +step +proj=axisswap +order=2,1 +step "
++        "+proj=unitconvert +xy_in=deg +z_in=m +xy_out=rad +z_out=m "
++        "+step +proj=cart +ellps=GRS80 +step +proj=helmert +x=-0.0001 "
++        "+y=0.0008 +z=0.0058 +rx=0 +ry=0 +rz=0 +s=-0.0004 +dx=0.0002 "
++        "+dy=-0.0001 +dz=0.0018 +drx=0 +dry=0 +drz=0 +ds=-8e-05 "
++        "+t_epoch=2000 +convention=position_vector");
+ }
+ 
+ // ---------------------------------------------------------------------------
+@@ -4954,13 +4964,15 @@ TEST(operation, geocentricCRS_to_geogCRS
+     EXPECT_EQ(list[0]->nameStr(),
+               "ITRF2000 to ITRF2005 (1) + "
+               "Conversion from ITRF2005 (geocentric) to ITRF2005 (geog3D)");
+-    EXPECT_EQ(list[0]->exportToPROJString(PROJStringFormatter::create().get()),
+-              "+proj=pipeline +step +proj=helmert +x=-0.0001 "
+-              "+y=0.0008 +z=0.0058 +rx=0 +ry=0 +rz=0 +s=-0.0004 +dx=0.0002 "
+-              "+dy=-0.0001 +dz=0.0018 +drx=0 +dry=0 +drz=0 +ds=-8e-05 "
+-              "+t_epoch=2000 +convention=position_vector +step +inv "
+-              "+proj=cart +ellps=GRS80 +step +proj=unitconvert +xy_in=rad "
+-              "+z_in=m +xy_out=deg +z_out=m +step +proj=axisswap +order=2,1");
++    EXPECT_PRED_FORMAT2(
++        ComparePROJString,
++        list[0]->exportToPROJString(PROJStringFormatter::create().get()),
++        "+proj=pipeline +step +proj=helmert +x=-0.0001 "
++        "+y=0.0008 +z=0.0058 +rx=0 +ry=0 +rz=0 +s=-0.0004 +dx=0.0002 "
++        "+dy=-0.0001 +dz=0.0018 +drx=0 +dry=0 +drz=0 +ds=-8e-05 "
++        "+t_epoch=2000 +convention=position_vector +step +inv "
++        "+proj=cart +ellps=GRS80 +step +proj=unitconvert +xy_in=rad "
++        "+z_in=m +xy_out=deg +z_out=m +step +proj=axisswap +order=2,1");
+ }
+ 
+ // ---------------------------------------------------------------------------
+@@ -4984,21 +4996,23 @@ TEST(operation, esri_projectedCRS_to_geo
+               "(geocentric) + Inverse of ITRF2000 to NAD83(CORS96) (1) + "
+               "ITRF2000 to ITRF2005 (1) + "
+               "Conversion from ITRF2005 (geocentric) to ITRF2005 (geog3D)");
+-    EXPECT_EQ(list[0]->exportToPROJString(PROJStringFormatter::create().get()),
+-              "+proj=pipeline +step +proj=unitconvert +xy_in=us-ft +z_in=us-ft "
+-              "+xy_out=m +z_out=m +step +inv +proj=lcc +lat_0=33.75 +lon_0=-79 "
+-              "+lat_1=34.3333333333333 +lat_2=36.1666666666667 "
+-              "+x_0=609601.219202438 +y_0=0 +ellps=GRS80 +step +proj=cart "
+-              "+ellps=GRS80 +step +inv +proj=helmert +x=0.9956 +y=-1.9013 "
+-              "+z=-0.5215 +rx=0.025915 +ry=0.009426 +rz=0.011599 +s=0.00062 "
+-              "+dx=0.0007 +dy=-0.0007 +dz=0.0005 +drx=6.7e-05 +dry=-0.000757 "
+-              "+drz=-5.1e-05 +ds=-0.00018 +t_epoch=1997 "
+-              "+convention=coordinate_frame +step +proj=helmert +x=-0.0001 "
+-              "+y=0.0008 +z=0.0058 +rx=0 +ry=0 +rz=0 +s=-0.0004 +dx=0.0002 "
+-              "+dy=-0.0001 +dz=0.0018 +drx=0 +dry=0 +drz=0 +ds=-8e-05 "
+-              "+t_epoch=2000 +convention=position_vector +step +inv +proj=cart "
+-              "+ellps=GRS80 +step +proj=unitconvert +xy_in=rad +z_in=m "
+-              "+xy_out=deg +z_out=m +step +proj=axisswap +order=2,1");
++    EXPECT_PRED_FORMAT2(
++        ComparePROJString,
++        list[0]->exportToPROJString(PROJStringFormatter::create().get()),
++        "+proj=pipeline +step +proj=unitconvert +xy_in=us-ft +z_in=us-ft "
++        "+xy_out=m +z_out=m +step +inv +proj=lcc +lat_0=33.75 +lon_0=-79 "
++        "+lat_1=34.3333333333333 +lat_2=36.1666666666667 "
++        "+x_0=609601.219202438 +y_0=0 +ellps=GRS80 +step +proj=cart "
++        "+ellps=GRS80 +step +inv +proj=helmert +x=0.9956 +y=-1.9013 "
++        "+z=-0.5215 +rx=0.025915 +ry=0.009426 +rz=0.011599 +s=0.00062 "
++        "+dx=0.0007 +dy=-0.0007 +dz=0.0005 +drx=6.7e-05 +dry=-0.000757 "
++        "+drz=-5.1e-05 +ds=-0.00018 +t_epoch=1997 "
++        "+convention=coordinate_frame +step +proj=helmert +x=-0.0001 "
++        "+y=0.0008 +z=0.0058 +rx=0 +ry=0 +rz=0 +s=-0.0004 +dx=0.0002 "
++        "+dy=-0.0001 +dz=0.0018 +drx=0 +dry=0 +drz=0 +ds=-8e-05 "
++        "+t_epoch=2000 +convention=position_vector +step +inv +proj=cart "
++        "+ellps=GRS80 +step +proj=unitconvert +xy_in=rad +z_in=m "
++        "+xy_out=deg +z_out=m +step +proj=axisswap +order=2,1");
+ }
+ 
+ // ---------------------------------------------------------------------------
+--- /dev/null
++++ b/test/unit/test_primitives.hpp
+@@ -0,0 +1,99 @@
++/******************************************************************************
++ *
++ * Project:  PROJ
++ * Purpose:  Test ISO19111:2018 implementation
++ * Author:   Even Rouault <even dot rouault at spatialys dot com>
++ *
++ ******************************************************************************
++ * Copyright (c) 2018, Even Rouault <even dot rouault at spatialys dot com>
++ *
++ * Permission is hereby granted, free of charge, to any person obtaining a
++ * copy of this software and associated documentation files (the "Software"),
++ * to deal in the Software without restriction, including without limitation
++ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
++ * and/or sell copies of the Software, and to permit persons to whom the
++ * Software is furnished to do so, subject to the following conditions:
++ *
++ * The above copyright notice and this permission notice shall be included
++ * in all copies or substantial portions of the Software.
++ *
++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
++ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
++ * DEALINGS IN THE SOFTWARE.
++ ****************************************************************************/
++
++#include "gtest_include.h"
++
++#ifndef FROM_PROJ_CPP
++#define FROM_PROJ_CPP
++#endif
++
++#include "proj/internal/internal.hpp"
++
++#include <cmath>
++#include <cstdlib>
++
++using namespace osgeo::proj::internal;
++
++static ::testing::AssertionResult ComparePROJString(const char* m_expr,
++                                                    const char* n_expr,
++                                                    const std::string& m,
++                                                    const std::string& n) {
++    //if (m == n) return ::testing::AssertionSuccess();
++    auto mTokens = split(m, ' ');
++    auto nTokens = split(n, ' ');
++    if( mTokens.size() == nTokens.size() )
++    {
++        bool success = true;
++        for( size_t i = 0; i < mTokens.size(); i++ )
++        {
++            auto mSubTokens = split(mTokens[i], '=');
++            auto nSubTokens = split(nTokens[i], '=');
++            if( mSubTokens.size() != nSubTokens.size() ) {
++                success = false;
++                break;
++            }
++            if( mSubTokens.size() == 2 && nSubTokens.size() == 2 ) {
++                if( mSubTokens[0] != nSubTokens[0] ) {
++                    success = false;
++                    break;
++                }
++                double mValue = 0.0;
++                bool mIsDouble = false;
++                try {
++                    mValue = c_locale_stod(mSubTokens[1]);
++                    mIsDouble = true;
++                } catch( const std::exception &) {}
++                double nValue = 0.0;
++                bool nIsDouble = false;
++                try {
++                    nValue = c_locale_stod(nSubTokens[1]);
++                    nIsDouble = true;
++                } catch( const std::exception &) {}
++                if( mIsDouble != nIsDouble ) {
++                    success = false;
++                    break;
++                }
++                if( mIsDouble ) {
++                    success = std::abs(mValue - nValue) <= 1e-14 * std::abs(mValue);
++                } else {
++                    success = mSubTokens[1] == nSubTokens[1];
++                }
++                if( !success ) {
++                    break;
++                }
++            }
++        }
++
++        if( success ) {
++            return ::testing::AssertionSuccess();
++        }
++    }
++
++    return ::testing::AssertionFailure() << m_expr << " and " << n_expr
++        << " (" << m << " and " << n << ") are different";
++}


=====================================
debian/patches/series
=====================================
@@ -1 +1,2 @@
 0001-Slack-tolerance-in-deg-rad-unitconvert-test.patch
+0001-tests-implement-fuzzy-proj-string-comparison-in-a-fe.patch



View it on GitLab: https://salsa.debian.org/debian-gis-team/proj/compare/ec2d9c27d346caa64a8a1d8c0679b3daf07129ab...4b6c4da0280283ac3a991dd686721d073efe289e

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/proj/compare/ec2d9c27d346caa64a8a1d8c0679b3daf07129ab...4b6c4da0280283ac3a991dd686721d073efe289e
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/20190218/341565ba/attachment-0001.html>


More information about the Pkg-grass-devel mailing list