Making WordPress.org


Ignore:
Timestamp:
10/06/2023 10:27:46 PM (9 months ago)
Author:
iandunn
Message:

Events: Only search Geonames for places with populations > 500

This ensures that searching for Genova will find the populated city with events, rather than the small village with no events.

It seems unlikely that they'll be a meetup in town with < 500, but we can revisit this if we run into that. The smallest place I saw with a meetup had a population of around 6,000.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/events/1.0/tests/test-index.php

    r12258 r12936  
    10771077            ),
    10781078
     1079            // Genova, IT is the native name of a populated city, and it's English name is Genoa. There's also a
     1080            // small village in IT whose English name is Genova. Geonames considers the English name to be the
     1081            // primary one, and native names are considered alternate names. We rank primary names higher than
     1082            // alternate names, and that usually works, but in this case people are more likely to be looking for
     1083            // the city.
     1084            'rural-match-less-likely-than-city-match' => array(
     1085                'input' => array(
     1086                    'location_name' => 'Genova',
     1087                    'locale'        => 'it_IT',
     1088                    'timezone'      => 'Europe/Rome',
     1089                ),
     1090                'expected' => array(
     1091                    'description' => 'genova',
     1092                    'latitude'    => '44.413',
     1093                    'longitude'   => '8.957',
     1094                    'country'     => 'IT',
     1095                ),
     1096            ),
     1097
     1098            'rural-match-less-likely-than-city-match-with-accent' => array(
     1099                'input' => array(
     1100                    'location_name' => 'Gènova',
     1101                    'locale'        => 'it_IT',
     1102                    'timezone'      => 'Europe/Rome',
     1103                ),
     1104                'expected' => array(
     1105                    'description' => 'genova',
     1106                    'latitude'    => '44.413',
     1107                    'longitude'   => '8.957',
     1108                    'country'     => 'IT',
     1109                ),
     1110            ),
     1111
     1112            'city-match-more-likely-than-rural-match' => array(
     1113                'input' => array(
     1114                    'location_name' => 'Genoa',
     1115                    'locale'        => 'it_IT',
     1116                    'timezone'      => 'Europe/Rome',
     1117                ),
     1118                'expected' => array(
     1119                    'description' => 'genoa',
     1120                    'latitude'    => '44.405',
     1121                    'longitude'   => '8.944',
     1122                    'country'     => 'IT',
     1123                ),
     1124            ),
     1125
    10791126            /*
    10801127             * A combination of city, region, and country are given, along with the locale and timezone
Note: See TracChangeset for help on using the changeset viewer.