ArcGIS 10.1

Update the data source in an ArcMap project using python, arcpy.mapping

Need to update a path in your ArcMap project to reflect the new location?  Here's how...

There are several methods for updating data sources using arcpy.mapping, check out this help topic from ESRI.  The example listed below is just one of several methods.

 Attach the following python code to a script in the toolbox of the mxd you wish to update.  This will allow you to update the directory the data layer is referencing, but will NOT allow you to change the data layer source name itself.  To change the data layer source name use the 'replaceDataSource' method instead.


import arcpy
mapdoc = arcpy.mapping.MapDocument("CURRENT")
mapdoc.findAndReplaceWorkspacePaths("<the directory you are changing from>" , "<the directory you are changing to>")
del mapdoc


TIPS / Notes:

--You could get fancy and set the 'directory you are changing from' and the 'directory you are changing to' to input arguments.  Then, the script could be used for resetting any project.

--If you don't know the directories your data are referencing you can insert print lyr.dataSource.  This will  return a list of data sources used in the mxd.

--If you know you have broken links in your mxd, here's how to get a list printed to the python shell window.

import arcpy
mapdoc = arcpy.mapping.MapDocument("CURRENT")
brokenlist = arcpy.mapping.ListBrokenDataSources(mapdoc)

      for lyr in brokenlist:      


del mapdoc



Should I use ArcGIS from Citrix or Install it on my computer?

 You can use either or both. The best solution depends on three main factors.

·         What am I doing?

·         Where is my data?

·         Where am I?


What am I doing?

Appropriate for Citrix

·         making maps with existing data

·         querying and selecting  spatial data

·         creating GIS points from XY coordinates (GPS files)

·         Sub -setting data by selection and export

·         Creating or editing GIS data feature by feature

·         Buffering small data layers (few features, simple features)

·         Joins on attribute tables

Not Appropriate for Citrix

·         Geoprocessing (Intersect, Union, Identity, …)

·         Sub -setting data by Clipping

·         Spatial joins

·         Spatial Analyst

·         Buffering large or complex data layers


If you are doing one of the things on the Appropriate for Citrix list, Citrix may be your best option.  This will also depend on the location of your data.

When you are accessing ArcGIS through Citrix, you may be sharing the resources on a server with other people.   ArcMap shares resources very well with some operations, such as moving around on the map, making selections, and editing features.   Operations such as geoprocessing or buffering a large number of features are very CPU intensive.  When you start one of these operations, ArcMap assumes you are the most important person and this is the most important thing you are doing.  This can render ArcMap unusable to anyone else on that Citrix server.  Even if you are working with ArcMap loaded on your computer, don’t start one of these operations if you need to finish a Power Point for a meeting that starts in 30 minutes.  ArcMap can gobble up all the CPU resources on your computer.   Consider both the number of features and the complexity of the features. Points are simple.  A rectangle is simple.  A line or polygon with lots twists and turns is complex.  It may take less time to buffer 1000 points than one complex polygon.


Where is my data?

IDFG Spatial Data Server (LayerFetcher,  K:/ifwis/sdelayers) – This data source is available from both Citrix and desktop installations.  In the Regions, these layers will usually draw faster over Citrix, provided there are no other data source issues in your map document.

IDFG Network Drives (Q, K, T) – If you access ArcMap through Citrix, or Citrix and your desktop,  this is where you should store your data.  In the Regions, layers stored here will usually draw somewhat faster over Citrix, provided there are no other data source issues in your map document.  The T drive is for temporary storage and is purged every periodically.

 Citrix works by sending your mouse and keyboard actions to a server.  The actions are processed by ArcMap on the Server and an image is returned to your computer.  When you use data from IDFG Network Drives or from the LayerFetcher, the data and the processing  are in close proximity and the communication is fast.

Regional Network Drives (U, O, S)  - It possible to access a regional network drive through Citrix, but it is not advisable, because it will be very slow.  It will actually be pulling data back and forth over the network rather than just mouse clicks and images.  You should only store GIS data on a regional drive if you are only accessing it from a local desktop installation.  If you are at Boise HQ it is ok to use the O, S drives.

Your Local C: Drive – This will give you the fastest access to data if you are using a local desktop installation of ArcMap, however,  you will not be able to access it through Citrix, it is accessible only to you, and it is not automatically backed up.


Where am I?

In the office -  Here you have options.  You can use either or both depending the factors listed above.  If you have ever tried to use ArcMap, Excel, and Word at the same time, you have seen that everything slows down.  Using Citrix can be like having a second computer on your desk.

At another IDFG facility – As long as you are connected to the IDFG Network you will have access to the ArcGIS license server and the LayerFetcher data, so it possible to use the local ArcMap Installation on your laptop.  It is however, probably safer to put your map document and data on the Q drive and access through Citrix. If your project works on Citrix in your office it work anywhere you have a decent internet connection.

At home or anywhere not connected to the IDFG Network – Here the answer is easier. Citrix.  Your only other option is to purchase your own ArcGIS license, and you will not have access to any network data source.  You can access Citrix from anywhere with internet connectivity by going to


Other Considerations

Will you be sharing your map documents or data with others?  If the people you are sharing with are in your region and they are using a local install, then it’s ok to store data and map documents on your U drive.  Otherwise store on the Q drive and make sure your document works on Citrix.


How fast is your computer?  How full is your hard drive?  If your computer is old and slow you are better off using Citrix.  If your hard drive is near full you may not be able to install ArcMap.  You’ll need about 3 Gigs of space on your C drive to install.  Remember if you are doing any of the things on the “Not Appropriate for Citrix” list, you will need to install locally.


Problems with ArcMap on Citrix?

If you are unable to connect to ArcMap on Citrix or you get an error message when you try to open it, it may be a problem with the Network or Citrix itself.   Contact the Help Desk and let them know there’s a problem.  If it is running very slowly, it could be a network problem, but it is more likely to be a problem with a data source, data layer, or you map document.  The best way to diagnose is to start with a new blank map document and add your layers one by one.  If you are still having a problem, give me a call or send an email with the name and location of your map document and I will try to help to get to the bottom of the problem.

ArcGIS 10.1 TIP: Setting Projections as 'Favorites' in ArcGIS 10.1 - *NEW* in 10.1

New in 10.1!

Tired of scrolling through all the possible projections when you only use about 3 or 4 of them?  In ArcGIS 10.1 you can now save commonly used projections as a ‘favorite’.

Next time you are specifing a projection for a dataset you can mark the projection as a 'favorite' by simply clicking the 'star icon' in the top right corner of the dialog box.

Next time you need to specify that projection, simply look for it within the 'favorites' section.