This tutorial will show you how to fix broken links between map layers and GIS data files. You will also learn how to convert data files from one format to another while maintaining map-layer-to-file integrity. This tutorial was created using ArcGIS Pro version 3.3.
Before staring this tutorial, you will need to download and install a dataset following these instructions:
Create a folder called managing_data somewhere under your personal directory (e.g. C:\Users\jdoe\Documents\Tutorials\ managing_data\).
Download the data for this exercise then extract the contents of managing_data.zip into your newly created managing_data folder. (Note that the zip file already has a folder called managing_data/; You can overwrite the existing managing_data folder if you wish).
In a Windows file management application, navigate to your project folder and double-click on the managing_data.aprx file.
By default, windows 10 hides the extensions for many of the file types. To view all file extensions, click on the View tab of the file management window and select File name extensions.
In the Contents pane, you will see five layers, three of which have an exclamation mark. Exclamation marks indicate that the GIS data source cannot be found. It's important to note that the map document (i.e. the file ending in *.aprx) does not store the features and their attribute tables. Instead, the .aprx file instructs ArcGIS Pro on where to find those spatial data files on your drive or on the internet.
When you encounter exclamation marks, you should first identify which files/resources the layers are pointing to. In the instructions that follow, you will learn how to identify the data sources and how to fix the broken links.
In the contents tab, change the view to List by Data Source (the cylinder icon in the Contents pane).
This Contents pane will display the location where the software expects to find the GIS data files. In this example, it's expecting to find the files under C:\Users\yourname\Documents\Tutorials\managing_data\ folder (the folder location will differ from yours depending on where you created the managing_data folder on your machine). However, the Contents pane does not give us the name of the the GIS data file. That information is stored in the layer's properties.
You can now revert the Contents pane back to its original view by clicking the List by Drawing Order button.
Next, right-click on the Roads layer and select Properties.
In the left pane of the Properties window, select the Source tab.
The layer is pointing to a shapefile named Roads.shp that it expects to find under the managing_data folder. We know that this is a shapefile because the Data Type references a Shapefile Feature Class. Other data types you might encounter in this course are (file) geodatabases and geopackages.
Close the Layer Properties window for now and navigate to your Catalog pane.
Make sure that you have the Project tab selected in the Catalog pane and expand the Folders link.
Under Folders, you should see the managing_data project folder (or the name of the folder you created for this exercise). Expand that folder.
The managing_data folder has several fiiles/folders such as a Default.tbx toolbox, a Default.gdb database to name a few. These elements are usually automatically added to a project folder when a new ArcGIS Pro map project is created or open and will thus be elements you will often come across when working in ArcGIS Pro.
There is another folder called vector_data/ that is not one of the default elements created in a new ArcGIS Pro map project. This folder was added to the project at some point by this project's original author. If you expand the folder, you will find three data files: Parks.shp, Roads.shp and Water.shp. These are the files that the three layers in the Contents pane are looking for.
So our next step is to redirect the layers in the Contents pane to the correct GIS file locations under ./vector_data/.
In the Contents window, double-click on the Roads layer to bring up its Properties window. (You can also right-click on that layer and select Properties to access that same window).
Click on the Source tab.
Click the Set Data Source button to bring up the Change data source window.
Navigate to Folders >> managing_data >> vector_data and select Roads.shp.
Click OK a few times to close the Roads layer's Properties window and see the resulting output.
Note that ArcGIS Pro recognizes that the missing layer is a polyline feature class and will therefore only display polyline GIS files; Hence the reason you will not see the other two shapefiles that are not polyline geometries in the vector_data/ folder.
When complete, the exclamation mark next to the roads layer should disappear and the road lines should show up in the Map view.
On your own, fix the broken links to Parks and Water layers.
Once the broken links are fixed, you should see all layers displayed in your map. Note that even though the links were broken, the map document still maintained the symbology scheme originally set for the layers. This serves as a reminder that the .aprx files does not save the actual spatial data but it does save the symbology schemes as well as other parameters defined in the layer's Properties such as a definition query or a table join.
While fixing broken links may not seem like a big deal, figuring out which GIS files to point to may not be straight forward. For example, GIS file names may have been changed after the .aprx file was saved, or multiple versions of the same GIS file may have been generated since the map file was first created. Project folders can be messy and it's therefore best to make sure that any changes made to GIS files in your project folder are reflected in the latest version of your .aprx file. In the steps that follow, you will learn how to properly rename and move GIS files while maintaining the integrity of your .aprx project.
You should always use Catalog for any data file management workflow and avoid manipulating those same files in a traditional Windows data management environment. In the next step, you will convert the hillshade.img file (an ERDAS Imagine raster file format) to a TIFF raster file format. In the process, you will make sure that the current layer in the Contents pane points to the new raster file before deleting the hillshade.img file.
Expand and pin the Catalog pane if it's not already pinned.
Navigate to Folders >> managing_data.
Right-click hillshade.img and select Export to Different Format.
This will launch the Copy Raster geoprocessing window.
Name the output hillshade.tif in the Output Raster Dataset field. Make sure that you are creating the file under the managing_data/ project folder and not the Default.gdb geodatabase that the tool may want to default to. You might want to click on the folder icon to make sure that you are saving the file in the correct folder.
Set the format to TIFF format.
Click Run (a the bottom of the Geoprocessing window) to execute the command.
Note that if you attempt to save a raster layer as a TIF file in a geodatabase such as Default.gdb, the geoprocess will very likely return an error along the lines of "Wrong type of workspace for output format [TIFF]". This is because geodatabases have their own unique format for storing rasters.
When complete, you should see a green checkbox at the bottom of the geoprocessing window indicating that the raster file was successfully created.
You'll also note that the new hillshade was automatically added to the Contents pane.
If the newly created raster does not look like a hillshade, you may need to change its symbology. Your layer may look like the one in the accompanying figure.
While a separate tutorial will delve into symbolizing rasters, the next step will show you how to fix the TIF file's symbology for this exercise.
Select hillshade.tif in the Contents pane. This will activate the Raster Layer ribbon.
Click on the Raster Layer tab on the ribbon.
Click on the Symbology button and select Stretch.
Your new raster layer should now look like a hillshade.
Take a screenshot that shows your Content pane (displaying the Drawing order), and your map pane - to submit on Brightspace.
Now that the new raster has been created, we can delete the original raster file from the project folder.
Navigate back to the Catalog pane. You might need to select the Catalog tab from the right-hand pane.
In the managing_data folder, right-click on hillshade.img and select Delete.
If you are presented with a warning window, click Yes to proceed with the deletion. This will remove the raster file from the managing_data folder as well as from the Map layer.
If the hillshade.img raster layer is not removed from the Contents pane, right-click it and select Remove.
In this next exercise, you will copy the Parks and Water shapefiles to a geodatabase. A geodatabase is a complex file format structure. It consists of a folder whose name ends with .gdb. For example, the existing default geodatabase in your project folder is a folder named Default.gdb in your Windows file management window. A Geodatabase offers many advantages over a shapefile. For example, it can store many different feature types. It also allows for the creation and management of topologies.
Note that as of ArcGIS Pro 3.0, you cannot rename the Default.gdb folder. If you want to save data files to a geodatabase with a different name, you will need to create a new geodatabase by right-clicking on the project folder and selecting New >> File Geodatabase.
Since the new geodatabase layers will be given the same name as the input (shapefile) layers, we should rename the original layers in the Contents pane. This will make it easier to distinguish the newly created layers from the original ones. Note that renaming the layer does not change the name of the associated GIS file in the project folder. The layer name will only persist in the current map document.
Note that we did not bother renaming the original raster layer before making a copy of it because the output file had an extension (.img) that was part of the default layer name.
In the Contents pane, left-click Parks twice while pausing a couple of seconds between clicks. This will place the layer name in edit mode.
Rename the layer Parks (shapefile)
Next, navigate back to the Catalog pane and right-click on Parks.shp and select Export >> Feature Class to Feature Class. This will bring up a Geoprocessing pane.
Click on the little folder icon next to the Output Feature Class field.
Select the Default.gdb geodatabase for the Output Location.
Name the Output Feature Class Parks.
Click Save to return to the Geoprocessing window.
Click Run at the bottom of the Geoprocessing pane.
This will create, then add, the new Parks feature class to the Map document. The new layer's symbology will not necessarily be the same as that of the original layer. In the next step, you will learn how to copy the symbology from one layer to another. This should be done before deleting the original Parks (shapefile) layer.
Select the newly created Parks layer in the Contents pane. This will bring up the Feature Layer ribbon.
Select the Feature Layer tab.
Click on Import.
This will bring up the Import Symbology geoprocessing window.
In the Geoprocessing pane, set the Parks layer as the Input Layer (this is the layer we are copying the symbology to).
Set Parks (shapefile) as the Symbology Layer input. Its symbology will be copied to the Parks layer.
Click OK to execute the geoprocess.
Note that had we not renamed the original Parks layer to Parks (shapefile), the Geoprocessing tool might have complained that we were copying a symbology to itself.
Now that the symbology has been copied over to the new layer, go ahead and delete the original Parks.shp shapefile under the vector_data folder in the Catalog pane.
If the Parks (shapefile) is not removed from the Contents pane, right-click it in the Contents pane and select Remove.
On your own, create a copy of the Water.shp file in the managing_data geodatabase, copy its symbology over to the new layer, then delete it from your project folder. But make sure to rename the original Water layer to something like Water (shapefile) first!
When complete, your Contents pane should look like the adjoining figure. Note that you might need to refresh that folder's contents by selecting it, then clicking the F5 keyboard key (or right-click the folder, then select Refresh).
Next, you will learn how to export layers to yet another file format called a geopackage.
Take a screenshot of your geodatabase to submit on Brightspace.
A geopackage is a relatively new file format that shares many of the capabilities of a geodatabase with the advantage of being self-contained in a single file. This makes it more portable than its ArcGIS shapefile and geodatabase counterparts. A geopackage format can also be advantageous if the data are to be used in an application other than ArcGIS Pro such as R or QGIS. A geopackage is an open format making it easier for developers to adopt in non-esri packages (esri being the developer of ArcGIS Pro).
Much like ArcGIS' geodatabase, a geopackage can store multiple GIS files (both vectors and rasters). It can also operate as a standalone database (it's built off of a common flat file database call SQLite).
We will first create a geopackage given that one is not present in our project folder.
Open the geoprocessing pane by selecting Tools from the Analysis tab on the top menu bar. This will open the Geoprocessing pane.
Search for the Create SQLite Database geoprocessing tools.
Note: you can also use the search tool at the top of the ArcGIS Pro interface to search for Create SQLite Database.
In the Create SQLite Database geoprocessing wizard, click on the folder icon and create a database named data_gpkg under the managing_data folder. Note that the .gpkg extension will be automatically added to the file name.
Select GeoPackage 1.4 from the Spatial Type pull-down menu. Version 1.4 is the most recent version of the geopackage as of this writing. If you are using an older version of ArcGIS Pro, select the latest version available on that platform.
Click Run to execute the geoprocess.
The geopackage is a self contained spatial database in that it is stored as a single file with a .gpkg extension. If you switch to a Windows file management application (outside of ArcGIS), you'll note the .gpkg extension added to your newly created geodatabase.
Next, we'll import the Roads shapefile into the geopackage, then we'll delete it from the .\vector_data folder.
Navigate to your Catalog pane and right-click on the data_gpkg.gpkg database and select Import >> Feature Class(es). Note that if you do not see the newly created geopackage, refresh the folder.
In the Geoprocessing window, select the Roads shapefile as the Input Features layer.
If you wanted to import multiple layers, you would select them in the same geoprocessing operation.
Click on Run to execute the geoprocess.
Expand the data_gpkg geopackage.
You'll note that the geoprocess added a "main." prefix to the Roads layer. This cannot be modified in the geopackage.
If the the main.Roads layer was not automatically added to the Contents pane, go ahead and drag and drop it from the data_gpkg geopackage.
On your own, copy the original Roads symbology to the newly created geopackage layer then delete the original Roads shapefile.
You will then rename the newly create geopackage layer to Roads in the Contents pane (don't rename it in the Catalog window).
When completed, your project folder should look like the accompanying figure. (note that you might need to refresh the contents of your folder in the catalog window to not see the deleted shapefile).
Save your ArcGIS project file to ensure that the final version of this map document is pointing to the newly created GIS files. If you don't, and you later attempt to reopen the .aprx document without saving it first, you risk seeing exclamation marks in the Contents pane.
Take a screenshot of your Catalog pane displaying the managing_data geodatabase with the .gpkg database open (see image above)
NOTE 1:
In this exercise, your final project folder ended up with many different file formats. While this served the purpose of teaching you how to manage GIS files , having disparate file formats in a project folder is not good practice. You want to stick to a unique set of file formats when possible (for example .tif for all raster files and shapefiles for all vector files) unless there is an explicit need to have multiple file formats in your project folder.
Screenshot of Contents pane and map
Screenshot of your Catalog pane with the geodatabase from the "Copying a shapefile to a geodatabase" section
Screenshot of your Catalog pane displaying the managing_data geodatabase with the .gpkg database open (see image above)