[PROJ] function to get grid transformation data

Even Rouault even.rouault at spatialys.com
Wed Nov 2 12:24:29 PDT 2022


Javier,

cannot you setGridAvailabilityUse(IGNORE_GRID_AVAILABILITY), like in the 
following

         auto ctxt =
             CoordinateOperationContext::create(authFactory, nullptr, 0.0);
         ctxt->setGridAvailabilityUse(
             CoordinateOperationContext::GridAvailabilityUse::
                 IGNORE_GRID_AVAILABILITY);
         ctxt->setUsePROJAlternativeGridNames(false);
         auto list = CoordinateOperationFactory::create()->createOperations(
authFactory->createCoordinateReferenceSystem("4275"), // NTF
authFactory->createCoordinateReferenceSystem("4258"), // ETRS89
             ctxt);

and iterate over the returned transformations, and use gridsNeeded() on 
them to check which grids are needed, and their availability

Even

Le 02/11/2022 à 18:25, Javier Jimenez Shaw a écrit :
> *
>
> Hi
>
>
> I have a problem determining if a (gravity related height) vertical 
> CRS has a corresponding geoid model grid-file in the system or not. In 
> other words, if I can expect an actual transformation to that VCRS or 
> not. (All this is not using the “PROJ_NETWORK” mechanism to use a 
> remote location, but assuming that any file is already in the computer 
> I am running).
>
>
> I am thinking about developing a PR for C++ that returns some useful 
> information about the grid transformations for a given CRS code (doing 
> some SQL queries). That will allow the user/developer to know the grid 
> files involved for that CRS, and check if they are available on the 
> filesystem.
>
>
> The API would be something like this:
>
>
> struct GridTransformationData {
>
>     std::string auth_name;
>
>     std::string code;
>
>     std::string source_crs_auth_name;
>
>     std::string source_crs_code;
>
>     std::string accuracy;
>
>     std::string param_auth_name;
>
>     std::string param_code;
>
>     std::string grid_name;
>
>     Extent extent;
>
> };
>
>
> std::list<GridTransformationData>
>
> AuthorityFactory::getGridTransformationData(const std::string &code) 
> const;
>
>
> To find if the file is in the system, this other function will help to 
> search among the tiff files from PROJ-data
>
>
> std::string getGridAlternative(const std::string& original_grid_name) 
> const;
>
>
>
> Is there already a way to do it?
>
> Which fields (mainly from grid_transformation table) should I return?
>
>
> Probably there are other use cases (maybe not only for vertical CRSs) 
> that can take advantage of these functions.
>
>
> Thanks.
>
> *
> .___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__
> Entre dos pensamientos racionales
> hay infinitos pensamientos irracionales.
>
>
> _______________________________________________
> PROJ mailing list
> PROJ at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/proj

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20221102/71962229/attachment.htm>


More information about the PROJ mailing list