What is a Shapefile? Everything You Need To Know About the Geospatial Data Format

A decorative image of a file icon with question marks

Few data formats have become as ubiquitous in Geographic Information Systems (GIS) than the humble Shapefile. It’s used by just about everyone who performs work specific to a geographic location and needs to share that location data with others. You’ll come across people sharing Shapefiles in professions such as Civil Engineering, Ecological Consulting, Geologic Mapping, Mining and Mineral Extraction, Forestry, and many others. But what exactly is it?

At it’s simplest, a Shapefile is a file format for sharing geographic data. Note that it's all one word, not “shape file”. It's also often abbreviated to “shp” or ".shp" in emails and texts. These files can be used to draw shapes on maps and to encode attribute data associated with those shapes in shapefile viewer applications. One confusing thing about the term Shapefile is that it’s often used to refer to a collection of files zipped up into an archive, and not a single file type. This is because one of the files on its own isn’t sufficient to describe the data fully.

A macOS finder window displaying different shapefiles and their components.
Shapefiles are generally Zipped archives, but you can unzip them to see the folder structure and component files.

At a minimum, three files comprise a fully defined Shapefile:

  1. The .shp file, literally the shape file which describes the type of geometry for the collection as well as the coordinates for the features in the collection. Each .shp file can only describe one geometry type.
  2. The .shx file serves as a positional index for the .shp file, which means that it essentially tells a reader were in the .shp file to look for each individual feature that it describes. This makes it faster to look up individual features than if the Shapefile viewer had to search the entire .shp file each time.
  3. The .dbf file, also known as the dBASE file describes all of the non-geometric attribute data for the features described by the .shp file. For example, if you had a Shapefile containing polygons that describe all the property parcels in a county, the .dbf file might contain the parcel’s identifier in the county records, or the name of the current owner.

Since each .shp can only define one type of geometry (ex: point, line, polygon), complex datasets will have many of these files all bundled together. There are other complementary files that can be included such as a .prj to define the map projection or coordinate reference system for the shape data, but they’re less common.

Where did it come from and why?

The Shapefile format was designed by Esri in the early 1990s for the second version of their ArcView GIS software. The technical specification is public, but it’s still managed by Esri and is not actively maintained or developed by an open standards body like the Open Geospatial Consortium (OGC) or the International Organization for Standardization (ISO).

Esri's logo on a blue background

When first released, Shapefiles were a great efficiency booster compared to other data formats and made it easier to draw and edit spatial feature datasets in a map representation. This is because it uses non-topological data structures, which is to say that the shape of the geometry is defined in absolute vector coordinates, instead of relationships between nodes, and edges.

How do I use a Shapefile?

Do you just need to view a file that you got online, or do you need to edit it or create a new one to forward along? Are you going to be using it at your laptop or desktop in an office, or on a mobile device out in the field? These considerations make a big difference in what programs will work best for you. In either case, you’re going to need a Shapefile viewer.

Using Shapefiles in the field on a mobile device:

There are a few GIS mobile apps available that support viewing Shapefiles including Touch GIS, Esri Field Maps, and QField. While all of these support loading a Shapefile and displaying it on a map view, Touch GIS has the most flexibility for editing the shapes and attributes in the file as well as adding new ones.

To load a Shapefile into Touch GIS, follow the instructions on our user guide. It’s as simple as tapping a button and selecting the Shapefile from your folders.

After loading the Shapefile into Touch GIS you will see all of the shapes drawn onto the map, and you can view their attributes either by tapping on a shape or by selecting it from the Layers menu.

The New York City Digital City Map (DCM) is loaded into Touch GIS, displaying street centers, major arterials, and other highlights.
Here we've loaded a Shapefile for the New York City Digital City Map (DCM) into Touch GIS

One major advantage to using Touch GIS is the ability to see your current GPS location in relation to the features in the Shapefile. For example, if someone needs you to perform work in a specific location, they can send you a Shapefile marking the location(s) and you can confirm that you’re in the right place by pulling up the feature and enabling GPS in the app.

Pictured are some point locations in the Touch GIS mobile GIS application with the user's location highlighted by a blue puck, showing how it can help orient you to a specific location.
By enabling location updates and loading in some features, you can ensure you're in the right spot to perform your fieldwork.

After editing the features in the Shapefile or drawing new ones, you can then export the data back to a Shapefile and share it with whoever needs to see the work that was completed. If part of your work includes taking photos of the job site, you can even export the Shapefile bundled with images.

Another major advantage that Touch GIS has over Field Maps and QField is the ability to define new

Using Shapefiles on a laptop or desktop in an office:

The primary contenders for desktop GIS are Esri’s ArcGIS platform, QGIS, and Google Earth. Both are solid solutions depending on what exactly you need to do and whether or not you have a paid subscription available for ArcGIS. QGIS is available for free, so it’s often one of the first places people go if they’re just starting with GIS applications.

In the case of QGIS, viewing a Shapefile is as simple as opening up a new project, then dragging and dropping the Shapefile from the folder to the QGIS application window. See their documentation for more step-by-step instructions.

I've got a Shapefile but I need it in a different format. How do I convert it?

Do you need to convert SHP to KML? Or SHP to CSV? All of the solutions mentioned in this post have the ability to export Shapefiles in different formats, and you can check their documentation for steps on how to do so. For Touch GIS, the process is as simple as loading up the project with the Shapefile and then tapping the Share button to select the new format that you need. We support KML/KMZ, CSV, GeoJSON and more.

There are also some websites that can convert Shapefiles directly for you, and you can search for in your favorite Search Engine.

That’s about all there is you need to know about Shapefiles! If you have additional questions that we didn’t cover here, or have questions about a different topic, please email blog@touchgis.app with your question and we’ll be happy to help.