Dear GDAL-devs,

while working on a small project, I (more or less inevitably) came across the problem of what to do when a bounding box geometry, that is to be translated to EPSG:4326, crosses the antimeridian in the target SRS (i.e. EPSG:4326). The docs for the C function `OCTTransformBounds` note that the user has to check if a) the destination/target SRS is geographic (which it is in my case), b) if the first SRS axis is latitude or longitude and c) depending on that check whether the maximum longitudinal bounding coordinate is smaller then than the minimum bounding longitudinal coordinate, accessing the correct axis.

Unfortunately, the above mentioned check whether the bounding box "crossed the antimeridian" confuses me. Applying this check on the output correctly detects crossing of the antimeridian in EPSG:4326.

While I may very well misunderstand the documentation and/or the underlying processing, I would be thankful for an answer to the following two questions:

1. Is the documentation correct that input data must be checked and not
   the output data, i.e. `out_xmax` etc.?
2. If so, why should this check be done on the input coordinates even
   though they may not be in a geographic coordinate reference system
   in the first place or have a SRS assigned that handles 180°
   crossings (e.g. Mollweide centered at 180°)?

Kind regards and thanks in advance,

Florian Katerndahl
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to