|
POST
|
Here is a straight-forward way to do this calculation using only vector feature classes: 1.) Add a new field and calculate the total area for each sub-basin 2.) Intersect the sub-basins with land use. If you have advanced licensing, the ideal tool would be Identity, to guarantee that your final sub-basins add to 100%. With Intersect, if your land uses do not entirely cover the sub-basins, the final total percents will be less than 100%, but if they are covered Intersect will work fine. 3.) Add a new field and calculate the area of the intersected polygons 4.) Use Summary Statistics or Dissolve to sum the areas, group by land use and sub-basin ID This will result in more of a list than the desired grid, so additional formatting may be required.
... View more
12-29-2015
11:15 AM
|
1
|
6
|
5053
|
|
POST
|
I suppose you know that even though no features overlap the data frame, the extent may overlap:
... View more
12-28-2015
10:50 AM
|
1
|
3
|
4211
|
|
POST
|
I'm not sure about the raster field type issue, but for handling different schemas through arcpy, look into the FieldMap and FieldMappings objects (in particular, see the examples on these pages to see how to use with the Merge tool).
... View more
12-28-2015
10:20 AM
|
2
|
5
|
2351
|
|
POST
|
This line: row[7] = (sourceFieldsList[4] + " " + sourceFieldsList[12]) ...refers to the 5th and 13th value of the list sourceFieldsList. Those values are strings (not cell values), literally: 'StreetSite_1' and 'StreetType_1'. So, when you concatenate these values, it should return 'StreetSite_1 StreetType_1', again, not the cell values. I'll say again, add a print statement within the update cursor to confirm the values you are trying to concatenate.
... View more
12-23-2015
11:08 AM
|
1
|
2
|
2063
|
|
POST
|
Help me out here - where are you trying and failing to concatentate these fields? Line 62? As has been suggested in your other threads, use print statements to confirm that the values you think should be there, are there. You check that 'StreetType' is there, but you're referencing "StreetType_1" - perhaps check that that's there.
... View more
12-23-2015
10:12 AM
|
2
|
4
|
2063
|
|
POST
|
There are a few mistakes in the script above, which will make it tricky (impossible) for a beginning to figure out. Particularly, needs to be "math.radians()", and typo in newFc vs newFC, all of which is compounded by not using the 'with' statement, so sCursor never gets deleted and causes yet more problems. I guess the point is, sometimes the out-of-the-box tools are worth it. >>> import arcpy # import arcpy
... import math # import math
... fc = r'C:\junk\start_points.shp' # change to your existing input feature class
... new_fc = r'C:\junk\new_points.shp' # change to your existing output feature class
... fields = ['POINT_X', 'POINT_Y', 'DISTANCE','BEARING'] # existing fields in input
... outFields = ['SHAPE@','x', 'y', 'distance','bearing'] # existing fields in output
... iCursor = arcpy.da.InsertCursor(new_fc,outFields ) # insert cursor
... with arcpy.da.SearchCursor(fc, fields) as sCursor: # search cursor
... for row in sCursor: # loop through rows in search cursor
... inputX = row[0] # 1st field in search cursor
... inputY = row[1] # 2nd field in search cursor
... distance = row[2] # 3rd field in search cursor
... bearing = row[3] # 4th field in search cursor
... bearing = math.radians(float(bearing)) # convert to radians
... newX = inputX + distance * math.cos(bearing) # calc new X
... newY = inputY + distance * math.sin(bearing) # calc new Y
... point = arcpy.Point(newX,newY) # create new point
... temp = [point,newX,newY,distance,bearing] # organize new attributes
... iCursor.insertRow(temp) # write new row
... del iCursor # delete insert cursor
... View more
12-22-2015
01:55 PM
|
2
|
0
|
8467
|
|
POST
|
You can do this all using out-of-the-box ArcGIS tools: 1.) You need a table containing the observation point coordinates, bearing, and distance. If you need to add coordinates, use Add XY Coordinates tool. 2.) Run Bearing Distance to Line 3.) Use Add Geometry Attributes to calculate the END_X and END_Y coordinates 4.) Make XY Event Layer using the END_X and END_Y coordinates 5.) Export the event layer to a feature class on disk
... View more
12-22-2015
01:14 PM
|
2
|
0
|
8467
|
|
POST
|
If you print the list returned by ListFeatureClasses, you may notice that shapefiles include ".shp". Try comparing against, for example, "Cluster_Sites_2014.shp" rather than "Cluster_Sites_2014".
... View more
12-22-2015
10:01 AM
|
2
|
1
|
3477
|
|
POST
|
Have you set the workspace environment? That is a necessary step 1. Refer to help here.
... View more
12-22-2015
09:30 AM
|
0
|
0
|
3477
|
|
POST
|
Is the issue that you don't trust the building footprints (i.e. you want to re-delineate the buildings)? If not, you shouldn't have to do much with the "LiDAR" side of things, and you can move on subtracting the DSM and DTM rasters in conjunction with Extract by Mask (requires Spatial Analyst).
... View more
12-21-2015
11:05 AM
|
1
|
2
|
4120
|
|
POST
|
The 'r' indicates raw string notation (see here). It says that the following string is not to be escaped by backslashes. In your example, '\t' is interpreted as 'tab' (see here for a list of escape sequences).
... View more
12-21-2015
09:57 AM
|
2
|
0
|
3653
|
|
POST
|
Try changing your path references to r'C:\...' style. Your path may be getting escaped by the backslashes. mxd = arcpy.mapping.MapDocument(r"C:\Users\holleym\Desktop\Projects\temp.mxd")
... View more
12-21-2015
09:28 AM
|
2
|
2
|
3653
|
|
POST
|
As far as I know, there is no single tool that will collapse records into the largest polygon (keeping only and all the attributes of the largest polygon), but you can do something along these lines: 1.) Move your data to a personal GDB feature class (supports MAX in SQL) 2.) Select the MAX area record for each group (e.g. senate district). Change myFeatureClass to the name of your feature class: [Shape_Area_1] IN (SELECT MAX( [Shape_Area_1]) FROM myFeatureClass GROUP BY [ADMIN3]) 3.) Export those selected records 4.) Dissolve the shapes of each group together (e.g. by ADMIN3) 5.) Join the exported max records to the dissolved shapes based on ADMIN3
... View more
12-18-2015
02:26 PM
|
1
|
0
|
1952
|
|
POST
|
As Wes says, use LIKE. However, the query is as specific as you make it. For example, Wes' example will only return records that follow the pattern [space]P[space]O[space]Box[anything or nothing]. If you can get away with it, I would make it more general, for example: ADDRESS_3 LIKE '%BOX %' ^ this would return anything containing the word BOX followed by a space.
... View more
12-18-2015
11:11 AM
|
1
|
1
|
2272
|
|
POST
|
What data type is the "StreetType" field? And, if you add 'print row[4]' before attempting to change the value, what is the suspicious value just before throwing the error?
... View more
12-18-2015
10:22 AM
|
1
|
3
|
5458
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-25-2015 01:51 PM | |
| 1 | 08-30-2013 02:22 PM | |
| 1 | 04-12-2011 11:19 AM | |
| 1 | 09-17-2021 09:43 AM | |
| 1 | 04-04-2012 12:05 PM |
| Online Status |
Offline
|
| Date Last Visited |
07-15-2023
12:11 AM
|