File tree 2 files changed +6
-5
lines changed
2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ impl CoordTransform {
44
44
assert_eq ! (
45
45
nb_coords,
46
46
y. len( ) ,
47
- "transform coordinate slices have different length : {} != {}" ,
47
+ "transform coordinate slices have different lengths : {} != {}" ,
48
48
nb_coords,
49
49
y. len( )
50
50
) ;
@@ -60,7 +60,7 @@ impl CoordTransform {
60
60
assert_eq ! (
61
61
nb_coords,
62
62
z. len( ) ,
63
- "transform coordinate slices have different length : {} != {}" ,
63
+ "transform coordinate slices have different lengths : {} != {}" ,
64
64
nb_coords,
65
65
z. len( )
66
66
) ;
Original file line number Diff line number Diff line change @@ -80,11 +80,13 @@ fn transform_coordinates() {
80
80
let transform = CoordTransform :: new ( & spatial_ref1, & spatial_ref2) . unwrap ( ) ;
81
81
let mut xs = [ 23.43 , 23.50 ] ;
82
82
let mut ys = [ 37.58 , 37.70 ] ;
83
+ let mut zs = [ 32.0 , 20.0 ] ;
83
84
transform
84
- . transform_coords ( & mut xs, & mut ys, & mut [ ] )
85
+ . transform_coords ( & mut xs, & mut ys, & mut zs )
85
86
. unwrap ( ) ;
86
87
assert_almost_eq ( xs[ 0 ] , 5509543.1508097 ) ;
87
88
assert_almost_eq ( ys[ 0 ] , 1716062.1916192223 ) ;
89
+ assert_almost_eq ( zs[ 0 ] , 32.0 ) ;
88
90
}
89
91
90
92
#[ test]
@@ -169,10 +171,9 @@ fn failing_transformation() {
169
171
170
172
let mut x = [ 1000000.0 ] ;
171
173
let mut y = [ 1000000.0 ] ;
172
- let mut z = [ 0.0 ] ;
173
174
174
175
let trafo = CoordTransform :: new ( & wgs84, & webmercator) . unwrap ( ) ;
175
- let r = trafo. transform_coords ( & mut x, & mut y, & mut z ) ;
176
+ let r = trafo. transform_coords ( & mut x, & mut y, & mut [ ] ) ;
176
177
177
178
assert ! ( r. is_err( ) ) ;
178
179
if let GdalError :: InvalidCoordinateRange { .. } = r. unwrap_err ( ) {
You can’t perform that action at this time.
0 commit comments