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

Coordinates in CSV file no limited to four decimal places #18

Open
EHJ-52n opened this issue Feb 1, 2022 · 4 comments
Open

Coordinates in CSV file no limited to four decimal places #18

EHJ-52n opened this issue Feb 1, 2022 · 4 comments

Comments

@EHJ-52n
Copy link
Member

EHJ-52n commented Feb 1, 2022

The coordinates in the result should be rounded to reasonable accuracy, too, as we do it for the input:

    #
    #   rounding coordinates to reasonable accuracy
    #
    #   see https://gis.stackexchange.com/a/208739
    #
    lat_lo = round(lat_lo, 4)
    lat_hi = round(lat_hi, 4)
    lon_hi = round(lon_hi, 4)
    lon_lo = round(lon_lo, 4)

Go to Code.

Requesting the following data, the resulting coordinates have up to 16 decimal places.

Time range: 2019-06-02 00:44:00 to 2019-06-02 12:55:00,,,
Longitude extent: 1.61 to 6.18,,,
Latitude extent: 53.00 to 55.16,,,
Spatial Resolution 0.083deg x 0.083deg,,,
Temporal Resolution 3-hours interval,,,
Credit (Wave-Wind-Physical): E.U. Copernicus Marine Service Information (CMEMS),,,
Credit (GFS): National Centers for Environmental Prediction/National Weather Service/NOAA,,,
Accessed on 2022-02-01 10:57:24,,,
Error(s): ,,,
latitude,longitude,time,VHM0_WW
52.997,1.607,2019-06-02 00:44:00,0.4354017150281338
52.997,1.607,2019-06-02 03:44:00,0.48501256607868165
52.997,1.607,2019-06-02 06:44:00,0.5505601363923266
52.997,1.607,2019-06-02 09:44:00,0.6087635072508395
52.997,1.69,2019-06-02 00:44:00,0.46592905816830743
52.997,1.69,2019-06-02 03:44:00,0.5236179489900831
52.997,1.69,2019-06-02 06:44:00,0.5939488696490431
52.997,1.69,2019-06-02 09:44:00,0.6639426764193687
52.997,1.773,2019-06-02 00:44:00,0.48650004597974444
52.997,1.773,2019-06-02 03:44:00,0.5541489307372638
52.997,1.773,2019-06-02 06:44:00,0.6337261238057263
52.997,1.773,2019-06-02 09:44:00,0.7121875631269267
52.997,1.8559999999999999,2019-06-02 00:44:00,0.49679391377512677
52.997,1.8559999999999999,2019-06-02 03:44:00,0.5737379222314644
[...]
@daksh0786
Copy link

hey @EHJ-52n i think there needs to be made some minor changes in order for it to work as instead of directly applying round function you can use "%.2f" % round() now it will ive answer as string and the we can convert the string to integer or you can use lat_lo= lat_lo("%.2f" % lat_lo)
thank you

@daksh0786
Copy link

will you mind if i help you out ?

@EHJ-52n
Copy link
Member Author

EHJ-52n commented Feb 3, 2023

@daksh0786 Please follow https://52north.org/software/contribute/#code before creating a pull request.

@kshitij0-0
Copy link

@EHJ-52n can you have a look at PR #69 please?

@52North 52North deleted a comment from shubhamatkal Nov 20, 2023
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

No branches or pull requests

3 participants