According to the schema the @percentage attribute for the various geocoding elements must be a positive integer. This is sometimes a problem for projects with many sub-national locations as the actual percentage of the activity in that location may be < 0.5%. In these cases there is no way to properly use the @percentage element - 0.4% rounds to 0% but @percentage must be a positive integer, so 0% is not allowed.
Two possible solutions: (1) allow the @percentage element to be an integer where 0 <= @percentage <= 100. (2) use floating point numbers for the @percentage element.
(1) may cause problems for human readers, as 0% of an activity being focused on a particular location is not particularly sensical at first glance (it may also get incorrectly ignored by some mapping scripts), while (2) may result in confusion for some users (representing 66% as 0.66 instead of 66.0, for instance) and may also result in more invalid XML files if rounding error causes the sum of the @percentage elements to not equal 100. However, the current method is also flawed because automated XML generation scripts running off large datasets may round the @percentage attribute for certain <location> elements to 0, which will result in invalid XML.
(To date EWB's solution has been to omit the @percentage attribute for any geocoding element where @percentage = 0.)
0 Comments