Skip to content

big tiff(height:65000, width: 57000) build overviews failed #3571

@the-sea

Description

@the-sea

Describe the bug

generating overviews of geo tiff (height:65000, width: 57000) failed.

To Reproduce

Provide as able:

  • Steps to reproduce the behavior
  • Code example
  • Inputs
  • Actual output
  • Expected output

code example

val tiff = GeoTiffReader.readMultiband("6.5w-5.7w.tif", streaming = true)
tiff.withOverviews(NearestNeighbor).write("6.5w-5.7w.ov.tif", true)

input

An geo tiff with height 65000 pixels and width 57000 pixels

Expected behavior

save successfully

Screenshots

If applicable, add screenshots to help explain your problem.

exception stacktrace

Exception in thread "main" java.lang.NegativeArraySizeException: -550109184
	at scala.reflect.ManifestFactory$ByteManifest.newArray(Manifest.scala:97)
	at scala.reflect.ManifestFactory$ByteManifest.newArray(Manifest.scala:95)
	at scala.Array$.ofDim(Array.scala:305)
	at geotrellis.raster.UByteArrayTile$.ofDim(UByteArrayTile.scala:236)
	at geotrellis.raster.UByteArrayTile$.empty(UByteArrayTile.scala:264)
	at geotrellis.raster.ArrayTile$.empty(ArrayTile.scala:455)
	at geotrellis.raster.io.geotiff.GeoTiffMultibandTile.$anonfun$crop$3(GeoTiffMultibandTile.scala:552)
	at scala.Array$.fill(Array.scala:354)
	at geotrellis.raster.io.geotiff.GeoTiffMultibandTile.$anonfun$crop$1(GeoTiffMultibandTile.scala:552)
	at scala.collection.immutable.List.foreach(List.scala:431)
	at geotrellis.raster.io.geotiff.GeoTiffMultibandTile.crop(GeoTiffMultibandTile.scala:545)
	at geotrellis.raster.io.geotiff.GeoTiffMultibandTile.crop(GeoTiffMultibandTile.scala:511)
	at geotrellis.raster.io.geotiff.GeoTiffMultibandTile.crop(GeoTiffMultibandTile.scala:500)
	at geotrellis.raster.io.geotiff.GeoTiffMultibandTile.toArrayTile(GeoTiffMultibandTile.scala:492)
	at geotrellis.raster.io.geotiff.MultibandGeoTiff.withOverviews(MultibandGeoTiff.scala:143)
	at ToCog$.main(ToCog.scala:11)
	at ToCog.main(ToCog.scala)

Environment

  • Java version: 17.0.5
  • Scala version: 2.12
  • GeoTrellis version: 3.7.1

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions