- Species Diversity
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.
mapdoc = arcpy.mapping.MapDocument("CURRENT")
mapdoc.findAndReplaceWorkspacePaths("<the directory you are changing from>" , "<the directory you are changing to>")
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.
mapdoc = arcpy.mapping.MapDocument("CURRENT")
brokenlist = arcpy.mapping.ListBrokenDataSources(mapdoc)
for lyr in brokenlist:
Posted by idfg-aschmidt at 09/19/2013 in
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 https://linkup.idfg.idaho.gov/Citrix.
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.
Posted by idfg-twilliams at 12/20/2012 in
Do you need to geoprocess the same file again and again. If only you could simply overwrite the old output file! Do you end up with files like 'Clip', 'Clip1', 'Clip2'...when you only really need one file named 'Clip'? Well, here's how to remedy all the duplicate files. You can set up the Geoprocessing options to overwrite previous outputs.
NOTE! If you are person that likes all these copies, I don't recomend setting up the overwrite option. You may accidentally lose data by overwriting a previous version. Use this with caution, but be prepared for cleaner GIS directories.
On the menu bar click, Geoprocessing and Geoprocessing options-
An options box will appear. Simply CHECK the 'Overwrite the outputs of the geoprocessing operations' and OK. You can now geoprocess files and overwrite previous versions under the same name! (Be sure to check out some of the other options - you might find something else really useful.)
Posted by idfg-aschmidt at 12/18/2012 in
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.
Posted by idfg-aschmidt at 12/13/2012 in
What is this?
We use the IFWIS Blog to keep our staff, cooperators and the public updated on what we are working on, what's new and share tips about using our software and website.
The content of the IFWIS Blog is often highly technical, but we try our best to keep our posts accessible and jargon-free. When this is not possible, we'll link to other resources online to provide background. Thanks for reading and please follow our blog for updates.
- IFWIS RSS Feed
- Daily Email Digest (All Public Content)
- Or follow just one of the many topic-specific tag feeds or pages below.