NTv2 bicubic and bilinear interpolators are not currently 'reversible'; Add a (single) iteration to find grid shift values in the CRS of the grid

Aperta Adatta ai principianti
#169 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
python
Ambito
backend

Direzione di ricerca

Inizia da GeodePy.transform.ntv2_2d() e segui le chiamate a interpolate_ntv2(), usando gda94_gda2020_conformal_and_distortion.gsb e gli esempi EAST e WEST come casi di riferimento. Controlla il percorso della trasformazione inversa e verifica che un’iterazione ottenga gli spostamenti nella posizione nominale del CRS della griglia; quindi conferma che GDA94 → GDA2020 → GDA94 restituisca le coordinate con la precisione prevista.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

It is possible to identify locations in the NTv2 grid gda94_gda2020_conformal_and_distortion.gsb
where the forward and reverse transformations are not perfectly reversible in the current GeodePy NTv2 functions
i.e. GeodePy.transform.ntv2_2d() (either method = 'bilinear', or method = 'bicubic')
i.e. GDA94 => GDA2020 => GDA94 does not return the original coordinate to the expected precision

This is caused by the current functions applying the input lat and long as if they are in the CRS of the grid.
However, where grid shift values change quickly between neighbouring nodes, even a 1-2m difference in inputs has a noticeable effect.

This could become problematic if repeated transformations are performed,
or if a process expects the original coordinate to be returned at a very high precision (e.g. if attempting to identifying nodes as identical when comparing datasets from different sources, e.g. if (re)providing a client with GDA94 data before an after a migration of primary datasets to GDA2020)

e.g. below using 'bilinear'; GDA94 => GDA2020 => GDA94, at
-31.6, 141.5 (in 'EAST' subgrid) => => -31.5999999992, 141.5000000011 (approx 0.15mm different per iteration)
-20.0, 122.6 (in 'WEST' subgrid => => -20.0000000000, 122.6000000083 (approx 0.87mm different per iteration)

This issue can be solved by iterating (when transforming in the reverse direction),
so that the grid shifts which are applied are derived at their nominal location in the CRS of the grid.
e.g. determine the shift at the GDA94 location, and apply those SAME shifts, whether in the forward OR reverse direction.

def ntv2_2d(...)
   ...
    if forward_tf:
        tf_lat = lat + shifts[0] / 3600
        tf_lon = lon - shifts[1] / 3600
    else:
        tf_lat = lat - shifts[0] / 3600
        tf_lon = lon + shifts[1] / 3600

      ##### ADD THE FOLLOWING ####
      # iterate to obtain shifts at the nominal coords in the CRS of the grid
      # e.g. gda94 location for gda94_gda2020_conformal_and_distortion.gsb
        shifts = interpolate_ntv2(ntv2_grid, tf_lat, tf_lon, method=method)
        if shifts[0] is None:
            raise ValueError('Coordinate outside of grid extents')
        tf_lat = lat - shifts[0] / 3600
        tf_lon = lon + shifts[1] / 3600
Lingua principale
Python
Stelle
117
Fork
50
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di GeoscienceAustralia/GeodePy

Tutte le issue di GeoscienceAustralia/GeodePy

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.