Add upstream patches to fix test failures.
Bas Couwenberg
5 years ago
0 | libgeotiff (1.5.1-1~exp2) UNRELEASED; urgency=medium | |
1 | ||
2 | * Add upstream patches to fix test failures. | |
3 | ||
4 | -- Bas Couwenberg <sebastic@debian.org> Tue, 02 Apr 2019 06:57:53 +0200 | |
5 | ||
0 | 6 | libgeotiff (1.5.1-1~exp1) experimental; urgency=medium |
1 | 7 | |
2 | 8 | * New upstream release. |
0 | Description: GTIFDecToDMS(): avoid invalid double->int cast on invalid coordinates | |
1 | Author: Even Rouault <even.rouault@spatialys.com> | |
2 | Origin: https://github.com/OSGeo/libgeotiff/commit/4b41ca6ce332f0c21504c2da3da850275d9da5ae | |
3 | Bug: https://github.com/OSGeo/libgeotiff/issues/16 | |
4 | ||
5 | --- a/bin/listgeo.c | |
6 | +++ b/bin/listgeo.c | |
7 | @@ -198,8 +198,16 @@ static int GTIFReportACorner( GTIF *gtif | |
8 | } | |
9 | else | |
10 | { | |
11 | - fprintf( fp_out, " (%s,", GTIFDecToDMS( x, "Long", 2 ) ); | |
12 | - fprintf( fp_out, "%s)", GTIFDecToDMS( y, "Lat", 2 ) ); | |
13 | + const char* pszLong = GTIFDecToDMS( x, "Long", 2 ); | |
14 | + if( pszLong[0] == 0 ) | |
15 | + { | |
16 | + fprintf( fp_out, " (invalid)" ); | |
17 | + } | |
18 | + else | |
19 | + { | |
20 | + fprintf( fp_out, " (%s,", pszLong ); | |
21 | + fprintf( fp_out, "%s)", GTIFDecToDMS( y, "Lat", 2 ) ); | |
22 | + } | |
23 | } | |
24 | } | |
25 | ||
26 | --- a/geo_normalize.c | |
27 | +++ b/geo_normalize.c | |
28 | @@ -2721,6 +2721,9 @@ const char *GTIFDecToDMS( double dfAngle | |
29 | double dfRound; | |
30 | int i; | |
31 | ||
32 | + if( !(dfAngle >= -360 && dfAngle <= 360) ) | |
33 | + return ""; | |
34 | + | |
35 | dfRound = 0.5/60; | |
36 | for( i = 0; i < nPrecision; i++ ) | |
37 | dfRound = dfRound * 0.1; | |
38 | --- a/test/testlistgeo_out.dist | |
39 | +++ b/test/testlistgeo_out.dist | |
40 | @@ -221,11 +221,11 @@ Prime Meridian: 8901/Greenwich (0.000000 | |
41 | Projection Linear Units: 9036/kilometre (1000.000000m) | |
42 | ||
43 | Corner Coordinates: | |
44 | -Upper Left ( 440720.000, 3751320.000) (-2147483648d-2147483648' inf"E,-2147483648d-2147483648' inf"N) | |
45 | -Lower Left ( 440720.000, 3751260.000) (-2147483648d-2147483648' inf"E,-2147483648d-2147483648' inf"N) | |
46 | -Upper Right ( 440780.000, 3751320.000) (-2147483648d-2147483648' inf"E,-2147483648d-2147483648' inf"N) | |
47 | -Lower Right ( 440780.000, 3751260.000) (-2147483648d-2147483648' inf"E,-2147483648d-2147483648' inf"N) | |
48 | -Center ( 440750.000, 3751290.000) (-2147483648d-2147483648' inf"E,-2147483648d-2147483648' inf"N) | |
49 | +Upper Left ( 440720.000, 3751320.000) (invalid) | |
50 | +Lower Left ( 440720.000, 3751260.000) (invalid) | |
51 | +Upper Right ( 440780.000, 3751320.000) (invalid) | |
52 | +Lower Right ( 440780.000, 3751260.000) (invalid) | |
53 | +Center ( 440750.000, 3751290.000) (invalid) | |
54 | ||
55 | Testing listgeo ../test/data/ProjectedCSTypeGeoKey_28191_cassini_soldner.tif | |
56 | Geotiff_Information: |
0 | Description: GTIFDecToDMS(): fix rounding issue | |
1 | Author: Even Rouault <even.rouault@spatialys.com> | |
2 | Origin https://github.com/OSGeo/libgeotiff/commit/7cb9b68ea72fb2a6023bb98796fd3ba6dc7b64a1 | |
3 | Bug: https://github.com/OSGeo/libgeotiff/issues/16 | |
4 | ||
5 | --- a/geo_normalize.c | |
6 | +++ b/geo_normalize.c | |
7 | @@ -2727,6 +2727,11 @@ const char *GTIFDecToDMS( double dfAngle | |
8 | ||
9 | nDegrees = (int) ABS(dfAngle); | |
10 | nMinutes = (int) ((ABS(dfAngle) - nDegrees) * 60 + dfRound); | |
11 | + if( nMinutes == 60 ) | |
12 | + { | |
13 | + nDegrees ++; | |
14 | + nMinutes = 0; | |
15 | + } | |
16 | dfSeconds = ABS((ABS(dfAngle) * 3600 - nDegrees*3600 - nMinutes*60)); | |
17 | ||
18 | if( EQUAL(pszAxis,"Long") && dfAngle < 0.0 ) | |
19 | --- a/test/testlistgeo_out.dist | |
20 | +++ b/test/testlistgeo_out.dist | |
21 | @@ -1429,7 +1429,7 @@ PCS = 2046 (Hartebeesthoek94 / Lo15) | |
22 | Projection = 17515 (South African Survey Grid zone 15) | |
23 | Projection Method: CT_TransvMercator_SouthOrientated | |
24 | ProjNatOriginLatGeoKey: 0.000000 ( 0d 0' 0.00"N) | |
25 | - ProjNatOriginLongGeoKey: 15.000000 ( 14d60' 0.00"E) | |
26 | + ProjNatOriginLongGeoKey: 15.000000 ( 15d 0' 0.00"E) | |
27 | ProjScaleAtNatOriginGeoKey: 1.000000 | |
28 | ProjFalseEastingGeoKey: 0.000000 m | |
29 | ProjFalseNorthingGeoKey: 0.000000 m | |
30 | @@ -1791,7 +1791,7 @@ Geotiff_Information: | |
31 | PCS = 3410 (NSIDC EASE-Grid Global) | |
32 | Projection = 19869 (US NSIDC Equal Area global projection) | |
33 | Projection Method: CT_CylindricalEqualArea | |
34 | - ProjStdParallel1GeoKey: 30.000000 ( 29d60' 0.00"N) | |
35 | + ProjStdParallel1GeoKey: 30.000000 ( 30d 0' 0.00"N) | |
36 | ProjNatOriginLongGeoKey: 0.000000 ( 0d 0' 0.00"E) | |
37 | ProjFalseEastingGeoKey: 0.000000 m | |
38 | ProjFalseNorthingGeoKey: 0.000000 m |