User:Caroig/Geobox/Slovakia

Conversion to Geobox from sk:Wikipedia resources

$map = array (   'Obrázok' => 'image'    'Názov' => 'name'    'URL znaku' => 'symbol'    'Kraj' => 'region'    'Okres' => 'district'    'Nadmorská výška' => 'elevation'    'Rozloha' => 'area'    'Počet obyvateľov' => 'population'    'Stav k' => 'population_date'    'Prvá písomná zmienka' => 'established'    'EČV' => 'code'    'PSČ' => 'postal_code'    'Predvoľba' => 'area_code'    'Website' => 'website'    'Starosta' => 'mayor'  … );

$data['area'] = str_replace (',', '.', $data['area']);

I would like also to propose to set area_round to "2" and population_density to "auto". established_type should be set to "First mentioned". code_type should be " Car plate ". symbol_type should be equal to "Coat of arms". The Slovak names of regions and districts should be converted to the English names. The names of regions can be perhaps easily changed using the arrays. But it would be a long piece of code if we want to change the names of all 79 districts in this way. I do not know if there is any other way. I Similarly, I do not know how to convert the coordinates. Tankred 15:15, 13 October 2007 (UTC)


 * Thanks a lot, that's exactly what I need. The regions and districts are OK, regions aren't so many and districts only need to replace the word Okres by District. The coodinates can be easily split using regular expressions. Setting symbol_type shouldn't be necessary as the code should do that automatically for Geobox | settlement. One of the first versions of the template ommitted that. Would you find it useful if the teplate also set the statistsics field that creates a direct link to the statistics as in Necpaly? We need to get the settlement's ID code to do so but I suppose that's what the field Kód is about. – Caroig (talk) 15:33, 13 October 2007 (UTC)


 * Yes, by all means. I did not know what the Kód field means, but you are right, it is exactly that "missing link" between Wikipedia and the municipal statistics database at statistics.sk. While converting infoboxes into geoboxes, I used "Source:..." in footnotes because I was too lazy to search manually the database at statistics.sk. Now, it can be fully automated and we can use the "Statistics" field in geoboxes instead of footnotes. Tankred 21:00, 13 October 2007 (UTC)