File Geodatabase
File Geodatabase
File Geodatabase
ArcGIS can directly use or import most GIS file formats in common use for
geoprocessing and display. The recommended file format for use in ArcGIS is the file
geodatabase that stores map layers, data tables, and other GIS file types in a system folder
that has suffix extension .gdb in its name. In this chapter you will learn about working
with file geodatabases.
TUTORIAL 4.1
1. In the Catalog Tree panel, expand D:\CE210\Tutorial 4, create a new file named New File
Geodatabse in the right panel of the window.
2. Right-Click on D:\CE210\Tutorial 4 in the left panel then New and then New File
Geodatabse. Click New File Geodatabase. It will create a new geodatabase file having
extension .gbd.
3. Change the name from New File Geodatabase.gdb to Bangladesh District.gdb.
1. In the Catalog’s right panel, right-click the Bangladesh District.gdb, click Import, Feature
Class (multiple).
2. In the Feature Class to Geodatabase (multiple) dialog box, click the browse button to the
right of the Input Feature Fields, browse to D:\CE210\Tutorial 4 click to open that folder,
hold the shift-key down, and select both district.shp and major river.shp. Click add and click
OK.
4.1.4 Import a data table
1. In the left panel under Bangladesh District.gdb, right click on District and Rename
Districts_BD.
2. Repeat Step 1 and Rename major river as Major_River_BD.
4.2.3 Copy and delete feature layers
1. In the left panel under Bangldesh District.gdb, right-click District_BD and click Copy. Right
click Bangldesh District.gdb and click Paste and OK.
2. Right-click District_BD_1 and click Delete and OK.
1. In the left panel right-click on the Bangldesh District.gdb click on Administration and then
Compress File Geodatase and click OK.
2. In the My Computer window check the size of the Bangldesh District.gdb folder.
3. In the left panel right click on the Bangldesh District.gdb and click on the Uncompress File
Geodatase and click OK.
4. Close ArcCatalog.
TUTORIAL 4.3
1. Open ArcMap.
2. Add District_BD.shp from the location D:\CE210\Tutorial 4\Bangladesh District.gdb.
3. In the TOC, right-click on the District_BD shape file and click on the Attribute table.
4. In the table, right-click the column heading Total_POP column, click Delete Field and click
Yes.
5. Close District_BD attribute Table.
4.3.2 Calculate a new column
1. In the District_BD Data table, click drop-down arrow of the Table Option button
and click Add Field.
2. In the Add Field window, type Total_POP in the Name field, change the Type to Long
Integer and click OK.
3. Right-click on the Total_POP column heading and click Field Calculator.
4. In the Field Calculator window, double-click on the POP81 in the Fields panel, click the +
button, double click on the POP91 in the Fields panel, then click OK.
5. In the same manner calculate Population density (per sqkm area) of 1981. [Note: choose
‘double’ as the field type.]
4.3.3 Modify a primary key
It is often necessary to join two tables to make a single table. For tables to join, they must
share unique identifiers or keys.
For example, there are administrative records available for Gazipur and Narsingdi
district in the gazi-narsingdi shape file. But you need to make a shape file basing on
arsenic concentration of these district. The GEOCODE for arsenic data table and the
GEOID column of the gazi-narsingdi are the corresponding unique identifiers for these
tables. These attributes would match, except that GEOID has the extra characters “12”
at the beginning of each value. Next, you will use a string function, Mid( [GEOID],3,5),
that extracts a 5-character string from GEOID starting from position 3 and creates a new
column in Attributes of gazi-narsingdi data table to match GEOCODE of Attributes
of arsenic table.
1. Right click arsenic in the TOC and click Open. (Note that GEOCODE in the table has values
such as 33386)
2. Close the arsenic table, right-click on the gazi-narsingdi in TOC, and click Open Attribute
Table.
3. In the gazi-narsingdi table, click drop-down arrow of the Table Option button and
click Add Field.
4. In the Add Field dialog box, type GEOCODE in the Name field, change the type to Text and
Length to 5 and click OK.
5. Scroll to the right to the gazi-narsingdi table right click the GEOCODE column heading, and
click Field Calculator.
6. In the Field Calculator dialog box, change the Type from Number to String; double-click
the mid() function; and in the GEOCODE=box, edit the mid() function to the Mid(
[GEOID],3,5) and click OK.
TUTORIAL 4.4
JOIN TABLES
Often you will need to display data on your map that is not directly stored with a map
layer. For example, you might obtain data from other departments in your organization,
purchase commercially available data, or download data from the Internet. If this data is
stored in a table such as an Excel or comma-separated-value table and has geocode
matching your gazi-narsingdi layer, you can import it into a file geodatabase and join it
to your geographic features for display on your map. Next, you will join the arsenic table
to the polygon gazi-narsingdi feature class. The same steps work if your map layer is a
shapefile or map layer in another format supported by ArcMap.
1. In the ArcMap TOC, right-click the gazi-narsingdi layer, click Joins and Relates, then click
Join.
1. In the gazi-narsingdi table, click the drop-down arrow of the Table Option button and click
Add Field.
2. Type X as the Name, type Double as the Type, and click OK.
3. Repeat step 3 and 4 except the new field Y.
4. Scroll to the right in the attribute table; right click the X column heading; click Calculate
Geometry, Click Yes.
5. Select “X Coordinate of centroid” from the property dialogue box. Click OK twice.
6. Repeat step 4 except select “Y Coordinate of Centroid” from the property dialogue box.
4.5.2 Export a table
When you export joined table as a table, you get all the attributes of the joined tables
stored as one table permanently. Then there are several possible uses for the resultant
table, one of which is to use it to make a new point layer based on the centroid
coordinates.
1. In the Attribute table, click the drop-down arrow of the Table Option button and click
Export.
2. In the Output table field of the Export Data window, click browse button; browse to D:\CE-
210\Tutorial 4; rename the file Export_Output change the name into gazi-
narsingdi_Centroid, change the save as type as “dBASE Table”and click Save, Ok and yes.
3. Close the attribute table.
3. In the Create Feature Class from XY Table window, click the Coordinate System of Input
Coordinates button, click Import, click gazi-narsingdi in Tutorial 4 folder and click ok.
4. Click the Browse button for Output, change the Save As type to shape file , browse to
D:\CE-210\Tutorial 4 change the name to XYgazi-narsingdi_Centroids, click Save, and
click OK.
5. Click the Add Data button browse to D:\CE-210\ Tutorial 4, and click XYgazi-
narsingdi_Centroids.
6. Zoom anywhere in the map. Now you can get a better look at the centroids point layer you
just created.
4.5.4 Symbolize a choropleth and centroid map
Here you will symbolize a map using both gazi-narsingdi polygon and Centroids. Let’s
see how depth of the water level compares with the percentage of Arsenic concentration
per sqkm area.
1. Right-click the gazi-narsingdi layer in the TOC and Properties, and click the Symbology tab.
2. In the Show panel, click Quantities and Graduated Colors, under Fields, select AS_PPM for
the Value field, change the Normalization to AREA_SQKM, click Classify, change Method
to Quantites, and click OK.
3. In the Symbology tab, click the Label column heading to the right of the Symbol and Range
Headings, click Format Labels, You can change the format of labelling from here.