Closed wolframteetz closed 8 years ago
Want to see if you can implement the solution the author wrote about there? I wonder if this fix wouldn't do it robustly: ''' import sys reload(sys) sys.setdefaultencoding('utf8') '''
Seems to work fine with that fix ;)
Cool. Wish I had unit tests written to make sure this doesn't break elsewhere, but I'll just assume it doesn't. Bad, bad developer, Drew.
Great developer, answers issues within seconds...
Btw, how did you generate the html code from the python list? Did I miss this?
I have e.g. [[48.1357055, 11.4529908], [48.1237425, 11.4817875], [48.1226858, 11.488059], [48.10884, 11.50052], [48.09478, 11.48443], [48.08183, 11.47625], [48.08584, 11.45199], [48.0878668, 11.4421133], [48.08417, 11.38985], [48.1077838, 11.4094118], [48.12023, 11.41364], [48.13611, 11.42765]]
now, and what I need is
var isochroneCoords5 = [ new google.maps.LatLng(41.8899589,-87.6355558), new google.maps.LatLng(41.886802,-87.6339451), new google.maps.LatLng(41.8869589,-87.632424), (...) ];
Hmmm... this map is going to teach me python in the end I guess? Any chance you have that function with html output flying around? Or is there such a thing in python?
Ok, manually it could work like this for label in isochrone: print 'new google.maps.LatLng('+str(label[0])+","+str(label[1])+"),"
Going to automate this to get a "proper" map like the one on drewfustin.com
Yeah, I have a wrapper function inside isocronut.py to call instead of get_isochrone() -- generate_isochrone_map(). Call it the same way with the same inputs as you would get_isochone, but it outputs not only the list of points, but also writes an isochrone.html file. Looking at it now, it might throw an exception if the folder output/ doesn't exist locally.
For the error see e.g. http://www.markhneedham.com/blog/2015/05/21/python-unicodeencodeerror-ascii-codec-cant-encode-character-uxfc-in-position-11-ordinal-not-in-range128/