migurski / Dymo

Map label placer with simulated annealing.
148 stars 17 forks source link

omit NULL population values from output, force format to be Number not String #32

Open nvkelso opened 12 years ago

nvkelso commented 12 years ago

When a population (or designated field) lacks a value, the CSV parser interprets that as a NULL value.

Somehow when Dymo is making the cut, it's not dealing with these right. A NULL value should be excluded from the results or stored as a -1 in the output.

Because the output "population" field is now mostly numbers but has a NULL which is a string, the Dymo logic for assigning types to the columns transforms all to string.

Because the MSS in Cascadenik is making numerical comparisons with >=, it fails on these ones.

For example:

NULL POPULATION North America zoom 7: 7 5955895 Ft. McMurray Fort McMurray 56.7335 -111.38519 CA no AB 8 18 ../fonts/Arial Bold.ttf North America zoom 8: 7 5955895 Ft. McMurray Fort McMurray 56.7335 -111.38519 CA no AB 8 20 ../fonts/Arial Bold.ttf 8 6136944 Saanich Saanich 48.54964 -123.36931 CA no BC 8 20 ../fonts/Arial Bold.ttf

But somehow this one is okay, even though it is missing population value it doesn't' end up in SHP: 7 5921225 Chicoutimi Chicoutimi 48.41963 -71.06369 CA no QC 8 20 ../fonts/Arial Bold.ttf