Thanks Even.

In the mean time (it is not easy to me patching and rebuilding now) I will
use this helper workaround function (I hope I understood correctly GetAxis
behaviour)

int getAxesCount(const OGRSpatialReference& sr)
{
    int axesCount = 0;
    while (nullptr != sr.GetAxis(nullptr, axesCount, nullptr))
    {
        axesCount++;
    }
    return axesCount;
}

Cheers
.___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__
Entre dos pensamientos racionales
hay infinitos pensamientos irracionales.



On Mon, 26 Apr 2021 at 21:09, Even Rouault <[email protected]>
wrote:

>
> > Is this a know bug?
> Now, yes :-)
> > Maybe fixed in PROJ 8.0.0? (I had not time to test it there yet)
>
> No, it is GDAL specific. You'll need to patch
> OGRSpatialReference::GetAxesCount() in the ( d->m_pjType ==
> PJ_TYPE_COMPOUND_CRS ) case, to test if a component of the compound CRS
> is a bound CRS, and if so, call proj_crs_get_coordinate_system() on the
> source CRS of the bound CRS ( with proj_get_source_crs() ) and not the
> bound CRS itself
>
> Even
>
>
> --
> http://www.spatialys.com
> My software is free, but my time generally not.
>
>
_______________________________________________
gdal-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to