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

Add +proj=mod_krovak projection method for Modified Krovak that applies to S-JTSK/05 in the Czech Republic #4021

Merged
merged 1 commit into from Feb 2, 2024

Conversation

rouault
Copy link
Member

@rouault rouault commented Jan 31, 2024

Validated with the test point given in EPSG Guidance Note 7-2

Also validated with CUZK online calculator at https://geoportal.cuzk.cz/(S(g4ipaut0ckzb5lellu153lvf))/Default.aspx?head_tab=sekce-01-gp&mode=TextMeta&text=wcts&menu=19

Unfortunately this calculator does not offer 'elementary' transformations, and cannot just validate Modified Krovak alone. The best we can do is to use ETRS89 <--> S-JTSK/05 / Krovak modified, which involves a Helmert transformation as well for the datum transformation.

  • Validation of reverse modified Krovak:

    Online calculator:

    • Souřadnice/input: -5568990.91 -6050538.71 100
    • Source CRS: S-JTSK/05 + Bpv (-Y-XH /east-north)
    • Destination CRS: ETRS89 (BLh / DEG)
    • Výsledek/result: 50.208297081 16.848326835 143.762

    With PROJ:

  echo -5568990.91 -6050538.71 100 | bin/cs2cs -d 9 EPSG:5516 EPSG:4937 --3d
  50.208297081 16.848326833 143.143233569

Note the different on longitude is totally neglectable: 0.1 mm, as computed by:

  $ echo 50.208297081 16.848326835 50.208297081 16.848326833 | bin/geod -F "%.4f" -I +ellps=GRS80
  -90d 90d 0.0001

and that when outputing Krovak modified, the online calculator displays Y/X with
a precision of 1 cm.

The difference on Z is significant, but can be explained from the fact that
the online calculator using Baltic Height for S-JTSK/05 and thus apply a
Baltic Height<-->ETRS89 geoid that we don't apply here.

  • Validation of forward Krovak using same point:

    Online calculator:

    • Souřadnice/input: 50.208297081 16.848326835 143.762
    • Source: ETRS89 (BLh / DEG)
    • Destination: S-JTSK/05 + Bpv (-Y-XH /east-north)
    • Výsledek/result: -5568990.91 -6050538.71 100

    With PROJ:

  $ echo 50.208297081 16.848326835 143.762 | bin/cs2cs -d 2 EPSG:4937 EPSG:5516 --3d
  -5568990.91 -6050538.71 100.62

@rouault rouault added this to the 9.4.0 milestone Jan 31, 2024
@rouault rouault changed the title Add +proj=mod_krovak projection method for Modified Krovak that applis to S-JTSK/05 in the Czech Republic Add +proj=mod_krovak projection method for Modified Krovak that applies to S-JTSK/05 in the Czech Republic Jan 31, 2024
@mwtoews
Copy link
Member

mwtoews commented Feb 1, 2024

There is an inconsistency between "Krovak Modified" and "Modified Krovak".

Guidance Note 7-2 mostly uses "Krovak Modified", with a few exceptions (e.g. "Modified Krovak East North")

An advantage of krovak_mod is that it nicely alpha-sorts after krovak.

Another more convoluted method is to keep only +proj=krovak with +modified option.

@rouault
Copy link
Member Author

rouault commented Feb 1, 2024

There is an inconsistency between "Krovak Modified" and "Modified Krovak".

yeah, I considered krovak_mod at first, but there was the risk of not noticing the _mod suffix, so I switched the mod_krovak to make things obvious. That said, if you feel that krovak_mod is preferable, I could switch to that

Another more convoluted method is to keep only +proj=krovak with +modified option.

I also considered that, but same reason, it is easy to miss it (and if people would copy&paste PROJ strings with +proj=krovak +modified to older PROJ releases, the +modified would be silently ignored, whereas +proj=mod_krovak will just error out). Furthermore, technically/formally, modified krovak takes extra parameters (the correction coefficients), which are currently hard-coded, because there's no point in requiring users to type them, given that the S-JTSK/05 is the single instance where this projection method is typed.

I was also wondering if we should set the default values of x_0 and y_0 to 5000000, which is what is used for S-JTSK/05, but was undecided, so I kept the 0 default value.

Copy link
Member

@mwtoews mwtoews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re: "Krovak Modified" and "Modified Krovak". Looking further, there is no obvious "correct" form.

  • In Czech it is "modifikovaném Křovákově", never the other way around
  • English would normally prefer "Modified Krovak" too

So sure, let's stick with "Modified Krovak". See related suggested changes...

docs/source/operations/projections/mod_krovak.rst Outdated Show resolved Hide resolved
docs/source/operations/projections/mod_krovak.rst Outdated Show resolved Hide resolved
src/pj_list.h Outdated Show resolved Hide resolved
src/projections/krovak.cpp Outdated Show resolved Hide resolved
src/projections/krovak.cpp Outdated Show resolved Hide resolved
…es to S-JTSK/05 in the Czech Republic

Validated with the test point given in EPSG Guidance Note 7-2

Also validated with CUZK online calculator at https://geoportal.cuzk.cz/(S(g4ipaut0ckzb5lellu153lvf))/Default.aspx?head_tab=sekce-01-gp&mode=TextMeta&text=wcts&menu=19

Unfortunately this calculator does not offer 'elementary'
transformations, and cannot just validate Modified Krovak alone.
The best we can do is to use ETRS89 <--> S-JTSK/05 / Krovak modified,
which involves a Helmert transformation as well for the datum
transformation.

* Validation of reverse modified Krovak:

  Online calculator:
  - Souřadnice/input: -5568990.91 -6050538.71 100
  - Source CRS: S-JTSK/05 + Bpv (-Y-XH /east-north)
  - Destination CRS: ETRS89 (BLh / DEG)
  - Výsledek/result: 50.208297081 16.848326835 143.762

  With PROJ:
  echo -5568990.91 -6050538.71 100 | bin/cs2cs -d 9 EPSG:5516 EPSG:4937 --3d
  50.208297081 16.848326833 143.143233569

  Note the different on longitude is totally neglectable: 0.1 mm, as computed by:

  $ echo 50.208297081 16.848326835 50.208297081 16.848326833 | bin/geod -F "%.4f" -I +ellps=GRS80
  -90d 90d 0.0001

  and that when outputing Krovak modified, the online calculator displays Y/X with
  a precision of 1 cm.

  The difference on Z is significant, but can be explained from the fact that
  the online calculator using Baltic Height for S-JTSK/05 and thus apply a
  Baltic Height<-->ETRS89 geoid that we don't apply here.

* Validation of forward Krovak using same point:

  Online calculator:
  - Souřadnice/input: 50.208297081 16.848326835 143.762
  - Source: ETRS89 (BLh / DEG)
  - Destination: S-JTSK/05 + Bpv (-Y-XH /east-north)
  - Výsledek/result: -5568990.91 -6050538.71 100

  With PROJ:
  $ echo 50.208297081 16.848326835 143.762 | bin/cs2cs -d 2 EPSG:4937 EPSG:5516 --3d
  -5568990.91 -6050538.71 100.62
@rouault rouault merged commit 704767f into OSGeo:master Feb 2, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants