AARoads:Maps/Obsolete Tutorial
Jump to navigation
Jump to search
This tutorial has been deemed obsolete by the discussion at AARoads:Deletion requests#AARoads:Maps/Tutorial. It has been maintained for the purpose of historical preservation.
AARoads:Maps/Tutorial is the current standard tutorial for creating maps for this wiki.
Creating an SVG file
This is a tutorial for creating road maps for WP:USRD with QGIS and Inkscape. This tutorial was originally written by Xenon54. Contact him with any questions or inaccuracies.
- Install QGIS. For best results, use 2.18 Las Palmas which is the version this tutorial was written for. Newer versions will work too, just beware that some menus or options may be a little different compared to what the tutorial says. The latest version is currently . These links may not be up-to-date and are merely provided as a convenience; the official download page is here.
- Install Inkscape from inkscape.org. You'll be using it later.
- Now that you've downloaded QGIS, you need to feed it Geographic Information System data, herein referred to as just "data". It is freely available from many government and private sources. Here are some good places to start:
- National Highway Planning Network. Data provided by Federal Highway Administration, consists of roads in the National Highway System. These are all Interstates and US routes, plus major arteries.
- Census 2000 TIGER/Line Data, provided by ESRI and the Census Bureau. Data for water and other physical features can be found here, as well as data for all streets (use with caution) and Census Designated Places.
- Many state DOTs also have data. For example, the Ohio Department of Transportation provides data for township and county boundaries, as well as each level of road designation.
- Once you're done downloading data, fire up QGIS. You should get a blank screen.
- Go to Layers -> Add a Vector Layer, or press V.
- Browse to wherever you saved your data. You should see a .shp file. Double click it to import it. NHS data (state-level) will have a name of the form SXXNHPN, where XX is the state's FIPS state code -- for example, S39NHPN for Ohio. Census/ESRI data, which is county-level, will be named tgrXXXXXabc, where XXXXX is the FIPS state code followed by the FIPS county code and abc is a code indicating which type of data the file represents -- for example, tgr39103wat holds data for water bodies in Medina County, Ohio.
- We will be focusing on road data first. Now you should see a mass of lines, roughly forming the state's shape. It is time to give those lines some color. In the "Legend" on the left hand side, right-click the layer name and hit Properties. Note: this method will only work for NHS data. Census/ESRI street data does not contain sign designation data, only street names. You will have to leave this data all one color.
- Click Style on the Properties screen and find the drop-down menu that says "Single Symbol". Click the menu and select "Categorized". In previous versions, this was called "Symbology".
- In the "Column" drop-down, select "SIGNT1", then click the Classify button.
- A list of letters should appear. The amount is different for each state, but three are always present: "I" for Interstates, "U" for US Routes, and "S" for state highways. Each type should be assigned a color automatically.
- Click each class you want to color. Click the "Outline Color" box to the right and assign a color to the class based on the standards at AA:MAPS. Here you can also change the width and style of the lines in that class. If you don't want a class to appear, select it and hit "Delete Classes". When you are done, click OK. You can also assign a label to the class by typing a name in the Label box.
- If you downloaded non-road data, such as water or county lines, go into its Properties now. Leave the "Legend Type" at "Single Symbol", and assign the proper color. If you're doing county lines, make the line width rather thick (~.8) so it will show up correctly in step 29.
- You probably have noticed that the road whose article is getting the map (herein: the "highlighted road") is orange or blue or some other color. You need to copy that road from the NHS layer to a new layer you will create to turn it red.
- There are two ways to select the road:
- Lasso method:
- This is only ideal for short roads. On the main toolbar, look for an icon that looks like an arrow with a small "i" next to it. It's next to the pan tool.
- Click the arrows next to this icon, and select the icon that looks like an arrow with a box on top of a yellow shape.
- Zoom in (click the arrows next to the pan tool to find the zoom tool) to where you can see your road clearly. Hold control and select the road so the region you want to highlight red is colored yellow. You can switch between pan, zoom, and select, just don't let go of control.
- Once you're done selecting, let go of control. Find the blue pen (edit layer) icon, then click the arrows a few icons to the right. Click the "copy selected" icon.
- Attribute table method
- Ideal for longer roads, but tough for roads such as the Ohio Turnpike that carry two different non-concurrent designations. Begin by right-clicking the NHS layer and selecting Open Attribute Table.
- A bunch of numbers, looking like a nightmare Excel file, appear. However, some of the numbers are very helpful. Scroll over to the SIGN1 column. This is the designation of the road and is a combination of the next two columns, SIGNT1 (type, which you may remember we used in coloring) and SIGNN1 (number). Concurrencies are indicated by additional entries in SIGN2 and SIGN3. To the right of SIGNN3 is LNAME, the name of the road segment being described by that row, followed by MILES and KM, which should be self-explanatory.
- Now, notice the search box at the bottom. Type the designation of the road you want to highlight (e.g. S11 for a State Route 11), select SIGN1 in first drop-down box, "show only matching" (or "select and bring to top", or "select", whichever you prefer) in the next drop-down box, then finally click Search.
- The matching records (hopefully corresponding to the road you want to highlight) will be selected or move to the top, depending on which option you picked. Select them and hit the "Copy selected rows to Clipboard" icon.
- Lasso method:
- Whichever method you picked, the road you want to highlight should now be yellow. Press N to create a new layer. Under "Type", select "Line". QGIS demands that you define an attribute here. An attribute is a column in the attribute table, such as "SIGN1". It doesn't matter what you call it or what type it is, just define one and click OK.
- QGIS asks you to pick a location to save the .shp file. Pick one and save it. The filename will be the name of your layer.
- Select the layer in the Legend on the left-hand side. Click the blue pen icon to enter into edit mode. Click the arrows to the right of the blue pen icon but to the left of the hand icon. Click the Paste icon in the box that appears.
- Click the blue pen icon to exit edit mode. Save the layer. If you get an "unable to commit changes" error, click don't save. It seems to save anyway.
- Finally, right-click the layer you just created. Click Properties, then the Symbology tab. Leave the Legend Type at "Single Symbol". Now, click on the Outline color box and make the highlighted road red. Be sure to change the width to make it stand out.
- At this point, the highlighted road (remember, the road the map is showing the path of) should be red.
- Now save: File -> Save Project. This will save the current layers and view as a .qgs file.
- Export the map as an file that can be used in Inkscape. To export it as a PNG, go to File -> Save as Image. Pick a place to save the image (preferably one where you'll remember where you saved it) and save as a PNG file. To export it as an SVG, see this page for the remainder of the tutorial.
- You're done with QGIS. Open Inkscape.
- Open the PNG file you just saved.
- Go to Path -> Trace Bitmap. A dialogue box will appear.
- Under "Multiple scans", select "Colors". Untick the "Smooth" box. Untick the "Stack scans" box.
- Click on the image to select it, then click Update to preview the trace.
- If you're satisfied with the preview, click OK and wait for potrace to work its magic.
- Once potrace is finished, move the traced image out of the way and delete the PNG. Put the traced image back when you're done. After you do this, right-click on the image and hit Ungroup. Now each color is a separate path. Interstates are all one path, state and US routes are all one path, but most importantly the highlighted road is its own path. This will make it easier to update the map for alignment changes, extensions, or truncations.
- You can add shields if you want. Use the SVG shields found on Commons. Be sure to save the SVGs, then go to File -> Import to add them to the map. If you don't, the thumbnail won't display come upload time.
- If you added shields, make sure to convert the shield text to path if necessary. Then, save as an SVG.
- You're done with Inkscape. Go to Commons.
- Upload your image. Remember to tag with
{{Created with Inkscape}}
or{{Inkscape-hand}}
. - Add your image to the article. Most, if not all, use {{Infobox road}}, which has a
map
parameter. Add in the formmap=map_name
wheremap_name
is just the file name of the map (e.g. OHSR 8 map.svg, not File:OHSR 8 map.svg). Text can be displayed with themap_notes
parameter.
Congratulations! You are finished!