[gdal-dev] Odd comment in ogr_spatialref.h for TransformBounds API

Javier Jimenez Shaw j1 at jimenezshaw.com
Thu Nov 5 02:14:48 PST 2026


Would this way (coding language, not English) be easier?

"elseif the destination CRS is geographic, the first axis is latitude, ..."

I think the newline in between tries to make it more clear


On Thu, 5 Nov 2026, 10:32 Ray at Daylon via gdal-dev, <
gdal-dev at lists.osgeo.org> wrote:

> Hi everyone,
>
> ogr_spatialref.h (current github source, master) has a comment preceding
> the TransformBounds function which seems odd.
>     /** \brief Transform boundary.
>      *
>      * This method is the same as the C function OCTTransformBounds().
>      *
>      * Transform boundary densifying the edges to account for nonlinear
>      * transformations along these edges and extracting the outermost
> bounds.
>      *
> *     * If the destination CRS is geographic, the first axis is
> longitude, *
>      * and xmax < xmin then the bounds crossed the antimeridian.
>      * In this scenario there are two polygons, one on each side of the
>      * antimeridian. The first polygon should be constructed with (xmin,
> ymin,
>      * 180, ymax) and the second with (-180, ymin, xmax, ymax).
>      *
>
> *     * If the destination CRS is geographic, the first axis is latitude, *
>    * and ymax < ymin then the bounds crossed the antimeridian.
>      * In this scenario there are two polygons, one on each side of the
>      * antimeridian. The first polygon should be constructed with (ymin,
> xmin,
>      * ymax, 180) and the second with (ymin, -180, ymax, xmax).
>
>
> If the destination CRS is geographic, how can the first axis be longitude
> and latitude?
>
> Ray
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20261105/9ad34ebb/attachment.htm>


More information about the gdal-dev mailing list