[
https://issues.apache.org/jira/browse/SEDONA-104?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17518512#comment-17518512
]
Jia Yu commented on SEDONA-104:
-------------------------------
[~kanchanchy] Thanks for capturing this. Can you make a PR to fix it? This will
be really helpful.
> Bug in Reading Band Values of GeoTiff Images
> --------------------------------------------
>
> Key: SEDONA-104
> URL: https://issues.apache.org/jira/browse/SEDONA-104
> Project: Apache Sedona
> Issue Type: Bug
> Affects Versions: 1.1.1
> Reporter: Kanchan Chowdhury
> Priority: Critical
> Labels: test
>
> 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|https://rasterio.readthedocs.io/en/latest/index.html] 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.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)