Giter Club home page Giter Club logo

Comments (2)

sgillies avatar sgillies commented on May 24, 2024 1

Nope, that had no effect. It will be difficult to address this since from_bounds() is written in Python and calculate_default_transform() is written in C++ (the math is in GDAL). The good news is that aligning each (like GDAL's "target aligned pixels") produces the same result.

>>> from rasterio import warp, transform, CRS
>>> crs = CRS.from_epsg(32718)
>>> width, height, left, right, top, bottom = (539, 618, 627175.0, 643345.0, 4852085.0, 4833545.0)
>>> res1 = transform.from_bounds(left, bottom, right, top, width, height)
>>> res2  = warp.calculate_default_transform(crs, crs, width, height, left=left, right=right, top=top, bottom=bottom)
>>> warp.aligned_target(*res2, 30)
(Affine(30.0, 0.0, 627150.0,
       0.0, -30.0, 4852110.0), 540, 619)
>>> warp.aligned_target(res1, width, height, 30)
(Affine(30.0, 0.0, 627150.0,
       0.0, -30.0, 4852110.0), 540, 619)

from rasterio.

sgillies avatar sgillies commented on May 24, 2024

@adehecq thanks for the report!

I wonder if changing the transform construction from this form https://github.com/rasterio/rasterio/blob/main/rasterio/_warp.pyx#L760 to this form https://github.com/rasterio/rasterio/blob/main/rasterio/transform.py#L188 would help?

from rasterio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.