2

Could anyone explain why the target in this proj string is not correct?

$ projinfo -s EPSG:4326 -t '+proj=gnom +lat_0=61.39107201212929 +lon_0=-58.56360634793518' -o PROJ

target CRS string is not a CRS

  • Thank you so much Gabriel! I was trying to debug why pyproj was returning all Nan/Infs without producing an error message, and turned to projinfo. And thanks for the edit Vince! I'll reread the policies. I am not a frequent visitor. – Brendan Mar 27 at 14:24
  • Brendan you are welcome. Inf values are common for latitudes > 90 degrees or values that are not in the domain of the conversion (like the Northen hemisfere in a South Pole gnomonic projection), don't forget that the axis order for EPSG:4326 is (latitude, longitude). – Gabriel De Luca Mar 27 at 17:16
  • Thanks again Gabriel. I am using shapley and pyproj, and shapely expects x,y order in its transform call. I used the pyproj.Transformer.from_crs option always_xy=True and my problems were solved! I submitted a ticket to shapely suggesting they update their docs regarding this issue i.e. always use always_xy=True with pyproj CRS for shapely. Stay safe in these troubling times! – Brendan Mar 28 at 19:23
3

The string is considered as a coordinate operation in this case. You need to include the +type=crs to be considered as a CRS.

From the Transformations Setup section of the Functions page of the docs:

If a proj-string contains a +type=crs option, then it is interpreted as a CRS definition.
[...]
The use of proj-string to describe a CRS is discouraged. It is a legacy means of conveying CRS descriptions: use of object codes (EPSG:XXXX typically) or WKT description is recommended for better expressivity.

If a proj-string does not contain +type=crs, then it is interpreted as a coordination operation / transformation.


In my case:

$ projinfo
Rel. 6.2.1, November 1st, 2019
[...]  

$ projinfo -s EPSG:4326 -t '+proj=gnom +lat_0=61.39107201212929 +lon_0=-58.56360634793518 +type=crs' -o PROJ
Candidate operations found: 1
-------------------------------------
Operation n°1:

unknown id, axis order change (2D) + unknown, 0 m, World

PROJ string:
+proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=gnom +lat_0=61.3910720121293 +lon_0=-58.5636063479352 +x_0=0 +y_0=0 +ellps=WGS84

Note that the last step of the returned string does not have the +type=crs parameter.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.