Author Topic: find-metar.php max number of METAR sites  (Read 147 times)

0 Members and 1 Guest are viewing this topic.

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3318
    • Carson Valley Weather
find-metar.php max number of METAR sites
« 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:

Code: [Select]
// 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.
Don - W3DRM - Minden, Nevada --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KRNO2
Davis Wireless VP2, WD 10.37s85,
StartWatch, VirtualVP, VPLive, Win10 Pro
--- Logitech HD Pro C920 webcam
--- RIPE Atlas Probe - 32849

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 6989
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: find-metar.php max number of METAR sites
« Reply #1 on: February 02, 2019, 04:01:39 PM »
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.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Boltek-PCI/NexStorm, microSferics ToA, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge/hub
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

Offline W3DRM

  • Forecaster
  • *****
  • Posts: 3318
    • Carson Valley Weather
Re: find-metar.php max number of METAR sites
« Reply #2 on: February 03, 2019, 12:29:05 AM »
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.
Don - W3DRM - Minden, Nevada --- Blitzortung ID: 808 --- FlightRadar24 ID: F-KRNO2
Davis Wireless VP2, WD 10.37s85,
StartWatch, VirtualVP, VPLive, Win10 Pro
--- Logitech HD Pro C920 webcam
--- RIPE Atlas Probe - 32849