I have a specific transformation code that I would like to employ to transform one set of coordinates to another. Specifically the EPSG:15851 transformation. Is there a way to create a new Transform object in Pyproj with that code?

Alternatively is there a way to search for a specific EPSG Code in the list from:

from pyproj.transformer import TransformerGroup

tg = TransformerGroup(crs_from=4267, crs_to=4326)

The last line gives you a list of all the potential transformers for your conversion, but strangely the one I am looking for is not present. So I would like to skip the specification of the from_crs and to_crs in TransformerGroup() and just grab all of them and search for the specific one that I want.

2 Answers 2

>>> from pyproj import Transformer
>>> tr = Transformer.from_pipeline("EPSG:15851")
>>> tr
<Transformation Transformer: pipeline>
Description: NAD27 to WGS 84 (79)
Area of Use:
- name: United States (USA) - CONUS including EEZ -onshore and offshore - Alabama; Arizona; Arkansas; California; Colorado; Connecticut; Delaware; Florida; Georgia; Idaho; Illinois; Indiana; Iowa; Kansas; Kentucky; Louisiana; Maine; Maryland; Massachusetts; Michigan; Minnesota; Mississippi; Missouri; Montana; Nebraska; Nevada; New Hampshire; New Jersey; New Mexico; New York; North Carolina; North Dakota; Ohio; Oklahoma; Oregon; Pennsylvania; Rhode Island; South Carolina; South Dakota; Tennessee; Texas; Utah; Vermont; Virginia; Washington; West Virginia; Wisconsin; Wyoming. US Gulf of Mexico (GoM) OCS.
- bounds: (-129.17, 23.81, -65.69, 49.38)
  • Thank you for your answer, this seems to be the way, but I am getting an error. It seems that I might be missing the transform? Do you happen to know what this is? ProjError: Input is not a transformation.: (Internal Proj Error: pipeline: Pipeline: Bad step definition: proj=hgridshift (File not found or invalid))
    – gavargas
    Sep 7, 2021 at 21:00
  • Never mind, I just realized that I had to download the missing grids by first looking for the transformation grids and downloading the unavailable transformations. Then your solution works perfectly
    – gavargas
    Sep 7, 2021 at 21:40

I am not familiar with this subject but perhaps you could use from_pipeline https://pyproj4.github.io/pyproj/dev/api/transformer.html.

I made a try to find the standard pipelines with projinfo command

projinfo -s epsg:4267 -t epsg:4326 --spatial-test intersects

Command is listing 78 operations with my Proj version that seems to be rather old, 6.3.2.

Code 15851 appears a few times in the list, for example:

Operation No. 2:

DERIVED_FROM(EPSG):15851, NAD27 to WGS 84 (79), 5.0 m, USA - CONUS including EEZ

PROJ string:
+proj=pipeline +step +proj=axisswap +order=2,1 +step +proj=unitconvert +xy_in=deg +xy_out=rad +step +proj=hgridshift +grids=conus +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1
  • Thank you this got me on the right track as well
    – gavargas
    Sep 7, 2021 at 21:41

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.