Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Superseded vertical grid shifts not in TransformerGroup #1261

Closed
dmahr1 opened this issue Mar 29, 2023 · 4 comments · Fixed by #1269
Closed

Superseded vertical grid shifts not in TransformerGroup #1261

dmahr1 opened this issue Mar 29, 2023 · 4 comments · Fixed by #1269
Labels
proposal Idea for a new feature. question

Comments

@dmahr1
Copy link
Contributor

dmahr1 commented Mar 29, 2023

Code Sample, a copy-pastable example if possible

import pyproj
pyproj.network.set_network_enabled(True)
for i, transformer in enumerate(pyproj.transformer.TransformerGroup(6319, 5703).transformers):
    print(f'Transformation {i}: ', transformer.definition)
print('Desired transformation: ', pyproj.Transformer.from_pipeline('epsg:6326'))

Problem description

I am trying to transform NAD83 ellipsoidal heights to NAVD88 orthometric heights with a variety of geoid models. For some reason, the geoid12b geoid model using grid file us_noaa_g2012bu0.tif is not one of the transformers returned by TransformerGroup(6319, 5703). I've only been able to make it appear directly via Transformer.from_pipeline('epsg:6326').

Expected Output

I was able to make this appear as Operation No. 2 in projinfo if and only if I set --show-superseded and --spatial-test intersects. Is this the reason they are not listed in the TransformerGroup? If so, is there an equivalent for these in PyProj?

$ PROJ_NETWORK=ON projinfo -o PROJ -s EPSG:6319 -t EPSG:5703 --show-superseded --spatial-test intersects
Candidate operations found: 3
-------------------------------------
Operation No. 1:
...
-------------------------------------
Operation No. 2:

DERIVED_FROM(EPSG):6326, NAD83(2011) to NAVD88 height (1), 0.02 m, United States (USA) - CONUS onshore - 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.

PROJ string:
+proj=pipeline
  +step +proj=axisswap +order=2,1
  +step +proj=unitconvert +xy_in=deg +xy_out=rad
  +step +inv +proj=vgridshift +grids=us_noaa_g2012bu0.tif +multiplier=1
  +step +proj=unitconvert +xy_in=rad +xy_out=deg
  +step +proj=axisswap +order=2,1

-------------------------------------
Operation No. 3:
...

Environment Information

$ pyproj -v
pyproj info:
    pyproj: 3.5.0
      PROJ: 9.2.0
  data dir: /Users/dmahr/miniconda3/lib/python3.8/site-packages/pyproj/proj_dir/share/proj
user_data_dir: /Users/dmahr/Library/Application Support/proj
PROJ DATA (recommended version): 1.13
PROJ Database: 1.2
EPSG Database: v10.082 [2023-02-06]
ESRI Database: ArcGIS Pro 3.1 [2023-19-01]
IGNF Database: 3.1.0 [2019-05-24]

System:
    python: 3.8.11 (default, Jul 29 2021, 14:57:32)  [Clang 12.0.0 ]
executable: /Users/dmahr/miniconda3/bin/python3
   machine: macOS-12.4-arm64-arm-64bit

Python deps:
   certifi: 2021.10.8
    Cython: None
setuptools: 52.0.0.post20210624
       pip: 21.0.1

Installation method

  • pip install pyproj==3.5.0 (with PROJ 9.2.0 in wheels)
  • brew install proj@9.2.0
@dmahr1 dmahr1 added the bug label Mar 29, 2023
@snowman2 snowman2 added question proposal Idea for a new feature. and removed bug labels Mar 29, 2023
@snowman2
Copy link
Member

This is where those options are hardcoded in the TransformerGroup:

proj_operation_factory_context_set_grid_availability_use(
self.context,
operation_factory_context,
PROJ_GRID_AVAILABILITY_IGNORED,
)
proj_operation_factory_context_set_spatial_criterion(
self.context,
operation_factory_context,
PROJ_SPATIAL_CRITERION_PARTIAL_INTERSECTION
)

If you would like them to be dynamic, a MR adding support for that is welcome.

@dmahr1
Copy link
Contributor Author

dmahr1 commented Mar 30, 2023

@snowman2 Sounds good, I'll give this a shot. Is there a contributor's guide I should follow? I looked and didn't see one.

Also, if there's a vaguely similar PR that you think would be a good model to follow that would be super helpful.

@snowman2
Copy link
Member

Here is the contributing guide: https://github.com/pyproj4/pyproj/blob/main/CONTRIBUTING.md

@snowman2
Copy link
Member

Here is a PR that may be helpful to reference: #1076

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Idea for a new feature. question
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants