[PROJ] Source and target ellipsoid do not belong to the same celestial body
Even Rouault
even.rouault at spatialys.com
Wed Mar 27 03:37:29 PDT 2019
On mercredi 27 mars 2019 15:19:17 CET Nyall Dawson wrote:
> Hi list,
>
> I'm a little confused (again)!
>
> If I run the command:
>
> echo 1 1 0 0 | bin/cct +proj=sinu +lon_0=38.62122605364 +x_0=0
> +y_0=0 +a=33960000 +b=3396000 +units=m +no_defs
>
> It looks ok:
> -22298586.4112 5928.0320 0.0000 0.0000
>
>
> But using the same definition via the proj api:
>
> 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 )
>
> I get the error: proj_create_operations: Source and target ellipsoid
> do not belong to the same celestial body
>
> What am I missing?
In the cct case, there's no ellipsoid change. You're just doing a map
projection.
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 :-)
If you intented to do the same as the cct command, you should replace EPSG:
4326 by "+proj=longlat +a=3396000 +b=3396000".
Note: you can use cs2cs to test proj_create_crs_to_crs() (starting with PROJ
6)
$ echo "1 1 0 0" | cs2cs "+proj=longlat +a=3396000 +b=3396000" "+proj=sinu
+lon_0=38.62122605364 +x_0=0 +y_0=0 +a=33960000 +b=3396000 +units=m +no_defs"
22298586.41 5928.03 0.00 0
Note also that using EPSG:4326 now implies latitude, longitude order, wheras
"+proj=longlat ..." will be longitude, latitude
Even
--
Spatialys - Geospatial professional services
http://www.spatialys.com
More information about the PROJ
mailing list