Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Add TransformBounds to OSR Coordinate Transformation #4630

Closed
snowman2 opened this issue Oct 10, 2021 · 1 comment · Fixed by #4666
Closed

ENH: Add TransformBounds to OSR Coordinate Transformation #4630

snowman2 opened this issue Oct 10, 2021 · 1 comment · Fixed by #4666

Comments

@snowman2
Copy link
Contributor

Related:

Proposing to expose the proj_trans_bounds method in GDAL with PROJ 8.2+:

I would be willing to work on adding this if this addition is approved.

@rouault
Copy link
Member

rouault commented Oct 10, 2021

why not ?
There are a few subtleties to take into account:

  • a PJ* object isn't necessarily constructed:
  • the data axis to SRS axis mapping concept should be taken into account before and after running proj_trans_bounds. See
    if( poSRSSource )
    and
    if( poSRSTarget )
  • you'll have to add a dummy implementation for a number of classes that derived from OGRCoordinateTransformation (in a few utilities, in the DXF driver, etc). None of them would call then TransformBounds() methods so this is not an issue. Likely add a "return false" as the default implementation in the base class, and have it only implemented in OGRCT

The 2 variations of GDALComputeAreaOfInterest() in alg/gdaltransformer.cpp could potentially use the new method, but probably not something to do in a first time, because we'll still need a working implementation for < 8.2, and this function isn't directly tested, so verifying that the new implementation works equivalently as the existing one would require some debug instrumentation

@snowman2 snowman2 mentioned this issue Oct 16, 2021
6 tasks
rouault pushed a commit that referenced this issue Oct 18, 2021
… box (fixes #4630)

- Adds OCTTransformBounds to the C-API
- Adds CoordinateTransformation.TransformBounds to Python API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants