WXforum.net
Web Weather => Weather Website PHP/AJAX scripting => Topic started by: W3DRM on February 02, 2019, 02:47:59 PM
-
Is there a way that I can specify or change the maximum number of METARs that are listed in the find-metar.php script? At the moment, it is limited to 20 results.
At the bottom of the output listing is the following comment:
// Note: only first 20 closest METARs of 92 found within 300 miles are shown
// list generated Sat, 02-Feb-2019 11:38am PST at http://saratoga-weather.org/wxtemplates/find-metar.php
We can change the distance but not the number of resulting METARs. I've had some requests to increase the distance so the output includes more than 20 METARs on the list. In the above example, I can see that the routine detected 92 METARs but only shows the closest 20.
-
Yes, there is some secret sauce you can use to increase the number of returned METAR
Invoke the find-metar.php?maxnum=200 (for the first 200 matches), specify your lat/long/distance and press search.
-
Yes, there is some secret sauce you can use to increase the number of returned METAR
Invoke the find-metar.php?maxnum=200 (for the first 200 matches), specify your lat/long/distance and press search.
Thanks Ken! Your "secret sauce" worked perfectly. Although I notice it takes a while to build the array when the number of METARs gets large. That's no problem, just an observation on my part.