Great tutorial, Nathan!For those of you using BI tools like Pentaho, I’ve created a proof of concept of the solution above using Pentaho data integration, which is also free. Pentaho is a little less intimidating than scripting in Python, since it has a Visio-style GUI.
Choropleth Maps in R How to make a choropleth map in R. A choropleth map shades geographic regions by value. CHOROPLETH MAPS. Choropleth Maps are thematic maps based on predefined aerial units. Think of it as a multi-colored checkerboard map. Some maps, (ex. Road maps), show many types of data while thematic maps are made to show only one specific set of data.
My solution required a bit of XML knowledge, but the actual formulas I used in the solution were quite rudimentary.You could easily tweak the Pentaho solution to load the data from Excel, a database or any other type of data source.(Yeah, I know my CSS is a little ugly, I’m working on it!). Here’s my map:It’s a movie of twenty years of data 1990-2009. Rather than group counties together and color each group exactly the same, I used the same color (dark red #800000), but made the opacity proportional to the rate. (Specifically fill-opacity = min(rate.5, 1). A 20% rate is fully opaque,% is transparent.
Ackground is white) And I thought it looked best with zero-width boundaries.20 frames; 0.5 sec/frame.The biggest PITA was saving each of the 20 SVG files in Illustrator, to PNG so GraphicConverter could use them. I’m having a strange problem that I hope somebody can help me with. The script runs OK, but in addition to modifying the path tags as expected, it’s also changing the and tags by pulling out the closing delimiters in those tags, and then adding new closing tags at the very end of the file.
The resulting svg file doesn’t render unless I go in and manually correct it.I’m running Vista, Python 2.6.4, and Beautiful Soup 3.0.7a. Any help would be greatly appreciated. Even with the problems this is an absolutely amazing tool! I’m having a strange problem that I hope somebody can help me with. The script runs OK, but in addition to modifying the path tags as expected, it’s also changing the sodipodi:namedview / and defs id=”defs9561″ / tags by pulling out the closing delimiters in those tags, and then adding new closing tags at the very end of the file. The resulting svg file doesn’t render unless I go in and manually correct it.I’m running Vista, Python 2.6.4, and Beautiful Soup 3.0.7a. Any help would be greatly appreciated.
Even with the problems this is an absolutely amazing tool! I’m stuck on this too.I installed BeautifulSoup as in the comments above.I used the script above except I addedimport csvfrom BeautifulSoup import BeautifulSoup(at the beginning)and made the line that copied over as three lines one line again.Now when I try “python colorizesvg.py unemployment2009.svg”, it makes the svg file, but it the image part is blank (but the right size). The svg file has plenty of code in it, but it appears to not display anything.
The fill colors have been changed as expected, and I don’t see any errors, but something isn’t working.Any ideas? I may be a bit slow, but I think I’ve figured this out. Beautiful Soup is doing a lot more than just parsing the svg file.
The prettify command tells it to fix anything it thinks is wrong with the file, and it doesn’t seem to like the embedded closing tags in the sodipodi:namedview and defs id tags, so it strips them out and adds explicit closing tags at the end of the file, which breaks it.The easy solution is to edit the original svg file to add explicit closing tags where they should have been in the first place. This keeps Beautiful Soup happy and works fine. I’ll post a link to my corrected version in a bit. Nice tutorial Nathan!(Lots of calls for R solutions I see, though none of the Revolutions challengers included Alaska or Hawaii in their solution.)I’m personally interested in (a) keeping things dynamic and (b) making things web-native.With that in mind, I ported some of your code over to javascript, hacked the CSV into JSON/P-ish form and used SVGWeb to render the county shapes:I haven’t used SVG in a long time so this was a nice refresher. SVGWeb works well: it doesn’t mess with Safari or Firefox but I tested this in IE8 too and got comparable results. as promised.The only tweak I made was to set stroke-opacity to 0.1 instead of stroke-weight, because the flash renderer used by SVGWeb didn’t like fractional line weight. Very basic question here – how do I run the script (step 14) in Windows?My file path is C:UsersOwnerDesktopthematicmapscolorizesvg.pyI was reading about making python scripts ‘double-clickable’ and it was a bit over my head, but when I double-click to open it, it opens python quickly and then closes.
I was told to use CMD but I’m a newbie and don’t know what to type to run the script with the proper output. Also – I’m using Python 2.6.4 Windows installer (Windows binary — does not include source) and I put Beautiful Soup in the Site Packages folder correctly as well. Not knowing anything about python, I copied and pasted the code in step 13, following ### colorizesvg.py into a new document that I titled colorizesvg.py. I also removed any line breaks in the county style section, which seemed to give me problems initially.When I run the script, it does generate a file titled unemployment2009.svg, but all I see is a blank white document. When I open the document in a text editor, there is definitely information in it, though I cannot yet decipher it (being the layman that I am).I am running python 2.5.1 and have beautiful soup 3.0.8 in the same folder as all of my unemployment/colorize files.Any ideas?
How do you want to use the map? Do you want to create a static image or something that people can interact with to explore data? I created an interactive choropleth map of Malaysia here: using leaflet.js and hand-drawn geoJSON for the state boundaries.
It's easily extendable so you can feed other data into it (as long as you know a little about javscript and JSON). Feel free to contact me if you want to ask any questions - you should be able to find my twitter handle on github.–May 28 '13 at 10:53. I think you dont need any template to make thematic map in excel. If you have problem with color, you can check out for some aspect about colors.making thematic maps with excel, you can watch this video and - Creating Simple Maps with Microsoft Excel.
Beside this Microsoft MapPoint may help you about creating maps in excel.Microsoft MapPoint is a product that you can use to integrate mapsinto Office documents, including Excel worksheets. MapPoint sharesmuch of the functionality of the Microsoft Office System, such ascopying and pasting. Create a map with MapPoint and Excel,nevertheless you want template, you check out this link:. Choropleth Map USA by Congressional Districts,.
Pop Soda Coke Choropleth Map,. Choropleth Map Template,in addition to this:.MapCite: Web Mapping and Excel Location Intelligence Applications, MapCite's Excel AddIn -.StatPlanet: Create fully customizable, feature rich interactive maps & graphs and publish them online.The award-winning StatPlanet is a free download,.i hope it helps you. You can try the public beta of 'Esri Maps for Office'Esri Maps for Office is an add-in for Microsoft Office that brings mapping capabilities into Microsoft Excel and Microsoft PowerPoint. With Esri Maps for Office, you can easily create a geospatial view of your organization's data by creating an interactive map that includes data from Excel and ArcGIS services—all without leaving the Excel environment. From Excel, you can publish your Excel data to ArcGIS Online, push maps you've created to PowerPoint, or copy maps as images that can be inserted anywhere that paste functionality is supported. Esri Maps for Office brings mapping into PowerPoint by allowing you to include maps from Excel or maps from ArcGIS Online as slides within any PowerPoint presentation'It comes with basic templates to get you started.More info.