Uploaded image for project: 'Apache Sedona'
  1. Apache Sedona
  2. SEDONA-104

Bug in Reading Band Values of GeoTiff Images

    XMLWordPrintableJSON

Details

    Description

      In line 182 of the file [GeotiffSchema.scala|https://github.com/apache/incubator-sedona/blob/master/sql/src/main/scala/org/apache/spark/sql/sedona_sql/io/GeotiffSchema.scala,] it is calculating the offset position of a pixel band value. The offset calculation is wrong. The correct offset should be:

      val offset = i * width + j + width * height * bandId

      I compared the band values returned by Apache Sedona with the band values returned by Python rasterio library for the same geotiff image. If the offset values are calculated following the above formula, band values returned by Apache Sedona match with the band values returned by rasterio librray.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kanchanchy Kanchan Chowdhury
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m