From 159acf91b2444e7d5bb7c8d46fbeafad63237c8c Mon Sep 17 00:00:00 2001 From: Vincent Privat Date: Mon, 20 Jun 2022 00:28:45 +0200 Subject: [PATCH] Add GeoTIFF test using sample data from OSGEO/libgeotiff --- Tests/Data/GeogToWGS84GeoKey5.lgo | 31 ++++++ Tests/Data/GeogToWGS84GeoKey5.tif | Bin 0 -> 4058 bytes Tests/Data/GeogToWGS84GeoKey5.txt | 10 ++ .../GeogAngularUnitsGeoKey_9114.tif | Bin 0 -> 312 bytes .../libgeotiff/GeogGeodeticDatumGeoKey.tif | Bin 0 -> 312 bytes .../libgeotiff/GeogPrimeMeridianGeoKey.tif | Bin 0 -> 441 bytes .../libgeotiff/ProjLinearUnitsGeoKey_9036.tif | Bin 0 -> 362 bytes ...046_transverse_mercator_south_oriented.tif | Bin 0 -> 288 bytes ...eGeoKey_27200_new_zealand_mapping_grid.tif | Bin 0 -> 288 bytes ...ctedCSTypeGeoKey_28191_cassini_soldner.tif | Bin 0 -> 288 bytes .../ProjectedCSTypeGeoKey_29101_polyconic.tif | Bin 0 -> 288 bytes ...Key_3032_polar_stereographic_variant_b.tif | Bin 0 -> 288 bytes ...oKey_3035_lambert_azimuthal_equal_area.tif | Bin 0 -> 288 bytes ...tedCSTypeGeoKey_3083_albers_equal_area.tif | Bin 0 -> 288 bytes ...ey_3410_lambert_cylindrical_equal_area.tif | Bin 0 -> 288 bytes .../ProjectedCSTypeGeoKey_3812_lcc2sp.tif | Bin 0 -> 288 bytes ...dCSTypeGeoKey_3814_transverse_mercator.tif | Bin 0 -> 288 bytes ...ypeGeoKey_4087_equidistant_cylindrical.tif | Bin 0 -> 288 bytes ...ProjectedCSTypeGeoKey_5329_mercator1sp.tif | Bin 0 -> 288 bytes .../ProjectedCSTypeGeoKey_5456_lcc1sp.tif | Bin 0 -> 288 bytes ...Key_5482_polar_stereographic_variant_a.tif | Bin 0 -> 288 bytes ...STypeGeoKey_5588_oblique_stereographic.tif | Bin 0 -> 288 bytes ...ProjectedCSTypeGeoKey_5641_mercator2sp.tif | Bin 0 -> 288 bytes ...6808_hotine_oblique_mercator_variant_a.tif | Bin 0 -> 288 bytes ...8065_hotine_oblique_mercator_variant_b.tif | Bin 0 -> 288 bytes ...peGeoKey_8441_oblique_mercator_laborde.tif | Bin 0 -> 288 bytes Tests/Data/libgeotiff/albers_equal_area.tif | Bin 0 -> 542 bytes Tests/Data/libgeotiff/byte.tif | Bin 0 -> 736 bytes Tests/Data/libgeotiff/byte_v11.tif | Bin 0 -> 736 bytes Tests/Data/libgeotiff/cassini_soldner.tif | Bin 0 -> 595 bytes .../libgeotiff/equidistant_cylindrical.tif | Bin 0 -> 526 bytes .../hotine_oblique_mercator_variant_a.tif | Bin 0 -> 578 bytes .../hotine_oblique_mercator_variant_b.tif | Bin 0 -> 563 bytes .../lambert_azimuthal_equal_area.tif | Bin 0 -> 492 bytes .../lambert_cylindrical_equal_area.tif | Bin 0 -> 539 bytes Tests/Data/libgeotiff/lcc1sp.tif | Bin 0 -> 531 bytes Tests/Data/libgeotiff/lcc2sp.tif | Bin 0 -> 533 bytes Tests/Data/libgeotiff/mercator1sp.tif | Bin 0 -> 522 bytes Tests/Data/libgeotiff/mercator2sp.tif | Bin 0 -> 522 bytes .../libgeotiff/new_zealand_mapping_grid.tif | Bin 0 -> 535 bytes .../libgeotiff/oblique_mercator_laborde.tif | Bin 0 -> 533 bytes .../Data/libgeotiff/oblique_stereographic.tif | Bin 0 -> 538 bytes Tests/Data/libgeotiff/pcs_32064.tif | Bin 0 -> 361 bytes .../Data/libgeotiff/pixel_is_point_wgs84.tif | Bin 0 -> 298 bytes .../polar_stereographic_variant_a.tif | Bin 0 -> 511 bytes .../polar_stereographic_variant_b.tif | Bin 0 -> 537 bytes Tests/Data/libgeotiff/polyconic.tif | Bin 0 -> 511 bytes Tests/Data/libgeotiff/transverse_mercator.tif | Bin 0 -> 509 bytes .../transverse_mercator_south_oriented.tif | Bin 0 -> 521 bytes .../drew/metadata/geotiff/GeoTiffTest.java | 102 ++++++++++++++++++ 50 files changed, 143 insertions(+) create mode 100644 Tests/Data/GeogToWGS84GeoKey5.lgo create mode 100644 Tests/Data/GeogToWGS84GeoKey5.tif create mode 100644 Tests/Data/GeogToWGS84GeoKey5.txt create mode 100644 Tests/Data/libgeotiff/GeogAngularUnitsGeoKey_9114.tif create mode 100644 Tests/Data/libgeotiff/GeogGeodeticDatumGeoKey.tif create mode 100644 Tests/Data/libgeotiff/GeogPrimeMeridianGeoKey.tif create mode 100644 Tests/Data/libgeotiff/ProjLinearUnitsGeoKey_9036.tif create mode 100644 Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_2046_transverse_mercator_south_oriented.tif create mode 100644 Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_27200_new_zealand_mapping_grid.tif create mode 100644 Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_28191_cassini_soldner.tif create mode 100644 Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_29101_polyconic.tif create mode 100644 Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_3032_polar_stereographic_variant_b.tif create mode 100644 Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_3035_lambert_azimuthal_equal_area.tif create mode 100644 Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_3083_albers_equal_area.tif create mode 100644 Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_3410_lambert_cylindrical_equal_area.tif create mode 100644 Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_3812_lcc2sp.tif create mode 100644 Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_3814_transverse_mercator.tif create mode 100644 Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_4087_equidistant_cylindrical.tif create mode 100644 Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_5329_mercator1sp.tif create mode 100644 Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_5456_lcc1sp.tif create mode 100644 Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_5482_polar_stereographic_variant_a.tif create mode 100644 Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_5588_oblique_stereographic.tif create mode 100644 Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_5641_mercator2sp.tif create mode 100644 Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_6808_hotine_oblique_mercator_variant_a.tif create mode 100644 Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_8065_hotine_oblique_mercator_variant_b.tif create mode 100644 Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_8441_oblique_mercator_laborde.tif create mode 100644 Tests/Data/libgeotiff/albers_equal_area.tif create mode 100644 Tests/Data/libgeotiff/byte.tif create mode 100644 Tests/Data/libgeotiff/byte_v11.tif create mode 100644 Tests/Data/libgeotiff/cassini_soldner.tif create mode 100644 Tests/Data/libgeotiff/equidistant_cylindrical.tif create mode 100644 Tests/Data/libgeotiff/hotine_oblique_mercator_variant_a.tif create mode 100644 Tests/Data/libgeotiff/hotine_oblique_mercator_variant_b.tif create mode 100644 Tests/Data/libgeotiff/lambert_azimuthal_equal_area.tif create mode 100644 Tests/Data/libgeotiff/lambert_cylindrical_equal_area.tif create mode 100644 Tests/Data/libgeotiff/lcc1sp.tif create mode 100644 Tests/Data/libgeotiff/lcc2sp.tif create mode 100644 Tests/Data/libgeotiff/mercator1sp.tif create mode 100644 Tests/Data/libgeotiff/mercator2sp.tif create mode 100644 Tests/Data/libgeotiff/new_zealand_mapping_grid.tif create mode 100644 Tests/Data/libgeotiff/oblique_mercator_laborde.tif create mode 100644 Tests/Data/libgeotiff/oblique_stereographic.tif create mode 100644 Tests/Data/libgeotiff/pcs_32064.tif create mode 100644 Tests/Data/libgeotiff/pixel_is_point_wgs84.tif create mode 100644 Tests/Data/libgeotiff/polar_stereographic_variant_a.tif create mode 100644 Tests/Data/libgeotiff/polar_stereographic_variant_b.tif create mode 100644 Tests/Data/libgeotiff/polyconic.tif create mode 100644 Tests/Data/libgeotiff/transverse_mercator.tif create mode 100644 Tests/Data/libgeotiff/transverse_mercator_south_oriented.tif create mode 100644 Tests/com/drew/metadata/geotiff/GeoTiffTest.java diff --git a/Tests/Data/GeogToWGS84GeoKey5.lgo b/Tests/Data/GeogToWGS84GeoKey5.lgo new file mode 100644 index 000000000..2c7e3815c --- /dev/null +++ b/Tests/Data/GeogToWGS84GeoKey5.lgo @@ -0,0 +1,31 @@ +Geotiff_Information: + Version: 1 + Key_Revision: 1.0 + Tagged_Information: + ModelTiepointTag (2,3): + 50.5 50.5 0 + 9.00105738 52.001376 0 + ModelPixelScaleTag (1,3): + 2.77777778e-005 2.77777778e-005 1 + End_Of_Tags. + Keyed_Information: + GTModelTypeGeoKey (Short,1): ModelTypeGeographic + GTRasterTypeGeoKey (Short,1): RasterPixelIsArea + GeographicTypeGeoKey (Short,1): User-Defined + GeogGeodeticDatumGeoKey (Short,1): User-Defined + GeogAngularUnitsGeoKey (Short,1): Angular_Degree + GeogEllipsoidGeoKey (Short,1): Ellipse_Bessel_1841 + Unknown-2062 (Double,7): 598.1 73.7 418.2 +0.202 0.045 -2.455 +6.7 + End_Of_Keys. + End_Of_Geotiff. + +Ellipsoid: 7004/(unknown) (0.00,0.00) + +Corner Coordinates: +Upper Left ( 8d59'58.76"E, 52d 0'10.00"N) +Lower Left ( 8d59'58.76"E, 51d59'59.90"N) +Upper Right ( 9d 0' 8.86"E, 52d 0'10.00"N) +Lower Right ( 9d 0' 8.86"E, 51d59'59.90"N) +Center ( 9d 0' 3.81"E, 52d 0' 4.95"N) diff --git a/Tests/Data/GeogToWGS84GeoKey5.tif b/Tests/Data/GeogToWGS84GeoKey5.tif new file mode 100644 index 0000000000000000000000000000000000000000..e878c608a9f8de65af1c86361f73f859fd90f505 GIT binary patch literal 4058 zcmeHJOG{K?7=F*0aTGD5n~@d{x~Zs`(Tz-$2UqG!Du|**1wlciL=?CwOfX#3GN@e! zZG!9%gqs$HF|KkEtt3*ZFw5)AoYV7smzm>bl4;XIkACw$=lh=b{^~a!9fzg8Tx863 z#l`3Uk~ue!k0yrISlmVNT^}neft!=xA)Y`lFw1cjv|Cor6`|9V<%pY+V!W6OT8J6Q z&mtDrG8tMiyYwHdN@)s?eCYfz9wx#0ZtzB}nS}1N;ZDJZ#aUH4?MswT;+!mmvWToq zkYU@>SR76xhjQ6-E%p0KP9Ry>vHFyJ4|7UzTgal&a9zQI$&D)Xujgqbo0haIP8yQ9 zR7)J`c~gw6>H)_&kY&?@nfzIx_RHB1!C@xUB&N$Uu;Mhhj1^tOvVF8~|`YYG$K)X$sq(kq!&MPR6O_budy z1<6=!#@RJ6DLxz1*B9lNDghI#pD zBqc|M&C8(LY`z^MeZ~$H{=jXny3w@Z=lOciw@u}|6w+|0X)Tk9+Ve+m=P)rG^1rbH z#n3Z`Nro;1E12XzX#G!`fin@hQ4^NIE1iwG+}644zO2rND%Pas=8Dv()S6qq>=R$2 z;s|rV<3tp`LKwoX!4=q#7+iKwBxY~~`;`XM)($5s+aTXSVP|N6PYBl-Oq+WRe-JOV zPMM0K7r4&gKH&W!-Gc@*=0m_Lc4#GWmF~jcY_&)e@NVGPc9G-2jEj#4zTkHjHmmPf z5lSaGef?Du1Fi*rH4u?F@MYlPfhxfl4S5F4=LihZmX#hbS2;G%KrWm26yyZf9js}r zek>{;gn(;l$9jPE2zwJ)pOM4?1alTE6%~1n^|VZ+9zoSJ0Fe>F^lv?zxB^@K-^9&F z>RbKawEge8bnV8i`014zxmE%J_Cn{gGKF8 \ No newline at end of file diff --git a/Tests/Data/libgeotiff/GeogAngularUnitsGeoKey_9114.tif b/Tests/Data/libgeotiff/GeogAngularUnitsGeoKey_9114.tif new file mode 100644 index 0000000000000000000000000000000000000000..e15144c1576bab5d348328651f16c899e7587d3e GIT binary patch literal 312 zcmebD)MDUbU|`5*;A3E5WM*IlvcVXM%>-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ>(@|4YD3&AP)lr3y96c0CYN7jEQAqJ20de7=RvSWcXjt z$g#0q0vL8oP(Cx5KCZ+9rZtt>z;vH72bj)~=H%GW4l(^b literal 0 HcmV?d00001 diff --git a/Tests/Data/libgeotiff/ProjLinearUnitsGeoKey_9036.tif b/Tests/Data/libgeotiff/ProjLinearUnitsGeoKey_9036.tif new file mode 100644 index 0000000000000000000000000000000000000000..3169e5308743d5dab6098a2f1b1818e87325fcf3 GIT binary patch literal 362 zcmebD)MDUbU|`5*;Adc9WM*IlvcVXM%>-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZAO~dofD9r49G*!z zf|Q(@=L4n@%KaQ5Y#0slH^@MC1_l-g8|YlH7!%9Jc5$E#Bge*eHU@D9HlQaN8TynN pctEs6Een|TQTB6mF)~-sS8($2RWLO1Q_x5&2@Te)0SnhK005s$8N&bo literal 0 HcmV?d00001 diff --git a/Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_2046_transverse_mercator_south_oriented.tif b/Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_2046_transverse_mercator_south_oriented.tif new file mode 100644 index 0000000000000000000000000000000000000000..6fd6a90a6e22660c1a07fd0736677962b6d74a43 GIT binary patch literal 288 zcmebD)MDUbU|`5*;A3E5WM*IlvcVXM%>-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ@~ literal 0 HcmV?d00001 diff --git a/Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_4087_equidistant_cylindrical.tif b/Tests/Data/libgeotiff/ProjectedCSTypeGeoKey_4087_equidistant_cylindrical.tif new file mode 100644 index 0000000000000000000000000000000000000000..b01885846477600f397d7cfb727792c22aec8db1 GIT binary patch literal 288 zcmebD)MDUbU|`5*;A3E5WM*IlvcVXM%>-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ-q00OgpG#MzM8f{ZL+eIPZWNaA8hY;mX> zkohu5;=xF4zGfZ3`=#WXcRs$d1N5a?1}3JM~)0%Mx8YP2R1XBfvf}+B0PR>pu zE^6}+`~l*hD0C6ro%HTYEH`-Y@w|Dz_b%UEqp<`RKnY+ROercuTe;RLZupL&r-S zx<_ZYBc8rL?%xq!(s4NH1($H)vMP%CnxvPmnJ1v6Ein6#x_x;;c%h zs8JDc6d4y&@I+WRn<|=Buvsz-idI5QL^Nxs#%x8`wdO1tePV^8<$}*^b~mUC=rN=! z7{PLA8RSW+C-^ZLEUFqI7n9w|2_p?2P*mI@R(R!%f>)$;a~u|><;qwwt!9b}@wzgk z$hmrsdlS@+90ovxH})3tE$rehVT`QHMIj>?P823vm34LR#9ERTIVj+9N)HEctB+yW zi*+zufB(5KcFopx8BfXBeP41ZrMGzTSVDX~rDmG&W718WW`rkOd=>fW76)%OJrrVa} zmuq>n!T;iA<$vht*X`rT|NQo3h=H5o23Jy=Z7}Q(xykHowHt(ae7}4>8{*wN%i~86 X9xm=LUOYctynpxh)#C7Q`62xUqeR@! literal 0 HcmV?d00001 diff --git a/Tests/Data/libgeotiff/byte_v11.tif b/Tests/Data/libgeotiff/byte_v11.tif new file mode 100644 index 0000000000000000000000000000000000000000..e6d8f023f21a9010720577590bb57ea7edbd288f GIT binary patch literal 736 zcmZuuJ&P1U5bfDrj|&z>@J-rtuU_{YAKy)1nv_^g%-qZvVXRWJAZ6*qS(QxD zqaxraDlVqriLh`sRSc^jSTYNmRzgffG;62EY(=-V<}4X=VufPljKA0HZcrD{V@Xvo zg5}UM$dgh}@MAJqR5d~^HoKD(RvJ8@sklR&@X8qtuPEvH=ddU(SH_8LHB)qmx0NA9 z&ee0=o1kvwFaR37vA2+KVHbA^V`N<}3K_w2qA=O2Y^!@G){?ZSK>?3bdN_bveFVc^ ztb^hD`_GxNYqqY-cuGd}eaWSi-r~jM2=SGant8&HN!Rc-6FeL7F6#3U2XAMBuQrQe zHaL5e`u>PR^ZLm7jNw}o&a(-={Aroy;69zD^wE}S2lx%}$!4Bz0DlEO-OSQH@DJdN zvpzh>|MErWf9UYn&7-LQ{PuXrftw*NrL-9Fm}iUA&0Y|eQGfY*G2}b9*GCWUKUm#c Ty?Fj)_5R)4SF3}A^@sEqqlVni literal 0 HcmV?d00001 diff --git a/Tests/Data/libgeotiff/cassini_soldner.tif b/Tests/Data/libgeotiff/cassini_soldner.tif new file mode 100644 index 0000000000000000000000000000000000000000..54c3dbe11b0ba84dfb7c6656060dd77722856395 GIT binary patch literal 595 zcmebD)MDUZU|UgUWrI{PBZ;#iu>~1f!1{ui7#Kv6#Kn-<;!rgp z^JS34gOS*L%{&auK>2e(+|M86(60 zdPa_o?ZH3}6O_*eru&pRpnOh_4eg9TL%6{-D+4c>2KtHzqMr#$GlOX%1{N@_sm#Fx z(#Oca38onsxWF_M12>okg%AWZRx=!byW8HuMRsY4>TE{`uIq~nVotC)HcoZ!w)^?d z;r7ouqw^sVj?*GM*vrC;9ANrN^YRjNQ&Vc(or4wpfGh=D1*nihYEDjOL2+u0OJYfB qE?7J}FTXsm#uY4{pP7PCTN6-}nVSkyUgUWrI{PBZ;#iu>~1f!1{QZ7#Kv6#Kn-<;!rgp z^JS34gOS*L%{&auK>2e(+|L3Ncz+hx} zCcwzCv7Mbkoq-L^?^EXF*wD@hbTv1aW@TXD0jc|6&jh8J!L%R)3z*haX5#^=XJX(2 z)65LqV48(N08BG72!d&lg~Wl5+>&XsONtzTsvVYvL^y`K2P;^ZDCjGM=NILqD7Y4u fW~O8omn7zuC^%QUgUWrI{PBZ;#iu>~1f!1^4S7#Kv6#Kn-<;!rgp z^JS34gOS*L%{&auK>2e(+|kh=f%Oi-E`OfxgEfN4!-E*_A2Rt9b` z&Bh=ArWqLo!89-|!88kl7?@^akO0%n3{jy#@YT%$4A}q-4@_JD literal 0 HcmV?d00001 diff --git a/Tests/Data/libgeotiff/hotine_oblique_mercator_variant_b.tif b/Tests/Data/libgeotiff/hotine_oblique_mercator_variant_b.tif new file mode 100644 index 0000000000000000000000000000000000000000..d840338854cf2f1cac9fddef1324011e25e2f3e8 GIT binary patch literal 563 zcmebD)MDUZU|UgUWrI{PBZ;#iu>~1f!1|1s7#Kv6#Kn-<;!rgp z^JS34gOS*L%{&auK>2e(+|>CjV1{Me#=yb3c6U)YSd5{8NU@$VQ zlVIf72y~4+0~?s%r_9N*p`8&Z$qlC289sAE&Ef&k|Ld8cG&7hES7QOwTFP8JAbqS1 z++doGK>$oMG6;fcV3>kw76vge&BP!9ra>VE1PTrgvt|Op&FBMQeuJ9>jDB43EWDWE zgFTqv!3^UgUWrI{PBZ;#iu>~1f!1`VTHH#vNiy^Vap=v

WncsI`;<93HncM`urhFiX`m(^kh=f%Oi-E`Omi`?fN4!-E*_A2CI)UW&CDPG zrWqLo!8FJs5b$yUQw%C#dRKJ-*qt4<9*!%1zMdkxqzEMLuq-6P(KRF}*uqjlU%|)G T)ltEAsl0&(*z)Q_RhU0=AtgNNVmo|oh9Jns+|fL(y;U}Q2B*Oo52bR};pzQ+tXSJi-h zC0|y&vg{G(*Oa`k_|B6Jo$6l{kIyzt;+*2W(BTlvG(0VAY>>Z_&k7B<UgUWrI{PBZ;#iu>~1f!1{!k7#Kv6#Kn-<;!rgp z^JS34gOS*L%{&auK>2e(+|6z+hzX z7G>nv*e<}J%)kcb_bGF7Y-nc$x|$nIvobL7fYkl3XM)nqV49PG1x#xybMS!FGcs_3 zX$A%^FwM-s4W?NbM8Gr?1JnC=K%n9f90~-Yp$B{lh4(J~|K1+tl!g{LM<(rdF{9}M zj_skP`&Z-_In0_lbLRGt2uJ_q{F2my)WXtK1w%_?Qw4nm=ltT5M1`QtUgUWrI{PBZ;#iu>~1f!1_d(7#Kv6#Kn-<;!rgp z^JS34gOS*L%{&auK>2e(+|rd1;Pe89W2JgvawwbqyQKgj0}qe z7&$h!vopvsuz~q~%A6b<+8G(x8MwhT(DghZb^q&`pfod>=3rm})0)a`JRtQ<4D4W< znSlpPGcxdkX$A&9FwMfi52jfe_!fGdl}qz<_)*j7b}e7fVc9Amc;(>`6$%7XJsm(! zdvHM+?2i~<6~`4nUr&);QUnrrSQZlD=o%6fY+UgUWrI{PBZ;#iu>~1f!1_3u7#Kv6#Kn-<;!rgp z^JS34gOS*L%{&auK>2e(+|h=6Heph7{HieK`nPELo$sm|Rw&)?gFgbfb*g5B*tGBO3Y3yDoNB-&{yzt^>mG@L6@ju$OZrl`a$Rb literal 0 HcmV?d00001 diff --git a/Tests/Data/libgeotiff/mercator2sp.tif b/Tests/Data/libgeotiff/mercator2sp.tif new file mode 100644 index 0000000000000000000000000000000000000000..8b49fea308077a32d347c6675060b464616b170f GIT binary patch literal 522 zcmebD)MDUZU|UgUWrI{PBZ;#iu>~1f!1_3u7#Kv6#Kn-<;!rgp z^JS34gOS*L%{&auK>2e(+| z5@O`o2y~4c0~?s%r_9N*p`8)vYHl#i%D}(_Qun`}2}(1AX?6w{Fs-S~#sgB%#J~Zj z85uaiGy?+{m}X|+2Gc;xkwJs&0Vo$tUl0lgyZeGrvg3-Mucyc^DRKbHJ1h%{a18bg la(4_?FfuSOP|#O!DoU)%%u(=7ElN%-$uFuwlC5FL1^{p~ISv2- literal 0 HcmV?d00001 diff --git a/Tests/Data/libgeotiff/new_zealand_mapping_grid.tif b/Tests/Data/libgeotiff/new_zealand_mapping_grid.tif new file mode 100644 index 0000000000000000000000000000000000000000..dd9a2dec50526ee5e5a195bff4d3aa1d89e99468 GIT binary patch literal 535 zcmebD)MDUZU|UgUWrI{PBZ;#iu>~1f!1~0P7#Kv6#Kn-<;!rgp z^JS34gOS*L%{&auK>2e(+|WN&O|VlV)y z0T~Jhehv^OjD|~KWjH*Oas)}7ndbwhL2O2_Z-f{aSRibm)4^g)EF0TF;Q$IUMuz|O zj2s)=)qxx)Fuy^94NUhbb8>8GXJlYy;0Dty47^|(=o=o0J|-y545p!nYpRCKmqrn)YQE4%;b!k8is5DKxsZ& literal 0 HcmV?d00001 diff --git a/Tests/Data/libgeotiff/oblique_mercator_laborde.tif b/Tests/Data/libgeotiff/oblique_mercator_laborde.tif new file mode 100644 index 0000000000000000000000000000000000000000..01eb113aabc389d1e5829294ffc987beea906772 GIT binary patch literal 533 zcmebD)MDUZU|UgUWrI{PBZ;#iu>~1f!1_d(7#Kv6#Kn-<;!rgp z^JS34gOS*L%{&auK>2e(+|rd1;Pe89W2JgvawwXqyQKgj0`6Q z7&$h!b2CUWuz~q~%A6b<+8G(x8MwhT(DghZb^q&`pfod>W?^6f)0)a$JRtQf4BTLv zl|cYZGcpK*X<%4_X=Vm7FwMk}1_IBF4&>YrRrqf1?f~UGOmptedH(yoJ;-ScSrQO` vWNAR?2}KSd;in-HjvUgUWrI{PBZ;#iu>~1f!1^Sa7#Kv6#Kn-<;!rgp z^JS34gOS*L%{&auK>2e(+|WN&O|VlW1& z0T~Jhehv^OjD|~KWjH*Oas)}7ndbwhL2O2_Z-f{aSRibm)4^g)EF0T(Knj3?!N{;$ zfRSTkI~#)z0~?s%r_9N*p`8)vYHl#i%J7*RY8DTO{$I}orJ2FB00Rq{)>7u+0qJ98 z-~`hQ3|wHEnSmQjvoMH&X<*=jfP=dOm|hTYKwl!J*!}-|dl0{&MGx$L5ZxYHx_?D} zk;AN+GiPoOiE#9DbTKkl&{yzFEmv?VD$Oe{&rHr%2rfx2O3hC%N-W68OjghUE7Gh1 IQ#B0P05#}CasU7T literal 0 HcmV?d00001 diff --git a/Tests/Data/libgeotiff/pcs_32064.tif b/Tests/Data/libgeotiff/pcs_32064.tif new file mode 100644 index 0000000000000000000000000000000000000000..19ff4f3884b481287c9798c53876459f98f298c0 GIT binary patch literal 361 zcmebD)MDUZU|`^9U|?isU<9(j7>UgUWrI{PBZ;#iu>~1f!1^+PnnjVs#gN$IP&FX) zWst;!k=T6AJPgc0`9nb5)WXBS2BdER@%naV1_dC^1=PH;orysX$o2vm1P6W&5GIU< zOJHR+r>fh92?u&7{nRafC0hC(5KA6 p1EL*jS-`ZmvY(@ik-37tf|HN0f}x3@f<{_NXs~7tSh$8E8vstp8Q}l` literal 0 HcmV?d00001 diff --git a/Tests/Data/libgeotiff/pixel_is_point_wgs84.tif b/Tests/Data/libgeotiff/pixel_is_point_wgs84.tif new file mode 100644 index 0000000000000000000000000000000000000000..f8a7ab272a51f540028547b287fb69f602c84109 GIT binary patch literal 298 zcmebD)MDUafB-%Q21aHEMj(d?h#8UCOi(rlP@Eac2B~91Vhb{|fc1jZ2qB4!BC*Aw zY>@flQ1vW8whWRQzGfZUgUWrI{PBZ;#iu>~1f!213HHH#vNiy^Vap=v

pa5jw z0~rbjehv^OjD|~KWjH*Oas)}7ndbwhL2O2_Zv+__SRibm)4^g)EF0TJK?;C@!N@R2 zh>>GsI~Ri}0~?s%r_9N*p`8)vYHl#i%D}(_Qun`}2}(1AX?_M4Fs-S~$pcc)z`zBj znHjjjGz)_Wm}X)S2h&i`HG~}iS1En-3={zjw^n?o+7)X l$N?zquq-6PF(^35-Nnejz(7G?At*Q?7{siB3)V1X0|5E}Ip6>Q literal 0 HcmV?d00001 diff --git a/Tests/Data/libgeotiff/polar_stereographic_variant_b.tif b/Tests/Data/libgeotiff/polar_stereographic_variant_b.tif new file mode 100644 index 0000000000000000000000000000000000000000..906b0fdbd465c468d5e58ef35765d0be80cbd0e3 GIT binary patch literal 537 zcmZvYze>YU6o-E|iEV0wwxF$u!i7${2*p8MOeQUeSSsphC`F64l^C~zqC%V;9i61B z%^UOq#7A%uGW!O4?rAJ{FmU+3oIf|`rdC^p4WIxB6M~FGb0c-tWor41=0#!g+=2nj zYx$Dq<+Mkgzog|Gn$O%jFsc4QarfXLLrf^%A`?5r5)BU{2U+p~c^nzoB>z;0PM$q? ztbd#o{uMV_^i<*fWtXX3@NJ5KHFjE^bA}a1RnV#ephUgUWrI{PBZ;#iu>~1f!213HHH#vNiy^Vap=v

pa5jw z0~rbjehv^OjD|~KWjH*Oas)}7ndbwhL2O2_Zv+__SRibm)4^g)EF0S;K?;C@!N|ZR z#K^I+osB_~fep;>Q|9E@(9Q^SH8+@MWnka|srz5g1f`k5v={>mnATM0-~p*;WZ(qT z3=CXgnwfzcOtUbEfN3U>jYz=z0EF|w9z1KV{Y#1*K;mmcA{>JqUCb;M c^c9?n600(E6aw;dDwFf`GLvh-5;Y9j0M{Nf^#A|> literal 0 HcmV?d00001 diff --git a/Tests/Data/libgeotiff/transverse_mercator.tif b/Tests/Data/libgeotiff/transverse_mercator.tif new file mode 100644 index 0000000000000000000000000000000000000000..8273448194ee27a86e033506705de957a3ee8d1e GIT binary patch literal 509 zcmebD)MDUZU|UgUWrI{PBZ;#iu>~1f!213GHH#vNiy^Vap=v

AO~dM z0~rbjehv^OjD|~KWjH*Oas)}7ndbwhL2O2_Zv+__SRibm)4^g)EF0U!K?;C@!N{;y zfRSTkI~#*I0~?s%r_9N*p`8)vYHl#i%D}(_Qun`}2}(1AX+{PXFs-S~!2?py$iNAv z85p?0G&2J?m}X%R0nUgUWrI{PBZ;#iu>~1f!1_3t7#Kv6#Kn-<;!rgp z^JS34gOS*L%{&auK>2e(+|BudaCcC5vB=4{+B*M`nv8W_9DK)jY YBqKjH+tNfqU%@Be(6k0!yoMng05vr>k^lez literal 0 HcmV?d00001 diff --git a/Tests/com/drew/metadata/geotiff/GeoTiffTest.java b/Tests/com/drew/metadata/geotiff/GeoTiffTest.java new file mode 100644 index 000000000..b9d2eb1ed --- /dev/null +++ b/Tests/com/drew/metadata/geotiff/GeoTiffTest.java @@ -0,0 +1,102 @@ +/* + * Copyright 2002-2022 Drew Noakes and contributors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * More information about this project is available at: + * + * https://drewnoakes.com/code/exif/ + * https://github.com/drewnoakes/metadata-extractor + */ +package com.drew.metadata.geotiff; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertTrue; + +import java.io.File; +import java.io.FilenameFilter; +import java.util.Objects; + +import org.junit.Test; + +import com.drew.imaging.tiff.TiffMetadataReader; +import com.drew.metadata.Metadata; +import com.drew.metadata.exif.ExifDirectoryBase; +import com.drew.metadata.exif.ExifIFD0Directory; + +public class GeoTiffTest { + + @Test + public void testGeogToWGS84GeoKey5() throws Exception { + Metadata metadata = TiffMetadataReader.readMetadata(new File("Tests/Data/GeogToWGS84GeoKey5.tif")); + assertNotNull(metadata); + + ExifIFD0Directory exif = checkExif(metadata, 24); + + assertEquals("[32 values]", exif.getDescription(ExifDirectoryBase.TAG_GEOTIFF_GEO_KEYS)); + assertEquals("[768 values]", exif.getDescription(ExifDirectoryBase.TAG_COLOR_MAP)); + assertEquals("0 0 1", exif.getDescription(ExifDirectoryBase.TAG_PIXEL_SCALE)); + assertEquals("50.5 50.5 0 9.001 52.001 0", exif.getDescription(ExifDirectoryBase.TAG_MODEL_TIE_POINT).replace(',', '.')); + assertNull(exif.getDescription(ExifDirectoryBase.TAG_GEOTIFF_GEO_ASCII_PARAMS)); + assertNull(exif.getDescription(ExifDirectoryBase.TAG_GEOTIFF_GEO_DOUBLE_PARAMS)); + assertNull(exif.getDescription(ExifDirectoryBase.TAG_GDAL_METADATA)); + assertNull(exif.getDescription(ExifDirectoryBase.TAG_GDAL_NO_DATA)); + + GeoTiffDirectory geotiff = checkGeoTiff(metadata); + + assertEquals("Geographic", geotiff.getDescription(GeoTiffDirectory.TAG_MODEL_TYPE)); + assertEquals("PixelIsArea", geotiff.getDescription(GeoTiffDirectory.TAG_RASTER_TYPE)); + assertEquals("User Defined", geotiff.getDescription(GeoTiffDirectory.TAG_GEOGRAPHIC_TYPE)); + assertEquals("User Defined", geotiff.getDescription(GeoTiffDirectory.TAG_GEODETIC_DATUM)); + assertEquals("Angular Degree", geotiff.getDescription(GeoTiffDirectory.TAG_GEOGRAPHIC_ANGULAR_UNITS)); + assertEquals("Bessel 1841", geotiff.getDescription(GeoTiffDirectory.TAG_GEOGRAPHIC_ELLIPSOID)); + assertEquals("598.1 73.7 418.2 0.202 0.045 -2.455 6.7", geotiff.getDescription(GeoTiffDirectory.TAG_GEOGRAPHIC_TO_WGS84).replace(',', '.')); + assertEquals(7, geotiff.getTagCount()); + } + + @Test + public void testLibgeotiff() throws Exception { + for (File tiffFile : new File("Tests/Data/libgeotiff").listFiles(new FilenameFilter() { + @Override + public boolean accept(File dir, String name) { + return name.endsWith(".tif"); + } + })) + { + Metadata metadata = TiffMetadataReader.readMetadata(tiffFile); + assertNotNull(tiffFile.getName(), metadata); + checkExif(metadata, 14); + String description = tiffFile.getName() + "\n " + checkGeoTiff(metadata).getTags(); + assertFalse(description, description.contains("Unknown")); + } + } + + private static ExifIFD0Directory checkExif(Metadata metadata, int numberOfTags) { + ExifIFD0Directory exif = metadata.getDirectoriesOfType(ExifIFD0Directory.class).iterator().next(); + assertNotNull(exif); + assertFalse(Objects.toString(exif.getErrors()), exif.hasErrors()); + assertEquals(numberOfTags, exif.getTagCount()); + return exif; + } + + private static GeoTiffDirectory checkGeoTiff(Metadata metadata) { + GeoTiffDirectory geotiff = metadata.getDirectoriesOfType(GeoTiffDirectory.class).iterator().next(); + assertNotNull(geotiff); + assertFalse(Objects.toString(geotiff.getErrors()), geotiff.hasErrors()); + assertTrue(geotiff.getTagCount() > 0); + return geotiff; + } +}