[PROJ] geoid model from a geographic 2D

Even Rouault even.rouault at spatialys.com
Tue Mar 26 07:43:10 PDT 2024


Javier,
> I am trying to add a geoid model for Singapore to my proj.db.
> The problem is that the "source crs", SVY21 (EPSG:4757), is only 
> defined as Geographic 2D in EPSG
> https://spatialreference.org/ref/?search=SVY21
>
> If I add something like this (copied from other cases in 
> grid_transformation_custom.sql)
>
> INSERT INTO "grid_transformation" VALUES(
>     'PROJ','EPSG_4757_TO_EPSG_6916','SVY21 to SHD height',
>     NULL,
>     'EPSG','9665','Geographic3D to GravityRelatedHeight (gtx)',
>     'EPSG','4757', -- source CRS (SVY21)
>     'EPSG','6916', -- target CRS (SHD height)
>     NULL,
>     'EPSG','8666','Geoid (height correction) model file','SGeoid09.tif',
>     NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);
>
> I get an error:
> One grid_transformation with Geographic3D to GravityRelatedHeight or 
> Geog3D to Geog2D+XXX has not its source_crs in geodetic_crs table with 
> type = 'geographic 3D'
>
> I am using the method 9665 ... just because I am used to it. I could 
> use a different one. But I see that all available methods are 
> expecting a geographic 3D as source... that will trigger the same error.
Geoid models make only sense between a Geographic 3D CRS  and a Vertical 
CRS or Geog 2D CRS + Vertical CRS, so the check here is relevant. You 
need an ellipsoidal height at the source end. You could try to remove 
the check, but I don't think that's a good idea. I'm pretty sure there's 
logic in different places of the code that expect a Geographic 3D CRS in 
that situation.
>
> Is there any way to workaround this condition?
>
> Asking SLA to add a 3D system to EPSG is one way... but I would like 
> to have a solution earlier (or in case they just don't do it).

Would be the preferred solution, and also a record for their geoid model

Your workaround pending that is to add an entry in the geodetic_crs 
table (under the PROJ authority for now) to create a Geographic 3D CRS 
companion to EPSG:4757.

Even

-- 
http://www.spatialys.com
My software is free, but my time generally not.



More information about the PROJ mailing list