Query regarding demo wind.json file #111
Replies: 2 comments
-
The leaflet-velocity project (and related wind-js-server project) has no function to do this, You could try to use GDAL's tools (gdal_translate?) to apply a mask (polygon of Pakistan) to the GRIB file to set values outside the polygon to zero. Then use wind-js-server's grib2json tool to translate the GRIB file to json. You may need to ask the GDAL mailing list for help. |
Beta Was this translation helpful? Give feedback.
-
Use a debugger to step through the code and find the problem. nx and ny are the integer number of rows and columns and it is easy to be off by one when calculating the values using dx and dy since they are floats. As for populating the zero values, find a good library (e.g. Turf.js) to do the point-in-polygon calculation. |
Beta Was this translation helpful? Give feedback.
-
How can I add zeros to the data array for U and V components while creating the 'wind-gbr.json' file for a specific location like Pakistan? The current display appears as a rectangle, and I aim to accurately represent Pakistan's geography on the map. What procedure should I follow to identify the array locations and insert zeros at specific coordinates, ensuring that the wind data aligns with Pakistan's geographical boundaries for a more accurate and visually representative presentation?
Beta Was this translation helpful? Give feedback.
All reactions