Commit 784168f
authored
Add LZ4 and LERC compression codecs for geotiff (#1063)
* Add LZ4 compression support for GeoTIFF module (#1051)
Add CPU LZ4 codec using python-lz4 (lz4.frame format) for TIFF
compression tag 50004. GPU nvCOMP acceleration deferred to a follow-up
since GDAL uses lz4-frame format which needs bridging to nvCOMP's raw
LZ4 format -- the CPU fallback path handles GPU reads/writes correctly
in the meantime.
Changes:
- _compression.py: lz4_decompress/lz4_compress functions, COMPRESSION_LZ4
constant, wired into decompress/compress dispatchers
- _writer.py: 'lz4' key in _compression_tag mapping
- tests/test_lz4.py: 13 tests covering codec roundtrips, write-read
roundtrips (tiled, stripped, float32, predictor), public API, and
error handling when lz4 is not installed
* Add LERC compression for controlled-error lossy raster encoding (#1052)
Adds support for LERC (Limited Error Raster Compression, TIFF tag 34887)
to the geotiff module. LERC is CPU-only and wraps Esri's C library via
the `lerc` Python package. The key feature is the max_z_error parameter
which guarantees a maximum per-pixel encoding error (0 = lossless).
Changes:
- _compression.py: lerc_compress/lerc_decompress functions, COMPRESSION_LERC
constant, dispatch entries in compress() and decompress()
- _writer.py: LERC in compression tag map, strip writer, tile writer
- _gpu_decode.py: explicit CPU fallback for LERC in both decode and encode
paths (no GPU LERC library exists)
- tests/test_lerc.py: codec roundtrips (float32, uint8, uint16), lossy
tolerance check, write-read roundtrips (tiled, stripped, public API),
availability flag tests1 parent fdc6d81 commit 784168f
File tree
5 files changed
+485
-0
lines changed- xrspatial/geotiff
- tests
5 files changed
+485
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
790 | 790 | | |
791 | 791 | | |
792 | 792 | | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
793 | 930 | | |
794 | 931 | | |
795 | 932 | | |
| |||
800 | 937 | | |
801 | 938 | | |
802 | 939 | | |
| 940 | + | |
803 | 941 | | |
| 942 | + | |
804 | 943 | | |
805 | 944 | | |
806 | 945 | | |
| |||
839 | 978 | | |
840 | 979 | | |
841 | 980 | | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
842 | 986 | | |
843 | 987 | | |
844 | 988 | | |
| |||
869 | 1013 | | |
870 | 1014 | | |
871 | 1015 | | |
| 1016 | + | |
| 1017 | + | |
872 | 1018 | | |
873 | 1019 | | |
874 | 1020 | | |
875 | 1021 | | |
| 1022 | + | |
| 1023 | + | |
876 | 1024 | | |
877 | 1025 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1534 | 1534 | | |
1535 | 1535 | | |
1536 | 1536 | | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
1537 | 1552 | | |
1538 | 1553 | | |
1539 | 1554 | | |
| |||
2273 | 2288 | | |
2274 | 2289 | | |
2275 | 2290 | | |
| 2291 | + | |
| 2292 | + | |
| 2293 | + | |
| 2294 | + | |
| 2295 | + | |
| 2296 | + | |
| 2297 | + | |
| 2298 | + | |
| 2299 | + | |
| 2300 | + | |
| 2301 | + | |
| 2302 | + | |
| 2303 | + | |
2276 | 2304 | | |
2277 | 2305 | | |
2278 | 2306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
| 76 | + | |
74 | 77 | | |
75 | 78 | | |
| 79 | + | |
76 | 80 | | |
77 | 81 | | |
78 | 82 | | |
| |||
332 | 336 | | |
333 | 337 | | |
334 | 338 | | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
335 | 343 | | |
336 | 344 | | |
337 | 345 | | |
| |||
387 | 395 | | |
388 | 396 | | |
389 | 397 | | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
390 | 402 | | |
391 | 403 | | |
392 | 404 | | |
| |||
0 commit comments