POST
|
Jeff, thank you for your reply. I am afraid that this has not worked for me. Please let me know if there will there be an anouncement when these tools become stable for general use. Until that time I will work through R's spatial tools (http://cran.r-project.org/web/packages/sp/index.html) to meet my scripted cartography needs. Best Wishes, -Tony
... View more
03-05-2012
10:38 AM
|
0
|
0
|
240
|
POST
|
I wish to work through a long list of tracked animal behavior bouts, updating my map layer definitions to the depict behaviors from this bout, zooming to the behaviors within this bout, and exporting the resultant map as a graphic. Here is a script outline to do this. The problem is that the map extent does not get updated after the first bout is handled. Have I missed a trick to ensure that the map extent is properly updated and the result reflected in the output map? import pyodbc cnxn = pyodbc.connect(DRIVER, DBQ= db, autocommit=True) cursor = cnxn.cursor() SQL = "SELECT * from trackedAnimalBehaviorBout_tbl" cursor.execute(SQL) import arcpy for row in cursor.fetchall(): Bout = row.Bout ## grab behavior bout from trackedAnimalBehaviorBout_tbl mxd=arcpy.mapping.MapDocument(MYMXD) ## Open an mxd df=arcpy.mapping.ListDataFrames(mxd)[0] ## grab the first dataframe for lyr in arcpy.mapping.ListLayers(mxd): ## Loop through list of layers in the dataframe if lyr.name == "BehaviorX": ## Handle layer for 'BehaviorX' dfQ = "[BehaviorX] = 1 and [Bout] = '" + Bout + "'" lyr.definitionQuery = dfQ ## Update layer def query BehaveBoutExtent = lyr.getExtent() ## grab hold of Exent of this layer try: ## Try to zoom the dataframe to the extent of Behavior X for row.Bout print ("updating df extent from ") print df.extent print "to" print BehaveBoutExtent df.extent = BehaveBoutExtent ## Zoom to the BehaveBoutExtent print("Updated Extent to") print df.extent try: ## Export to a graphic file for later reveiw mxd.save() png = (r"\\" + r"MYFILELOCATION" + os.sep + str(Bout) + ".png") arcpy.mapping.ExportToPNG(mxd,png, resolution=80)
... View more
03-02-2012
01:15 PM
|
0
|
2
|
3035
|
POST
|
With ArcMap 10 I have enjoyed automating individual maps of tracked animals using Python (facilities available under arcpy.mapping). In these plots I wish to also display a graph depicting the chronology of the animal's behavior (example plot attached). However, I have found no Python handle to update the graph as I update the animal information (Note the discordance between the timeframe of the tracking and chronology data in the attached map). Have I missed a hidden gem that would allow me to do this?
... View more
03-01-2012
06:00 AM
|
0
|
0
|
387
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|