Modifying the Cities Shapefile for AWIPS using ArcGIS 8/9.x

Ira Graffman OST/SEC

16 May, 2006

This document contains instructions on how to edit the city shapefiles
used in many of AWIPS applications and for RIDGE radar displays. If you
need to add, delete or modify a city's location, this document will help
you perform this task. It is a step-by-step tutorial aimed at ArcGIS
8/9.x ArcMap users. Experienced users can choose which section contains
information in which there is detail on unfamiliar procedures

**Contents of the Cities shapefile**

In the past, the text file, citiesInfo.txt was used for cities
information for D2D and LSR. Another shapefile was used for GFE. In
order to make an easy transition into a single shapefile for all
applications, field names that are used by applications in builds OB6
and earlier have been retained. Better, more descriptive field names
were selected to be used in future builds. Thus, the cities shapefile
has some duplicate field names -- a legacy name and a new name.

+-----------+------------------------------------------------+---------+
| Field     | Description                                    | Old or  |
| Name      |                                                | New     |
|           |                                                | Field   |
+-----------+------------------------------------------------+---------+
| St_fips   | Two digit state FIPS Code                      | Old     |
+-----------+------------------------------------------------+---------+
| Sfips     | Two digit state FIPS Code                      | New     |
+-----------+------------------------------------------------+---------+
| C         | Three digit county FIPS code                   | Old     |
| ounty_fip |                                                |         |
+-----------+------------------------------------------------+---------+
| Cfips     | Three digit county FIPS code                   | New     |
+-----------+------------------------------------------------+---------+
| Id        | Unique identifier \*                           | New     |
+-----------+------------------------------------------------+---------+
| Name      | City Name                                      | N/A     |
+-----------+------------------------------------------------+---------+
| Lon       | Longitude of city                              | N/A     |
+-----------+------------------------------------------------+---------+
| Lat       | Latitude of city                               | N/A     |
+-----------+------------------------------------------------+---------+
| Pop_1990  | City's population                              | Old     |
+-----------+------------------------------------------------+---------+
| P         | City's population                              | New     |
| opulation |                                                |         |
+-----------+------------------------------------------------+---------+
| St        | State abbreviation                             | N/A     |
+-----------+------------------------------------------------+---------+
| State     | Full state name                                | N/A     |
+-----------+------------------------------------------------+---------+
| W         | blank, 1, 2, 3, 01, 02.  A leading 0 means the | New     |
| arngenlev | location\                                      |         |
|           | is a city/county hybrid.  1 means major city,  |         |
|           | 2 means average warning location, and  3 means |         |
|           | wide spot in the road                          |         |
+-----------+------------------------------------------------+---------+
| w         | blank (point location),\                       | New     |
| arngentyp | + (area weighted centroid), = (user supplied   |         |
|           | centroid), and\                                |         |
|           | \~ (centroid is point furthest from boundary)  |         |
+-----------+------------------------------------------------+---------+
| W         | Original value of warngenlev and warngentype   | Old     |
| atch_warn | concatenated                                   |         |
+-----------+------------------------------------------------+---------+
| Z_        | Unused                                         |         |
| watch_war |                                                |         |
+-----------+------------------------------------------------+---------+
| Prog_disc | Progressive disclosure value                   |         |
+-----------+------------------------------------------------+---------+
| Z         | Unused                                         |         |
| prog_disc |                                                |         |
+-----------+------------------------------------------------+---------+
| Elevation | Elevation of city in                           |         |
+-----------+------------------------------------------------+---------+
| comboflag | city/county combination flag                   | New     |
+-----------+------------------------------------------------+---------+
| L         | Unused at this time                            | New     |
| and_water |                                                |         |
+-----------+------------------------------------------------+---------+
| Recnum    | Unused at this time                            | New     |
+-----------+------------------------------------------------+---------+
| Ridge     | Denotes if city used for RIDGE displays        | New     |
|           |                                                |         |
|           | Yes = used for ridge and AWIPS, No = used for  |         |
|           | AWIPS only, Only = used for RIDGE only         |         |
+-----------+------------------------------------------------+---------+

Each city has its own unique identifier. This field was added to aid in
distinguishing cities with the same state having the same name and to
link the city with an urban area (if any).

**Overview of editing city shapefiles**

There are three editing functions that will need to be performed to edit
the city shapefile. A city may need to be added, a city may need to be
removed, or a cities location or other attribute may need to change. It
is recommended that the shapefile be subset by WFO for easier editing
and emailing. Once a site finished editing the subset shapefile, the
shapefile is to be sent to NWSHQ to be integrated into the national
version of the shapefile. Only those cities within the CWA boundaries of
the submitting WFO will be put into the national version.

You may find that having a background of counties, forecast zones or
other data might be useful in determining what the radar display might
look like and aid you in editing the data. A source of NWS-centric data
is the AWIPS Map Database Catalog (AMDC) located at
<http://www.weather.gov/geodata>. Download the zip file(s) and unzip.
Then add the shapefile to your map as in the instructions to follow.

For data that cannot be found in the AWIPS shapefiles, the Geographic
Names Information System (GNIS) <http://geonames.usgs.gov/> is useful
for city data. Click on "Query GNIS" and fill out the name of the city
and the state and search. By clicking on the feature name in the
returned list, you will be able to retrieve the latitude and longitude
coordinates of the city in decimal, the required format for the
shapefiles.

**Starting ArcMap**

Start ArcMap via shortcut or start menu.

If you get the "Start Using ArcMap with" window, click OK to start a new
session or double click a saved project (an .mxd file)

If you are given a screen for adding data when opening a new session,
click to the location of the city shapefile and add it using the "Add
Data" dialog.

ArcMap allows the user to add many different "toolbars" to the user
interface. The "Standard" and "Editor" toolbars are required for the
cities editing tasks. If you do not see the Add layer button, use the
View-Toolbars menu and make sure "Standard" is selected. In addition,
if you can't find the Editor Toolbar as pictured below, add the "Editor"
toolbar from the View-Toolbars menu.

![](media/image1.png){width="6.997916666666667in"
height="1.1145833333333333in"}

Figure 1 - Standard Toolbar with Add Layer and select button

Add Layer Select

![](media/image2.png){width="7.127777777777778in"
height="1.2805555555555554in"}

Figure 2 - Editor Toolbar

To add a shapefile to the map, click the "Add Layer" button. You will
get a Windows standard file add dialog. Find the cities shapefile and
select it. You may also want to add state/and or county shapefiles as
background maps to assist you.

![](media/image3.png){width="5.041666666666667in" height="3.34375in"}

Figure 3 - Add Data Window

**Sub setting a cities shapefile**

In order to subset a cities shapefile, the CWA boundary shapefile is
required. If this shapefile is not already on your system, download a
zipped copy from the AMDC at

<http://www.weather.gov/geodata/catalog/wsom/html/cwa.htm>. Unzip the
file and add the shapefile using the "Add Layer" button.

Select the CWA using the select tool (see Figure 1) or by following the
instructions in the **Finding a City or CWA** section at the end of this
document.

Use the SelectionSelect by location menu item. In the window, as in the
example below, choose "Select Features From" and be sure the cities
shapefile is checked. Make sure that "intersect" is selected and the CWA
Layer is selected. Finally, make sure "Use Selected Features" is
highlighted and click "Apply". Then "Close" the window.

You should see the cities within the CWA highlighted. Finally, right
click the cities layer and in the pop-up menu select "DataExport data.

Choose a name and location for the new shapefile and click ok. Answer
yes to adding the shapefile to the map as a layer.

To eliminate confusion, remove the full cities layer by doing a right
click on it and selecting "Remove".

![](media/image4.png){width="4.197916666666667in" height="5.84375in"}

Figure 4 - Select by Location menu

![](media/image5.png){width="5.9944444444444445in"
height="4.036111111111111in"}

Figure 5 - ArcMap Screen with Selected cities

**Adding cities to the shapefile.**

1.  Start editing with the EditorStart editing menu item

    Editor menu

> ![](media/image6.png){width="5.995138888888889in"
> height="0.9222222222222223in"}

Figure 4 - Sketch Tool

2.  Click the sketch tool. Right click the tool somewhere near where the
    city belongs. Don't try to be exact -- a pop up window appears --
    select "absolute x, y". In the resulting window, put in the exact
    longitude and latitude of the point. Press the "Enter" key to save
    the edit and add the city.

![](media/image7.png){width="6.0in" height="3.2506944444444446in"}

Figure 5 - Screen after city has been added

3.  Edit the city attributes by right clicking on the city layer in the
    Table of contents and choosing "Open Attribute Table".

4.  If your city is not highlighted in the opened table, click the
    "Selected" button to see the city. Click on the empty cell on the
    highlighted row in the "City" column. Add the city name and use the
    "tab" key to move from column to column to add or modify the
    attributes.

> ![](media/image8.png){width="6.749305555555556in"
> height="3.1770833333333335in"}

Figure 6 - ArcMap Attribute Table

> 5\. Repeat steps 1-3 until you are finished adding cities. When
> finished editing, use the EditorStop Editing menu item. Make sure you
> save your edits.

**C. TO EDIT CITIES ATTRIBUTES (to make changes to a city name or site
id)**

1.  Open the table as in Step 3 above and start editing.

2.  Find the city to be edited using a method described in Section F.

3.  Make the edits to the record in the table

4.  Stop editing and save.

**D. TO CHANGE A CITY'S LOCATION**

1.  Find the city from the map or via methods in section F. If you use
    the table method to find the city, go back to the map and find the
    city via right click the city layerSelection"Zoom to Selected
    Features"

2.  Start Editing with "EditorStart Editing"

3.  Click the Edit tool. Be sure that the task is set to "Modify
    Feature".

    Task set to "Modify Feature"

> ![](media/image9.png){width="5.9944444444444445in"
> height="0.9006944444444445in"}

Figure 7 - Edit Tool

4.  Move the cursor over the city. When it changes shape, right click
    and select "Move to". Enter the latitude and longitude.

5.  Open the table and manually edit the latitude and longitude.

6.  Stop editing and save edits when finished.

**E. TO DELETE CITIES**

1.  Start editing.

2.  Find the city using a method described in Section F.

3.  Get back to the map. layerSelection"Zoom to Selected Features

4.  Hit the delete key

5.  Make sure you stop editing and save

**Finding a City or CWA**

You can just find the feature on the screen or in a table, or you can
search for it using the Query Tool. In order to make the selection
process easier, make the city layer the selectable layer. In ArcMap 8.x
and 9.0 use the menu Selection"Set Selectable Layers" and choose the
layer. In ArcMap 9.1, right click the layer - layer"Selections"Make
this the Only Selectable Layer". You can access the Query tool via the
Selection"Select by Attributes" menu or choose "Select by Attributes"
by clicking the "Options" button while the attribute table is open.

To find a feature by name, double click \[city\] or \[cwa\] in the left
window. Click "Get Unique Values" and unique names will appear in the
right Unique Values window.

Now click the equals sign (=) and scroll and double click the feature
name or type it in (use single quotes if you type it in). Click Apply to
select your feature.

![](media/image10.png){width="3.9375in" height="5.1875in"}

Figure 8 - Select by Attributes Window

**G. Visualization Aide**

**In order to assist you in editing cities, it** is possible to
configure the ArcGIS screen to be of the approximate size as the radar
image. Click in the "Scale" window on the Standard toolbar and enter the
string "1:3,352,925" followed by the Enter key. You will probably want
to have an additional background map to assist you.

![](media/image6.png){width="5.995138888888889in"
height="0.9222222222222223in"}

Figure 9 - Scale Window

Editing roads or rivers shapefiles

A. Adding Roads or Rivers

When you need to add roads or rivers, probably the easiest way to do
this is to take the feature to be added from an existing data set
(*primary data source)* and put them into the proper shapefile. Two good
potential data sources are given below. Another option is to manually
draw the new feature.

*Data sources* -- one source of data is the US National Atlas at
<http://www.nationalatlas.gov/>. Click the "Mapping professionals" link
and then the "Raw data" link. Roads will be under "Transportation" and
Rivers under "Water".

Another potential source is DOC Census TIGER data available at
<http://arcdata.esri.com/data/tiger2000/tiger_download.cfm>. Click on
the state for which you want data. You can select a county then the
roads and/or rivers OR you can select roads or rivers and the counties
you want. Roads are under "Line Features -- Roads" and rivers under
"Line Features -- Hydrography".

Once the data source is found and the data layer is added to ArcMap you
can search for the feature(s) that you want via the Query Builder, the
table or via the map on the view. Regardless, be sure that the target is
set to the layer you want to edit after doing the start edit command.

There are two ways to accomplish the task of getting the feature(s) you
want into the shapefile.

![](media/image11.png){width="5.991666666666666in"
height="0.9083333333333333in"}

Figure 10 - Target window

*Option 1*: From a primary data source

1.  Find/Select the feature in the primary data source shapefile in the
    same manner as finding cities.

2.  Start editing the RIDGE shapefile (Editor"Start Editing").

3.  Use Edit "Copy"

4.  Use Edit"Paste"

5.  The new feature should now be in the RIDGE shapefile, complete with
    attributes.

6.  Repeat until finished

7.  Use Editor"Stop Editing" and save.

*Option 2*: Add features by hand.

1.  Start editing the RIDGE shapefile (Editor"Start Editing").

2.  Make sure the task is set to "Create New Feature"

Sketch Task

Tool Window

![](media/image6.png){width="5.995138888888889in"
height="0.9222222222222223in"}

Figure 11 - Task and Sketch Tool

3.  Use the Sketch tool to draw the feature -- a series of left clicks
    until the drawing is done, then a double click to end the drawing or
    right click"Finish Sketch".

4.  Right click the layer in the table of contents and "Open Attribute
    Table"

5.  If you do not see the highlighted record, click "Selected"

6.  Edit the attributes

7.  Stop editing (Editor"Stop Editing") and save.

    **B. TO EDIT ROAD OR RIVERS ATTRIBUTES**

This task is accomplished exactly the same way as for cities data --
Find the feature to be edited and edit the table.

**C. TO EDIT A ROADS OR RIVERS LOCATION OR SHAPE**

1.  Start editing the shapefile

2.  Use the edit tool (see figure 7).

3.  To move the feature, single click on it, then put the cursor on the
    feature and "drag" it to where you want it.

4.  To reshape the feature, double click the feature with the edit tool.
    The vertices of the feature will show up as small squares. Click on
    the vertex to move and drag it to the new location.

5.  If you do not see the detail in the small squares, it may be
    necessary to zoom in further. Use the Zoom tool by pressing and
    holding the mouse button on a location nearby and dragging the
    square to enclose the area to be zoomed to.

> ![](media/image6.png){width="5.995138888888889in"
> height="0.9222222222222223in"}

Figure 12 -- Zoom Tool