Each district for that specific type has a weight of 1 + 1 for the production building, +2 for the upgrade. For rural all districts weight at .75. So you've got 8 mining districts, which means a weight of 8 towards a mining world (8*1). You've got 8 mining districts and 3 farming districts, so a weight of 8.25 towards rural (11 * .75).