We do this by going to Edit -> Find and, in the Style box, searching for the term “line” … then close the Find popup and hit Ctrl+K to combine all the lines into a single object. To get to this point, we want to select all of the lines and merge them into one object. So in the next few steps, nothing is going to look different visually on the map we’re just changing how the map is organized internally. In order to follow his approach, we’re going to want to end up with exactly one “path” for every state (so we can recolor them with our own data) and a final one for the state outlines (so we can change all the line colors at once). Open this SVG file in Notepad or similar, and you’ll see it contains XML, just as Nathan’s tutorial explains. You may as well save this as a SVG file now. To do this, just click and drag to select it, then hit Delete. I deleted Puerto Rico (bottom right corner) at this point, since I don’t need to map its data very often. Let’s Ungroup again so that we can select each state separately. Great, now we can edit this smaller map to contain just the pieces and info that we need. Then drag the map into the document and stretch it out using the arrows (while holding down Ctrl so that the aspect ratio doesn’t change). I also wanted the final image to be around 500×500 pixels, so you can set that custom size under File -> Document Properties. Right-click and select Ungroup to break it up into its components, then select just the map in the top right and copy it into a new document. The mini-map I wanted is in the top right corner, but if you try to select anything, it’s initially all grouped together (so if you click and drag, the entire document moves together). With Shift + and Shift – you can zoom in and out of the map. It’s straightforward to open map2.eps in Inkscape. Fortunately, several images from the Census Atlas are available in EPS format near the bottom of this page, under “PostScript Map Files.” With access to such vector graphics, we can get started.įrom that website, I downloaded the “Location – Map 2″ file. To create a SVG file from this EPS, you’ll need a vector graphics program like Adobe Illustrator… or the open source alternative, Inkscape, which is what I used. Unfortunately, I haven’t been able to track down any colleagues who know where to find the original shapefiles for this map. I have wanted a map like this for my own purposes, when mapping a variable for all 50 states and DC. the fine detail was smoothed out) but still recognizable, and DC was enlarged to be big enough to see. I particularly liked the small multiples of state maps, which were highly generalized (i.e. The following was inspired by the 300-page Census Atlas of the United States, full of beautiful maps of 2000 decennial census data. And while I’m at it, how could I turn down the opportunity to replicate Nathan’s Python approach in R instead? However, if you don’t have a SVG handy already and instead you want to repurpose a map from another vector format such as PDF or EPS, there are a few extra steps that can be done in the free tool Inkscape. bat file, then copied the file into the directory, it would let me replace the old file).īingo - now eps import works fine with inkscape 0.I love Nathan Yau’s tutorial on making choropleths from a SVG file. Then save it (i had some issues as it required an administrator to save, but found if I saved it on the desktop as a. Rem (console mode gs) if the user hasn't set them. Rem Set default values for GS (gs with graphics window) and GSC Someone refers to 'editing the gssetgs.bat file manually', so I found this file (in gs9.04/lib/ directory) and edited it with notepad. Turns out it is a bug with the latest Ghostscript version. After some searching online, I found a reference to this issue here. Which seemed unusal given that I had installed 64-bit gswin64c. I tried to use ps2pdf in command line to see if it would work, it returned the message 'gswin32c is not recognised' or similar. I followed the advice here:, then as it still wasn't working additional advice offering the supposed solution from here:, but i was still getting the message 'Error reading temporary SVG file: '. I had the same problem as above - Windows 7 64-bit, Ghostscript 9.04 for Windows (64 bit) and Inkscape 0.48, error messages ahoy. I've just managed to solve this problem, and given that I couldn't find the solution anywhere else on the web, thought I better post it here.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |