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

Undefined EPSG Code can give a ValueError in MSUI #1536

Closed
ReimarBauer opened this issue Aug 26, 2022 · 2 comments · Fixed by #1581
Closed

Undefined EPSG Code can give a ValueError in MSUI #1536

ReimarBauer opened this issue Aug 26, 2022 · 2 comments · Fixed by #1581
Assignees
Labels
bug Something isn't working msui
Milestone

Comments

@ReimarBauer
Copy link
Member

Because users can enter EPSG Codes into the msui_settings.json there could been added values which are not supported.
We should catch this early, in the config editor, on msui start.

e.g.

 "06 Europe (stereo)": {
            "CRS": "EPSG:777400101",
            "map": {
                "llcrnrlon": -20.0,
                "llcrnrlat": 35.0,
                "urcrnrlon": 40.0,
                "urcrnrlat": 70.0
            }
Fatal error in MSS 7.0.2. on Linux-5.4.0-124-generic-x86_64-with-glibc2.27
Python 3.10.4 | packaged by conda-forge | (main, Mar 24 2022, 17:38:57) [GCC 10.3.0]

Please report bugs in MSS to https://github.com/Open-MSS/MSS

Information about the fatal error:

Traceback (most recent call last):
  File "/home/reimar/PycharmProjects/MSS/mslib/msui/topview.py", line 317, in changeMapSection
    proj_params = get_projection_params(current_map["CRS"])
  File "/home/reimar/PycharmProjects/MSS/mslib/utils/coordinate.py", line 188, in get_projection_params
    raise ValueError("EPSG code not supported by basemap module: '%s'", proj)
ValueError: ("EPSG code not supported by basemap module: '%s'", 'epsg:777400101')
@ReimarBauer ReimarBauer added enhancement New feature or request msui labels Aug 26, 2022
@ReimarBauer ReimarBauer added this to the 8.0.0 milestone Aug 26, 2022
@joernu76
Copy link
Member

Mmmh. Difficult, not only because Marc defined "custom" codes, which only MSS can interpret correctly.

I think it is fine to define your own EPSG codes, if you like. When we request a map from a server, we check the requested EPSG code against the ones the server offers and warn if it is not supported.

That caused the Warning in Jens-Uwes demonstration yesterday; the custom EPSG code was not offered by the server (even though it was understood).

The current MSS server uses non-EPSG codes for non-standard projections; to remain compatible with older MSWMS servers, the non-standard EPSG usage has not been deprecated. We could do so now. I believe Sonja has updated the DLR server...?

@ReimarBauer
Copy link
Member Author

We just can catch this ValueError and inform the user that this EPSG code is not defined.

@ReimarBauer ReimarBauer added bug Something isn't working and removed enhancement New feature or request labels Oct 6, 2022
@ReimarBauer ReimarBauer modified the milestones: 8.0.0, 7.0.6 Oct 6, 2022
@ReimarBauer ReimarBauer self-assigned this Oct 6, 2022
@ReimarBauer ReimarBauer changed the title EPSG Code validation EPSG Code validation in MSUI (ValueError) Oct 6, 2022
@ReimarBauer ReimarBauer changed the title EPSG Code validation in MSUI (ValueError) Undefined EPSG Code can give a ValueError in MSUI Oct 6, 2022
@ReimarBauer ReimarBauer linked a pull request Oct 26, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working msui
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants