weglide / bugtracker

WeGlide platform bug tracker.
https://www.weglide.org
11 stars 1 forks source link

Add SSA regions in the USA #230

Closed benhirashima closed 6 months ago

benhirashima commented 1 year ago

Describe the Feature Currently, flights and ranks can be filtered by region, club, airport, and state/province. However, SSA regions are not included. In the USA, the country is divided into 12 regions by the SSA. They are known simply as regions 1 through 12. Here is a list of regions and the areas they cover: https://www.ssa.org/groups/type/region/. I would like to be able to filter by SSA region, like I can do on OLC. I'd suggest naming the regions something like "SSA Region 1", and so on.

samuel-git commented 12 months ago

@benhirashima can you point us to a working link of the region areas? Somehow my google game is not good enough.

Then we can add it here: https://github.com/weglide/flugfeld/blob/main/geo/sectors.json

benhirashima commented 12 months ago

@samuel-git The link I posted works for me, but I admit it doesn't contain the most useful information. The first image below shows a list of the US states that belong to each region. Where there are dashes followed by N, S, E, W those denote states that are divided into north/south or east/west areas. In the second image below, you can see which states are divided, and roughly where the dividing line is. It would be nice to have coordinates for the dividing lines. I will email the SSA and request that information.

image

image

benhirashima commented 11 months ago

@samuel-git I got the following from the SSA. Most US states belong to only one region, so the state to region mapping is 1:1, as listed in state_region.csv. However, there are three states that are divided between two regions. They are PA, MO, and CA. In these cases, the states are divided by zip codes (postal codes). In split_states.csv, there are ranges of zip codes assigned to regions. The hard part will be to determine where the dividing line should be, based on the zip codes. It doesn't need to be exact. As long as the correct airports are on the correct side of the dividing line, it should work as intended.

The state defines the region except when the region is 0 and the key is 1, then the code uses a range of zip codes in a lookup table to assign the appropriate region where states are split; PA, MO, and CA

split_states.csv state_region.csv

moldhouse commented 6 months ago

The regions are now available both in the list and the ranking.

benhirashima commented 6 months ago

@moldhouse I'm excited to hear that the SSA regions have been added, but I'm unable to find them on the site. How are they named? I tried searching in both Flights and Ranks for the expected keywords such as "SSA" and "Region", but saw nothing.

moldhouse commented 6 months ago

Sorry, it's available now

benhirashima commented 6 months ago

@moldhouse I see the SSA regions in Flights and Ranks now. However, I am not seeing them when I try to customize the filters on the homepage. Could that be added? Thanks.

samuel-git commented 6 months ago

@benhirashima it is added now, thank you.