|
POST
|
You can run the following python script to update the Z value of each point: import arcpy
from arcpy import env
env.overwriteOutput = 1
shp = r"C:\data\pointsZ.shp"
with arcpy.da.SearchCursor(shp, ["Z"]) as cursor:
for row in cursor:
vertexElevation = row[0]
arcpy.MakeFeatureLayer_management(shp, "pts_lyr", "Elevation = " + str(vertexElevation))
arcpy.Adjust3DZ_management("pts_lyr", "NO_REVERSE", vertexElevation) You will just need to update the path for the 'shp' variable to your shapefile and change the field name ('Z') in the arcpy.da.SearchCursor to the elevation field name. The code iterates through each point and updates the Z value based on the elevation field.
... View more
11-19-2013
02:48 AM
|
0
|
0
|
3189
|
|
POST
|
Hi Joe, The following workflow should work: 1. Add a field of type Double called 'Elevation' to your lines feature class 2. Right-click on the field > Calculate Geometry > Max (or Min) Z of Geometry 3. Run the standard 'Buffer' tool on the lines feature class. Before executing the tool, be sure to go to the Environment Settings > Z values > 'Enable' Output has Z values 4. The output will contain the 'Elevation' field. Using the below python code, you can iterate through each polygon and adjust the Z value using this field's value: import arcpy
from arcpy import env
env.overwriteOutput = 1
env.workspace = r"C:\Default.gdb"
fc = "lines_buffer"
with arcpy.da.SearchCursor(fc, ["Elevation"]) as cursor:
for row in cursor:
vertexElevation = row[0]
arcpy.MakeFeatureLayer_management(fc, "lines_lyr", "Elevation = " + str(vertexElevation))
arcpy.Adjust3DZ_management("lines_lyr", "NO_REVERSE", vertexElevation)
... View more
11-18-2013
08:12 AM
|
0
|
0
|
2516
|
|
POST
|
For your polylineZ features, is each vertex the same elevation? For example, feature 1 has an elevation of 10 feet for each vertex, feature 2 has an eleavtion of 20, etc.
... View more
11-18-2013
05:05 AM
|
0
|
0
|
2516
|
|
POST
|
Hi Abdullah, Yes, the feature classes must be registered as versioned and have Global IDs: http://resources.arcgis.com/en/help/main/10.2/index.html#/Preparing_data_for_replication/003n000000z5000000/ Also, you will be able to replicate data from a 9.3 to a 10.x geodatabase: http://resources.arcgis.com/en/help/main/10.2/index.html#//003n000000z3000000
... View more
11-11-2013
01:38 AM
|
0
|
0
|
779
|
|
POST
|
Hi Damon, Does each feature class only have one polygon feature? You can use a search cursor to loop through the selected lines and get a sum of a field value. Ex: zonePolys = arcpy.ListFeatureClasses("Zone*") for fc in zonePolys: arcpy.AddField_management(fc,"SumOfValues","DOUBLE") arcpy.MakeFeatureLayer_management("OriginalLayer", "OriginalLayer_Lyr") arcpy.SelectLayerByLocation_management("OriginalLayer_Lyr","INTERSECT",fc) # Calculate the sum of the values in the selected features in OriginalLayer_Lyr with arcpy.da.SearchCursor("OriginalLayer_Lyr", ["Length"]) as cursor: sumValues = 0 for row in cursor: sumValues += row[0] # Take the sum value of the line features field and populate the polygon layer's new SumOfValues field with it arcpy.CalculateField_management(fc,"SumOfValues",sumValues) You will just need to change the field 'Length' to the field you want to sum.
... View more
10-31-2013
11:33 AM
|
0
|
0
|
3020
|
|
POST
|
Are you looking to get the sum of a field in your point feature class into your polygon feature class? For example, if you have a Cities feature class with the field Population, and a States feature class. You want each state to have a field that represents the sum population of all cities that are within that state? Take a look at the Tabulate Intersection tool. This will create an output table that you can join back to your polygon feature class, and then calculate over the summed values.
... View more
10-31-2013
10:38 AM
|
0
|
0
|
516
|
|
POST
|
When performing the compress, make sure no users are connected, no locks exist, and all replicas have been synchronized. Also, since you are editing the DEFAULT version, you may want to consider registering your feature class with the option of moving edits to base: http://resources.arcgis.com/en/help/main/10.2/index.html#//003n000000rp000000 Checking this option causes edits that have been saved to the DEFAULT version to be saved in the base (business) tables.
... View more
10-31-2013
05:44 AM
|
0
|
0
|
733
|
|
POST
|
Hi Rachel, Try changing the line: outExtractByMask.save(FOLDER+"/tempfp_"+str(FID)[4:]) to: outExtractByMask.save(FOLDER+"\\tempfp_"+str(FID)[4:])
... View more
10-31-2013
04:48 AM
|
0
|
0
|
812
|
|
POST
|
Hi Andrew, You can append the elevation values to a list, sort the list, and then use the first value in the list to obtain the minimum elevation. Ex:
list = []
fields = ["Elevation"]
with arcpy.da.SearchCursor (inputLyr, fields) as cursor:
for row in cursor:
list.append(row[0])
list.sort()
pointMinClause = "Elevation = " + str(list[0])
arcpy.SelectLayerByAttribute_management(inputLyr, "NEW_SELECTION", pointMinClause)
... View more
10-30-2013
08:24 AM
|
0
|
0
|
2291
|
|
POST
|
You will just need to make a couple line changes: with arcpy.da.UpdateCursor (fc, fields) as cursor:
for row in cursor:
row[2] = row[0] + row[1]
cursor.updateRow(row)
del row
del cursor Since 'Field3' is specified 3rd in your 'fields' variable, this should be referenced by 'row[2]'. Also, be sure to indent the lines after 'for row in cursor'.
... View more
10-30-2013
07:38 AM
|
0
|
0
|
972
|
|
POST
|
Try converting your DEM from an ESRI GRID to another format, such as a .TIF, using the Copy Raster tool. Also, for rasters, feature classes, shapefiles, etc you should not: 1. Have any special characters in the name 2. Have any spaces in the name 3. Begin the name with a number
... View more
10-29-2013
12:01 PM
|
1
|
0
|
1053
|
|
POST
|
Hi Damon, It would look something like the below: arcpy.CalculateField_management(featureclass, "field3", "!field1! * !field2!", "PYTHON_9.3","#") One good trick that you can do is execute the tool in ArcMap, then go to your Results window. Here you can right-click on the results > Copy As Python Snippet. [ATTACH=CONFIG]28664[/ATTACH]
... View more
10-28-2013
11:32 AM
|
0
|
0
|
1410
|
|
POST
|
Hi Tony, You can add a try/except to your code. Example: import arcpy import os arcpy.env.overwriteOutput = True mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.ListDataFrames(mxd, "Layers")[0] try: lyr = arcpy.mapping.ListLayers(mxd, "URBAN_12")[0] except IndexError: pass
... View more
10-28-2013
11:23 AM
|
0
|
0
|
1205
|
|
POST
|
I believe the problem was with the SQL Expression. You will need to specify 'FEAT_SEQ' twice in the query: FEAT_SEQ = " + str(FEAT_SEQ) + "AND YEAR_OF_BIRTH = " + str(list2[0]) + " OR FEAT_SEQ = " + str(FEAT_SEQ) + "AND YEAR_OF_BIRTH = " + str(list2[1]) Try the following: try: #update table with difference value with arcpy.da.UpdateCursor(table, ["FEAT_SEQ", "YEAR_OF_BIRTH", "DIFFERENCE"], "FEAT_SEQ = " + str(FEAT_SEQ) + "AND YEAR_OF_BIRTH = " + str(list2[0]) + " OR FEAT_SEQ = " + str(FEAT_SEQ) + "AND YEAR_OF_BIRTH = " + str(list2[1])) as cursor: for row in cursor: row[2] = DIFFERENCE cursor.updateRow(row) del row, cursor except: pass
... View more
10-28-2013
06:40 AM
|
0
|
0
|
5195
|
|
POST
|
Can you upload a sample of the table you are working with?
... View more
10-28-2013
06:00 AM
|
0
|
0
|
2170
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | a month ago | |
| 4 | 05-07-2020 05:14 PM | |
| 1 | 03-25-2026 04:16 AM | |
| 1 | 03-16-2026 01:00 PM | |
| 1 | 12-22-2025 10:39 AM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|