scotthmurray / d3-book

Code examples for “Interactive Data Visualization for the Web”
http://d3book.com
Other
2.4k stars 1.79k forks source link

Increase accuracy of geocoded cities #3

Closed jeffweiss closed 7 years ago

jeffweiss commented 11 years ago

Prior to this commit, the latitude and longitude for most of the cities was wildly inaccurate and in some cases, placing cities on opposite sides of the country. This commit refines those locations by using the same geocoder but excluding city from place and a mostly comprehensive visual inspection of the resulting placements.

jeffweiss commented 11 years ago

Original Data

Screen Shot 2013-04-20 at 5 18 17 PM

Updated Data

Screen Shot 2013-04-22 at 12 31 04 PM

jeffweiss commented 11 years ago

Corrected coordinates for El Paso, Raleigh, and Arlington after animations from jeffweiss/interactive-data-visualization@8bad51fc76f9d279e7b1f35b5e924b04aea294ec revealed them to be way off

scotthmurray commented 11 years ago

Thanks for this, Jeff! As you've discovered, I intended to include a mention in that chapter on the importance of verifying your geocoder results… and my results were way off, resulting in misplacement of city-circles.

While this is quite helpful, I won't merge this request yet, because it's more important that the sample code match exactly what is in the current version of the book (even if that is erroneous). We'll be releasing an update to the book that will address this bad geodata, and I will update the code here to sync at that time.

I'm also looking for suggestions on how to maintain different versions of the code samples. Right now, I'm thinking of having a different branch for each release of the book. So the current "master" branch would be moved to a new "first release" branch. Then a new "second release" branch could have these corrections, and so on.

shepazu commented 11 years ago

For what it's worth, I went through this same exercise of correcting the data, and was just about to issue a pull request, before I saw this.

It was fun for me to retrieve and munge the data myself, so I don't mind the exercise, but I do think it would be better to have accurate data than to match the book; without correcting the data myself (or looking first on github, doh!), I didn't know if the error was with the dataset or the code, and others might feel a similar lack of confidence. You could even include a disclaimer in the HTML file that the data were updated and don't match the renderings in the book.

But it's obviously up to you... and like I said, it was fun to rectify the data myself. :)

scotthmurray commented 11 years ago

Thanks, @shepazu! You make a good point about including a visible disclaimer or note within the HTML itself. I’m going to look into any potential conflicts this could cause with the print and ebook editions.

scotthmurray commented 7 years ago

@jeffweiss thank you again for fixing this data file so comprehensively!

I've corrected this file for the 2nd edition of the code examples (to accompany the 2nd edition of the book).

If you shoot me an email (http://alignedleft.com/contact), I would love to make sure you receive a free copy of the 2nd ed. once it's out. Thanks again!