Find nearby Wikipedia Entries is not working correctly due to incorrect configuration
cronix - October 22, 2009 - 16:21
| Project: | GeoNames |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
The current nearby Wikipedia Entries service is not working correctly. I found that the configuration in geonames_config.inc was incorrect. The current code looks like:
$config['nearbywikipedia'] = array(
'service_name' => 'nearbywikipedia',
'service_full_name' => 'Find nearby Wikipedia Entries (reverse geocoding)',
'description' => 'Find nearby Wikipedia Entries (reverse geocoding)',
'service_path' => 'findNearbyWikipedia',
'credit_cost' => 2,
'result_cache_prefix' => 'wikres:',
'data_cache_prefix' => 'wikdat:',
'allowed_parameters' => array(
//our style geonames style
'lat' => 'lat',
'lng' => 'lng',
'radius' => 'radius',
'postalcode' => 'postalcode',
'lang' => 'lang', // Geonames default = en
'maxrows' => 'maxRows', // Geonames default = 5
'country' => 'country', // Geonames default = ALL
),
'pager' => FALSE,
'required_parameters' => array( // If you have set query_defaults you should not include the parameter here
array('lat', 'lng'),
array('postalcode', 'country')
),
'required_parameters_type' => 'all',
'query_defaults' => array(
'maxrows' => 15,
'radius' => 10
),
'columns' => array(
'summary' => 'summary',
'feature' => 'feature',
'population' => 'population',
'elevation' => 'elevation',
'lat' => 'lat',
'lng' => 'lng',
'wikipediaurl' => 'wikipediaUrl',
'thumbnailimg' => 'thumbnailImg',
'lang' => 'lang',
'distance' => 'distance',
),
);This config misses the "title" column as a return value. The wikipediaUrl is also not correct, this results in no url being returned. The correct config should be (in my opinion):
$config['nearbywikipedia'] = array(
'service_name' => 'nearbywikipedia',
'service_full_name' => 'Find nearby Wikipedia Entries (reverse geocoding)',
'description' => 'Find nearby Wikipedia Entries (reverse geocoding)',
'service_path' => 'findNearbyWikipedia',
'credit_cost' => 2,
'result_cache_prefix' => 'wikres:',
'data_cache_prefix' => 'wikdat:',
'allowed_parameters' => array(
//our style geonames style
'lat' => 'lat',
'lng' => 'lng',
'radius' => 'radius',
'postalcode' => 'postalcode',
'lang' => 'lang', // Geonames default = en
'maxrows' => 'maxRows', // Geonames default = 5
'country' => 'country', // Geonames default = ALL
),
'pager' => FALSE,
'required_parameters' => array( // If you have set query_defaults you should not include the parameter here
array('lat', 'lng'),
array('postalcode', 'country')
),
'required_parameters_type' => 'all',
'query_defaults' => array(
'maxrows' => 15,
'radius' => 10
),
'columns' => array(
'title' => 'title',
'summary' => 'summary',
'feature' => 'feature',
'population' => 'population',
'elevation' => 'elevation',
'lat' => 'lat',
'lng' => 'lng',
'wikipediaUrl' => 'wikipediaurl',
'thumbnailimg' => 'thumbnailImg',
'lang' => 'lang',
'distance' => 'distance',
),
);Can this be commited in dev?

#1
Can this please be tested by others and commited in dev?
#2
6.x-2.x-dev is not the current dev version, that is essentially abandoned. Use 6.x-1.x-dev.
Changed applied to that.
#3
Automatically closed -- issue fixed for 2 weeks with no activity.