POST
|
I have a process to create animations using time enabled mosaic datasets with a date field in ArcMap. Each dataset references 365 rasters (one raster for each day). The datasets and rasters are maintained in the same File Geodatabase. All layer frames are turned "off". For the animation, two of the datasets are used in conjunction with one another to create vectors which overlie a third dataset of local measurements. *Layers are arranged as follows: Data frame 1: Roads Data frame 2: Mosaic Datasets Mosaic Dataset 1: Aspect - layer visibility turned "off" Mosaic Dataset 2: Slope - symbology changed to "vector field" with direction defined from "Aspect (image)" Mosaic Dataset 3: Measurement - symbology is a "stretched", "Type: Maximum-minimum" (max value rounded up to nearest 5, min rounded down to nearest 5), and "Labeling" has 10 divisions Data frame 3: Basemap I want to automate this process using python (the requesting and processing of raw data to this point is already automated). I have not found a method, yet, of adding Mosaic Datasets to a specific data frame (there are three on the map document) on an existing map document that does not require creating a "Layer". "Layer" creation removes my time field and prevents me from creating the animations. I need help in writing a script that will: 1. Load the mosaic datasets to Data frame 2 2. Edit the symbology to reflect above descriptions 3. Set legend to Mosaic Dataset 3 image only 4. Enable the time features and set parameters 5. Export animation with specific settings (frame refresh and etc...) I've seen the animation scripts and should be able to pull much from them, however the importing and editing of Mosaic Datasets I have had no such luck. All help is appreciated.
... View more
02-24-2017
08:28 AM
|
0
|
0
|
1115
|
POST
|
I did this form your suggestion: # Loop to process each shapefile in sourceWorkspace
for shape in shapes:
dateName = shape[-8:]
dateFile = int(shape[-8:])
# Set conditional statement to transfer only the desired date range.
if (dateFile >= dateStart) and (dateFile <= dateEnd):
outFeature = shape
arcpy.FeatureClassToGeodatabase_conversion(outFeature, targetWorkspace)
print 'Transferring : ' + dateName
else:
pass This fixed the issue. Thanks! As a secondary question: Do you have any suggestions for coding a running counter of the total number of files to be transferred and a how many have been transferred?
... View more
12-02-2016
05:25 AM
|
0
|
1
|
1646
|
POST
|
Is this better? Sorry first time posting script to GeoNet. # Import system modules
import arcpy, sys, string, os, os.path
from arcpy import env
# Set environment / variables
sourceWorkspace = "C:/Users/jim/Documents/ArcGIS/bob_Shapefiles/"
env.workspace = "C:/Users/jim/Documents/ArcGIS/bob_Shapefiles"
targetWorkspace = "C:/Users/jim/Documents/ArcGIS/Park/bob_Original.gdb"
arcpy.env.overwriteOutput = True
dateBegin = 20000101
dateEnd = 20000103
shapes = arcpy.ListFeatureClasses()
# Loop to process each shapefile in sourceWorkspace
for shape in shapes:
dateName = shape[-8:]
# Set conditional statement to transfer only the desired date range.
if (dateName >= dateBegin) and (dateName <= dateEnd):
outFeature = shape
arcpy.FeatureClassToGeodatabase_conversion(outFeature, targetWorkspace)
print 'Transferring : ' + dateName
else:
print 'No files in date range to transfer.'
quit() The files in the sourceWorkspace and the set environment do exist and follow the format I mention at the top. I can process them individually through ArcMap and Catalog but due to the size of the folder (over 5,000 shape files) doing so requires a large amount of extra time just to open the folder. No "error" messages are popping up, but the files are not transferring and the only output is "No files in date range to transfer."
... View more
12-02-2016
04:56 AM
|
1
|
0
|
1646
|
POST
|
I am trying to import network shapefiles to a local file GDB and I am having some trouble writing the script. The shapefiles have a consistent naming syntax as follows: bob_[date as 8-digit YYYYMMDD] I would also like to add a counter so that as each file transfers, the user will know how many have been transferred and how many are left to go. I had some ideas on it, but am interested to see how you all might solve that small addition. Here is the sample script: # Import system modules import arcpy, sys, string, os, os.path from arcpy import env # Set environment / variables sourceWorkspace = "C:/Users/jim/Documents/ArcGIS/bob_Shapefiles/" env.workspace = "C:/Users/jim/Documents/ArcGIS/bob_Shapefiles" targetWorkspace = "C:/Users/jim/Documents/ArcGIS/Park/bob_Original.gdb" arcpy.env.overwriteOutput = True dateBegin = 20000101 dateEnd = 20000103 shapes = arcpy.ListFeatureClasses() # Loop to process each shapefile in sourceWorkspace for shape in shapes: dateName = shape[-8:] # Set conditional statement to transfer only the desired date range. if (dateName >= dateBegin) and (dateName <= dateEnd): outFeature = shape arcpy.FeatureClassToGeodatabase_conversion(outFeature, targetWorkspace) print 'Transferring : ' + dateName else: print 'No files in date range to transfer.' quit()
... View more
12-01-2016
11:52 AM
|
0
|
6
|
3685
|
POST
|
The following is a description of the issue(s) I am encountering with ArcMAP. I hope these are descriptive enough for them to simulate similar conditions. Steps: Initial files types are shape-files of approximately 17,000 polygons with Water Depth and Stage as fields. Each polygon is 400 x 400 m. I convert each shape-file to a raster using Feature to Raster Conversion and these rasters (one for Water Depth and one for Stage for each date) are sent to a file geodatabase. From the Stage rasters I create slope and aspect rasters which I am using to create vector fields (Slope = Magnitude and Aspect = Direction) through the symbology tab for the Slope rasters. (I am interested to find if there is an alternative to this or a way of automating this process using Python scripts) I then apply a consistent "stretched" symbology with set Min/Max and statistic values to each Stage raster for a calendar year. These rasters (in ascending date order) are then animated using the Animation toolbar and "Group Animation". The same animation steps are taken to create a Water Depth Animation as well. So far the preferred window for animation is the "Layout View" because it allows me to create a default background with a visible legend and additional site information. The issue with this window for animation is the large amount of "dead" or "white" space surrounding the actual map document. Is there a way of eliminating this white space? When I am animating the Stage rasters, is it possible to display both a vector field and stage raster for each frame of the animation? Meaning: each daily stage raster would have an accompanying vector field describing the slope and aspect of the stage values. I would like to animate these pairs simultaneously. Is this possible within ArcMap or any other Arc product? If so, how? If not, what would be a method or program for doing this type of animation? A separate option would be to animate two data frames. In this I would have the two frames side-by-side, one with stage rasters and the other with water depth. is there a method in any Arc product to animate these two rasters so the animations would be synchronized, specifically as one animation? Is it possible to animate multiple data frames at the same time? I have a few scripts written for processing the initial files and creating the rasters, but need help in processing the animations.
... View more
11-29-2016
08:10 AM
|
0
|
0
|
773
|
POST
|
The following is a description of the issue(s) I am encountering with ArcMAP. I hope these are descriptive enough for them to simulate similar conditions.
Steps:
Initial files types are shape-files of approximately 17,000 polygons with Water Depth and Stage as fields.
Each polygon is 400 x 400 m.
I convert each shape-file to a raster using Feature to Raster Conversion and these rasters (one for Water Depth and one for Stage for each date) are sent to a file geodatabase.
From the Stage rasters I create slope and aspect rasters which I am using to create vector fields (Slope = Magnitude and Aspect = Direction) through the symbology tab for the Slope rasters. (I am interested to find if there is an alternative to this or a way of automating this process using Python scripts)
I then apply a consistent "stretched" symbology with set Min/Max and statistic values to each Stage raster for a calendar year.
These rasters (in ascending date order) are then animated using the Animation toolbar and "Group Animation". The same animation steps are taken to create a Water Depth Animation as well.
So far the preferred window for animation is the "Layout View" because it allows me to create a default background with a visible legend and additional site information. The issue with this window for animation is the large amount of "dead" or "white" space surrounding the actual map document. Is there a way of eliminating this white space?
When I am animating the Stage rasters, is it possible to display both a vector field and stage raster for each frame of the animation? Meaning: each daily stage raster would have an accompanying vector field describing the slope and aspect of the stage values. I would like to animate these pairs simultaneously. Is this possible within ArcMap or any other Arc product? If so, how? If not, what would be a method or program for doing this type of animation?
A separate option would be to animate two data frames. In this I would have the two frames side-by-side, one with stage rasters and the other with water depth. is there a method in any Arc product to animate these two rasters so the animations would be synchronized, specifically as one animation? Is it possible to animate multiple data frames at the same time?
I have a few scripts written for processing the initial files and creating the rasters, but need help in processing the animations.
... View more
11-29-2016
08:03 AM
|
0
|
0
|
1062
|
Title | Kudos | Posted |
---|---|---|
1 | 12-02-2016 04:56 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:25 AM
|