How to add new cities to Locations.xml

I recently discovered libgweather and have already submitted a couple of small merge requests (now merged) for Locations.xml, renaming and adding comments for Korean cities.

Now, I wish to add a city to Locations.xml—Ulsan, a metropolitan city in South Korea with a population of more than 1.1 million—but I’m not sure how to go about it, even after looking at examples within the file.

As I understand it, libgweather gets its weather data from METAR weather stations. So, when I add the city, do I need to include a METAR station near it?

That is, to add Ulsan to Locations.xml, is it sufficient to add just the name and the coordinates

<city>
  <_name>Ulsan</_name>
  <coordinates>35.539169 129.311913</coordinates>
</city>

or, should I add the ICAO code for Ulsan Airport within the tag

<city>
  <_name>Ulsan</_name>
  <code>RKPU</code>
  <coordinates>35.539169 129.311913</coordinates>
</city>

or, should I add Ulsan Airport as a separate location and supply only the name and the coordinate for the city?

<location>
  <_name>Ulsan Airport</_name>
  <code>RKPU</code>
  <coordinates>35.593333 129.351667</coordinates>
</city>
<city>
  <_name>Ulsan</_name>
  <coordinates>35.539169 129.311913</coordinates>
</city>

I see that most cities in Locations.xml have only the name and the coordinates, but then where does the weather data for that city come from?
Is it that every city has a corresponding which supplies a METAR weather station associated with the city from which weather data is pulled?

Thanks.

For more information on how to add new locations to libgweather, you should check the appropriate documentation.

The weather information comes from various providers; the most used one is the METAR-based weather information, which uses the nearest METAR weather station.

METAR stations are typically based around airports, but there are also additional weather stations that can be addressed via METAR.

Yes, it’s enough to add a city element for Ulsan.

You can also add the Ulsan airport as a separate location element, assuming that the airport is on the METAR stations list: https://www.aviationweather.gov/docs/metar/stations.txt

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.