@@ -325,20 +325,14 @@ fn get_meta(path: &PathBuf) -> Result<Meta, FileError> {
325
325
) ,
326
326
& path,
327
327
) ?;
328
- let mut zoom_and_ifd: HashMap < u8 , usize > = HashMap :: new ( ) ;
329
- let mut zoom_and_tile_across_down: HashMap < u8 , ( u32 , u32 ) > = HashMap :: new ( ) ;
330
-
331
328
let nodata: Option < f64 > = if let Ok ( no_data) = decoder. get_tag_ascii_string ( GdalNodata ) {
332
329
no_data. parse ( ) . ok ( )
333
330
} else {
334
331
None
335
332
} ;
336
333
337
- let images_ifd = get_images_ifd ( & mut decoder, path) ;
338
-
339
334
let origin = get_origin ( tie_points. as_deref ( ) , transformations. as_deref ( ) , path) ?;
340
335
341
- let mut resolutions = HashMap :: new ( ) ;
342
336
let full_resolution =
343
337
get_full_resolution ( pixel_scale. as_deref ( ) , transformations. as_deref ( ) , path) ?;
344
338
let ( full_width_pixel, full_length_pixel) = decoder. dimensions ( ) . map_err ( |e| {
@@ -359,6 +353,12 @@ fn get_meta(path: &PathBuf) -> Result<Meta, FileError> {
359
353
( full_width_pixel, full_length_pixel) ,
360
354
( full_width, full_length) ,
361
355
) ;
356
+ let mut zoom_and_ifd: HashMap < u8 , usize > = HashMap :: new ( ) ;
357
+ let mut zoom_and_tile_across_down: HashMap < u8 , ( u32 , u32 ) > = HashMap :: new ( ) ;
358
+
359
+ let mut resolutions = HashMap :: new ( ) ;
360
+
361
+ let images_ifd = get_images_ifd ( & mut decoder, path) ;
362
362
363
363
for ( idx, image_ifd) in images_ifd. iter ( ) . enumerate ( ) {
364
364
decoder
@@ -736,6 +736,54 @@ mod tests {
736
736
737
737
let meta = super :: get_meta ( & path) . unwrap ( ) ;
738
738
739
- assert_yaml_snapshot ! ( meta, @r###""### )
739
+ assert_yaml_snapshot ! ( meta, @r###"
740
+ min_zoom: 0
741
+ max_zoom: 3
742
+ resolutions:
743
+ 2:
744
+ - 20
745
+ - 20
746
+ - 0
747
+ 1:
748
+ - 40
749
+ - 40
750
+ - 0
751
+ 0:
752
+ - 10
753
+ - 10
754
+ - 0
755
+ 3:
756
+ - 10
757
+ - 10
758
+ - 0
759
+ zoom_and_ifd:
760
+ 3: 0
761
+ 1: 2
762
+ 0: 3
763
+ 2: 1
764
+ zoom_and_tile_across_down:
765
+ 0:
766
+ - 1
767
+ - 1
768
+ 2:
769
+ - 1
770
+ - 1
771
+ 1:
772
+ - 1
773
+ - 1
774
+ 3:
775
+ - 2
776
+ - 2
777
+ nodata: ~
778
+ origin:
779
+ - 1620750.2508
780
+ - 4277012.7153
781
+ - 0
782
+ extent:
783
+ - 1620750.2508
784
+ - 4277012.7153
785
+ - 1625870.2508
786
+ - 4282132.7153
787
+ "### )
740
788
}
741
789
}
0 commit comments