What is a shapefile, anyway? A geodatabase? A raster? A hosted web layer? The GIS world can seem a bit overwhelming with so many different data types, but it doesn’t have to be. In this blog article I’ll walk you through using a few of the most common data types that you’ll encounter in GIS, so when someone throws data your way, you’ll know what to do with it.
Shapefiles are an Esri-developed file format for storing geographic (shape) and attribute (table) information.
1. Go to HongKong_Transportation and click the blue Download button.
2. Locate and unzip the downloaded .zip file.
3. If necessary, open the HongKong_Transportation folder.
Inside there are 8 files, all with the same name, but different file extensions.
A shapefile is actually a collection of files. The three required pieces are the .shp, .shx, and .dbf files. If one of these is missing, the data won’t work. But shapefiles also often come with extra parts, such as a .prj—or projection file—which defines the coordinate system for the data. If you delete that file, the data will draw, but not in the right place.
To open a shapefile, you’ll need a program like ArcGIS Pro or ArcMap.
4. Open ArcGIS Pro. If you don’t have it, you can sign up for an ArcGIS free trial.
5. On the ArcGIS Pro startup page, under New, click Map. Name your project Data Types and click OK.
6. On the ribbon at the top, click the Map tab and click Add Data.
7. Browse to the shapefile. Here it only appears as one file, instead of 8.
8. Choose shp and click OK.
The data now appears on your map as a set of points.
9. In the Contents pane, right-click the layer and choose Attribute Table.
A table appears showing the attributes for the points. The column fclass looks like the most useful one; it contains the transportation feature types, including tram stops, bus stops, and railway stations. The name fclass may not seem like the most intuitive one, but shapefiles cannot have field names longer than 10 characters, so you’ll often run into cryptic headings like this.
10. Close the attribute table.
It is easy to save a shapefile and email it to a colleague, so you will come across many shapefiles if you’re searching for data on the internet. But this data type is older, so it has a number of limitations. For example, shapefiles cannot support time, null values, or the full range of Unicode characters.
Esri has since created a new format for storing data—the geodatabase. If you’re creating or saving data, I recommend using this instead of shapefiles. Data stored in a geodatabase will take up less space and perform faster than shapefiles.
1. Go to HongKong GDB and click Download.
2. Locate and unzip gdb.zip.
Inside is a file geodatabase: HongKong.gdb. Inside the geodatabase are a lot of cryptically named files. Leave them alone.
3. Return to your map in ArcGIS Pro.
You can add this data the same way you added the shapefile (with the Add Data button), but I’m going to show you another way.
4. In the Catalog pane, on the Project tab, right-click Databases and choose Add Database.
5. Browse to and select HongKong.gdb. Click OK.
6.In the Catalog pane, expand the Databases folder.
There are two geodatabases listed. Data Types.gdb was created automatically when you created the Data Types project. It is empty now, but any new data that you create in this project will land here by default.
7. Expand HongKong.gdb. This is the geodatabase that you just downloaded.
While a shapefile can only hold one layer of geographic information, a geodatabase is a container that can hold many layers. HongKong.gdb has two: a polygon layer and a line layer. The layers inside a geodatabase are called feature classes.
8. Select HongKong_ProjectedPopulation and drag it onto the map.
9. Right-click HongKong_Roads and choose Add To Current Map.
10. Find the HongKong_ProjectedPopulation layer in the Contents Right-click and choose Symbology.
11. The Symbology pane appears. Under Primary symbology, choose Unique Values.
12. Change Field 1 to Population Trend.
Now the map is symbolized to show where overall population projections between 2014 and 2024 have been growing or shrinking in Hong Kong.
It looks as though some of the densest concentrations of bus and train stations are in areas experiencing a decline in population. Later, you’ll add more data to explore why.
One of the advantages of the geodatabase is storing all your related data in one place. It would be nice if your transportation point layer could be stored with your other Hong Kong data.
1. In the Contents pane, right-click HongKong_Transportation, point to Data, and choose Export Features.
The Geoprocessing pane opens to the Copy Features tool. This will convert the shapefile into a feature class within your geodatabase.
2. Next to Output Feature Class, click the Browse button.
3. Browse to HongKong.gdb and name the new feature class HongKong_Transportation.
4. Click Save and click Run.
In the Contents pane, you now have two layers called HongKong_Transportation. One is the original shapefile, and the other one is the new feature class copy.
5. Right-click the bottom HongKong_Transportation layer and choose Remove.
6. In the Catalog pane, expand Databases and HongKong.gdb.
The point layer is now stored inside the geodatabase alongside the line and polygon layers.
Web layers and services
The layers you’ve used so far are stored on your computer. You can also add online layers to your map without downloading them. These are sometimes called services or hosted web layers, but there are many different kinds, so you will see different names associated with them.
1. In the Catalog pane, click Portal and All Portal.
2. Search for and select World Population Density Estimate 2016.
3. Drag it onto the map. It is a large layer, so it may take a few minutes to draw.
If you want to learn more about this layer, you can visit its item details page.
4. Turn off the HongKong_ProjectedPopulation layer so you can see the new one.
5. In the Contents pane, double-click World Population Density Estimate 2016 to open its Layer Properties dialog box.
6. Click the Source tab.
Here you can read that the Data Type is Raster. The other layers that you added were vector data, which is made up of points, lines, and polygons. Raster data is instead stored in a grid. A digital photo is a kind of raster, made of a grid of differently colored pixels.
7. Close Layer Properties and zoom in on the map until you can see the cells.
They are color-coded to represent the level of population density.
8. On the ribbon, click the Map Click Basemap and choose Imagery.
The basemap updates to show imagery of the earth that was collected by satellites and aircraft. Like the population density layer, this too is a raster. It is also a service layer which is hosted online.
9. Explore the map by zooming, panning, and turning layers on and off.
Before, it seemed as though a lot of bus stops and train stations were located in areas of declining population, but now you can see that those areas are also very densely populated. When viewed together, the Population Trend and Population Density layer suggests that surrounding urban areas are taking some of the burden of urbanization away from extremely dense Hong Kong Island, Kowloon, and Tsuen Wan. The imagery basemap can also help to explain why extremely dense areas exist right next to unpopulated green space: these areas are mountainous, making them difficult to build on.
One of the advantages of services is that someone else updates them for you, so you don’t have to worry about downloading the latest version to keep your map up to date. Some layers even update in real time.
1. Copy this link: https://www.arcgis.com/home/item.html?id=bdfd0ca3f731412d81391d00b721bd08
You can also visit the link to read about the layer.
2. On the ribbon, on the Map tab, click the bottom part of the Add Data button and choose Data From Path.
3. Paste the URL and click Add.
A new layer, called TDCCTV, is added to your map.
4. Click one of the new points on the map.
A pop-up appears. It contains a traffic photo from a CCTV camera. Depending on where you are in the world, you might be looking at an image that was taken in the middle of the night.
5. Close the pop-up and reopen it after a few minutes. The time stamp and the traffic have changed.
You now have six layers (including the basemap) that you can use to explore population density in Hong Kong. Some are vector; some are raster. Some are stored in a geodatabase on your computer, and some are services that you access from online. There are many more data types that you can use in ArcGIS, with different purposes and functionality.
Photo by Ryan McManimie on Unsplash