locationtech / geotrellis

GeoTrellis is a geographic data processing engine for high performance applications.
http://geotrellis.io
Other
1.33k stars 360 forks source link

Is there an error in Extent.translate ? #3444

Closed xvThomas closed 2 years ago

xvThomas commented 2 years ago

In the source code we found:

/** Return this extent moved x and y amounts */
  def translate(deltaX: Double, deltaY: Double): Extent =
    Extent(
      xmin + deltaX,
      ymin + deltaY,
      xmax + deltaX,
      ymin + deltaY
    )

Isn't it more like:

/** Return this extent moved x and y amounts */
  def translate(deltaX: Double, deltaY: Double): Extent =
    Extent(
      xmin + deltaX,
      ymin + deltaY,
      xmax + deltaX,
      ymax + deltaY
    )

ymax instead of ymin

pomadchin commented 2 years ago

Hey @xvThomas, you're absolutely right! Thx for catching it 🎉 ! Would you like to create a PR + a tiny unit test to trace this bug?

🤦 I guess it was not widely used and that's why we never faced it.