[PROJ] Source and target ellipsoid do not belong to the same celestial body

Kristian Evers kreve at sdfe.dk
Wed Mar 27 03:48:22 PDT 2019


> In the proj_create_crs_to_crs() case, a datum change is detected since on the 
> left you have WGS84 and on the right a sphere, and in the code that builds the 
> coordinate operation object, I added a check to detect non-sensical ellipsoid 
> changes. I wans't sure if this was appropriate or not, but let it, waiting for 
> reactions :-)

This check is absolutely appropriate. The function call

proj_create_crs_to_crs( pContext, "EPSG:4326", "+proj=sinu
 +lon_0=38.62122605364 +x_0=0 +y_0=0 +a=3396000 +b=3396000 +units=m
 +no_defs", nullptr )

asks for WGS84 coordinates, that is, coordinates on Earth originating from the GPS system,
being somehow transformed to projected Sinusoidal coordinates on Mars (note the radius
of the sphere). That is not going to fly :-)

This sort of stuff may have worked in PROJ in the past but it has always been
nonsensical.

As far as I know there's not a Marsian equivalent to WGS84 but 
"+proj=latlong +R=+3396000" should do the trick.

/Kristian


More information about the PROJ mailing list