POST
|
You could try use the third party 'Pillow' python module. This should allow you to rotate multiple images at once.
... View more
09-13-2017
02:07 AM
|
1
|
1
|
588
|
POST
|
I have an mxd which contains a layer (in shapefile format). I wish to update the path of the shapefile to the path of another shapefile by using a stand alone script. Is this possible? I have used arcpy.mapping.AddLayer to find my layer. I wonder if I can now use .replaceDataSource to update the source of the layer in the mxd?
... View more
09-04-2017
10:02 AM
|
0
|
2
|
497
|
POST
|
Many thanks for your tip regarding properly adding code to the forum. Please see below a subset of the data that I am working with. I want my code to take a group of features as shown in the highlighted selection below and assign the 'GuyIndex' and 'Value' attributes. Then I want to move on to the next group of features (e.g. 'NewID' = 5) and do the same task for this group of records. I hope this clarifies what my intended outcome is.
... View more
08-19-2017
01:11 PM
|
0
|
2
|
2646
|
POST
|
Thanks for the responses. I am using ArcGIS 10.3 and I am using a file geodatabase. Below I have included the script I am working on with some notes on the data structure and results I wish to obtain. I have just left out the file paths below. """ This script attributes the relevant value from one of three fields (Field1, Field2, Field3) to the 'Value' field. If the GuyIndex value is 0 then the 'Value' should be equal to Field1. If the GuyIndex value is 1 then the 'Value' should be equal to Field2. If the GuyIndex value is 2 then the 'Value' should be equal to Field3. Note: The above process should be performed on unique sets of values from the 'NewID field' I am not sure how to implement this. I was hoping I could Group By based on the 'NewID' field using the Update Cursor. However I cannot get this to work. """ """ Sort POINT_X by Ascending method. This will allow me to assign the index values based on ascending POINT_X values. """ Sorted = arcpy.Sort_management(Shapefile,"Sorted","POINT_X ASCENDING","UR") """ Add a new field "GuyIndex" to be populated in the update cursor """ arcpy.AddField_management(Sorted,"GuyIndex","SHORT","","","","","NULLABLE","NON_REQUIRED","") """ Specifying fields to be used in the update cursor. """ CursorFields = ['GuyIndex','Value','Field1','Field2','Field3'] """ Add the Index attribute to assign an ascending attribute to the records. Because the dataset was sorted already '0' will be assigned to the 1st record in the table (smallest Point_X value), 1 being assigned to the second record in the table and so on. Note: Ultimately I want to perform this on each group of 'NewID's. (not included below) """ i = 0 cur = arcpy.UpdateCursor(Sorted, CursorFields) for row in cur: row.GuyIndex = i i += 1 if row.getValue(CursorFields[0]) == 0: row.Value = row.getValue(CursorFields[2]) elif row.getValue(CursorFields[0]) == 1: row.Value = row.getValue(CursorFields[3]) elif row.getValue(CursorFields[0]) == 2: row.Value = row.getValue(CursorFields[4]) cur.updateRow(row) del row, cur print "Complete"
... View more
08-19-2017
09:39 AM
|
0
|
4
|
2646
|
POST
|
Is it possible to use a Group By function in the arcpy Update cursor? I was playing around with the update cursor today but could not get the Group By function to work within it. For each group of records in my dataset I need to perform a field calculation based on an existing field. I can set up this calculation with no problem in the cursor. Technically speaking, the calculation will only be accurate when the records are grouped.
... View more
08-18-2017
12:55 AM
|
0
|
8
|
4173
|
Title | Kudos | Posted |
---|---|---|
1 | 09-13-2017 02:07 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|