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

Processing data for addVelocity #12

Closed
jmhatch opened this issue Dec 29, 2020 · 4 comments
Closed

Processing data for addVelocity #12

jmhatch opened this issue Dec 29, 2020 · 4 comments

Comments

@jmhatch
Copy link

jmhatch commented Dec 29, 2020

I'm not sure this is a leaflet.extras2 issue, but I thought I'd start here. I'm trying to add wind data to a leaflet map. I download the data using the following link,

https://nomads.ncep.noaa.gov/cgi-bin/filter_gfs_1p00.pl?file=gfs.t06z.pgrb2.1p00.f000&lev_10_m_above_ground=on&var_UGRD=on&var_VGRD=on&subregion=&leftlon=-72.74273&rightlon=-67.92787&toplat=43.64460&bottomlat=40.04384&dir=%2Fgfs.20201229%2F06

Then I convert the grib file to json using the weacast-grib2json program,

grib2json -d -n -o gfs.t06z.pgrb2.1p00.f000 gfs.t06z.pgrb2.1p00.f000.json

Basically following the guidance found here and here.

However, when I display the wind data on my leaflet map,

leaflet() %>%
    setView(lng = -70.3361, lat = 41.8451, zoom = 10) %>%
    addProviderTiles(providers$Esri.WorldImagery) %>%
    addVelocity(content = 'gfs.t06z.pgrb2.1p00.f000.json')

it looks different than what is displayed on windy or earth (the angle of the particles looks off). Not sure what is going on...

Windy

windy

vs. mine

manual

Maybe it's a projection issue?

@trafficonese
Copy link
Owner

Hey @jmhatch, that is very interesting indeed. Unfortunately I have no idea, where this "bug" is coming from. I will have a look at my code but I'm pretty sure I just pass the json to the underlying plugin-library. So no transformation is happening on my side.

Are you sure that you were looking at the same timeranges? I guess a time difference of 1 hour can already make a huge difference.

@jmhatch
Copy link
Author

jmhatch commented Feb 9, 2021

@trafficonese I'm pretty sure it's the same time range. Here is another example, with a ref time of 2021-02-09T06:00:00.000Z from the json file I downloaded, which seems to correspond with what Windy is reporting for GFS.

Windy
windy_2

vs. mine
mine_2

The discrepancy is pretty apparent. I must be doing something wrong?

@trafficonese
Copy link
Owner

Could you maybe try to use the json file with the underlying JS-library?
Unfortunately, I am not able to install grib2json on my computer, so its a bit hard for me to debug..

@jmhatch
Copy link
Author

jmhatch commented Feb 25, 2021

Good idea @trafficonese!

I was able to replicate the 'mine' image above using the leaflet-velocity JS library. So it isn't a leaflet.extras2 issue. It must be a data issue. I'll open up an issue over at leaflet-velocity to see if someone can help me out.

Thanks!

Capture

@jmhatch jmhatch closed this as completed Feb 25, 2021
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

2 participants