migurski / Dymo

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

bug fix: implement new dict that ignores casing on key names #27

Open nvkelso opened 12 years ago

nvkelso commented 12 years ago

This didn't entirely work: https://github.com/migurski/Dymo/issues/24

Instead of being specific everywhere, make a new general dict that abstracts this.

Was: place = dict( [ (key.lower(), value) for (key, value) in place.items() ] )

With other places that assume lowercase like: line 180 in init.py name = row['name'].decode('utf-8')

nvkelso commented 12 years ago

This also broke the export retaining the values in columns that aren't lowercase key names.

For instance, "name", "lat", "long" etc values are pushed out. But "NAME" would result in "" values in the correctly cased column (NAME in, NAME out).

"type": "Feature", "properties": { "sizeClass": "", "long": -73.980019999999996, "point_size": 8, "name": "New York", "UNLOCKED": "", "font_file": "../fonts/Arial.ttf", "zoom_start": 1, "rank": 1, "LABEL": "", "STATE": "", "LINK": "", "joinMe": "", "TRACKBACK": "", "lat": 40.749980000000001, "font_size": 9, "REGION": "", "population": 19040000 } },