|
POST
|
1.) As Dan said, use the SetNull tool to filter out those pixels with slope > 30 2.) Convert the raster with only slopes < 30 to a polygon feature class with the Raster to Polygon tool
... View more
02-02-2012
08:54 AM
|
0
|
0
|
1466
|
|
POST
|
Oh, right. You pass in the arguments as fields: name1(!OWNER1_LAST_NAME!, !OWNER1_FIRST_NAME!) In the code block, you reference the arguments as variables: def name1 (lastname, firstname):
if len(firstname)>0 and len(lastname)>0:
return lastname + ', ' + firstname
else:
return firstname + lastname See the example for Using Code Blocks here.
... View more
01-31-2012
01:28 PM
|
0
|
0
|
3218
|
|
POST
|
You can use the Aggregate tool to create a reduced resolution raster, then create points from those larger cells (requires Spatial Analyst).
... View more
01-23-2012
09:54 AM
|
0
|
0
|
1675
|
|
POST
|
1.) Create Minimum Boundary Geometry, rectangle by width or area (may be different), and place in the same geodatabase as your points 2.) Start editing your points 3.) Select all of the points you want to rotate 4.) Use the Rotate tool to rotate the selection (I think you'll have to eyeball when it gets horizontal)
... View more
01-20-2012
11:31 AM
|
0
|
0
|
3175
|
|
POST
|
If you want every feature exported as a seperate feature class, you would probably want to use the OBJECTID field (or some other unique ID field). That assumes that each bus line is made of only one feature...
... View more
01-19-2012
09:48 AM
|
0
|
0
|
611
|
|
POST
|
You can create a value list filter for model parameters, among other filter types. Once the user selects a value, it can be accessed by inline variable substitution.
... View more
01-19-2012
06:50 AM
|
0
|
0
|
10451
|
|
POST
|
import arcpy
arcpy.env.overwriteOutput = True
fc = "H:/GIS_Data/TEMP.gdb/points" # path to input feature class
field = "mapnumber" # field name to get unique values
arcpy.MakeFeatureLayer_management(fc, "lyr") # make feature layer
rows = arcpy.SearchCursor(fc, "", "", "", field) # make cursor, sort by field
firsttime = 1
prev = -1
for row in rows: # loop through each feature
current = row.getValue(field) # get current field value
if firsttime == 1 or prev != current:
prev = row.getValue(field) # set prev to current value
arcpy.SelectLayerByAttribute_management("lyr", "NEW_SELECTION", field + " = " + str(current))
arcpy.CopyFeatures_management("lyr", "H:/GIS_Data/TEMP.gdb/pt_" + str(current))
arcpy.Delete_management("lyr")
del row
del rows
... View more
01-19-2012
06:07 AM
|
0
|
0
|
611
|
|
POST
|
Here's one way (I spend 99% in the vector world, so there's probably a raster way that I don't know about): 1.) Make a raster that filters out everything > 200m from any road (Euclidean Distance, max. distance = 200) 2.) Convert that raster to points (Raster to Point). There will be a point for every cell < 200m from a road. 3.) Convert your roads to a raster (Polyline to Raster) 4.) Convert the roads raster to points (Raster to Point). There will be a string of points running down the roads. 5.) Assign elevation from your DEM to each distance point (Extract Values to Points) 6.) Assign elevation from your DEM to each road point (Extract Values to Points) 7.) Associate each distance point, with elevation, to the nearest road point, with elevation (Spatial Join) 8.) Calculate the elevation difference between each point and the nearest point on the road (Calculate Field) 9.) Delete any points < 100m from the road and a negative elevation. 10.) Convert those points back to a raster (Point to Raster)
... View more
01-18-2012
03:07 PM
|
0
|
0
|
4440
|
|
POST
|
It works for me. Instead of: gp.SelectLayerByAttribute("lyr", "NEW_SELECTION", field + " = " + str(current)) try: expr = field + " = " + str(current)
gp.SelectLayerByAttribute("lyr", "NEW_SELECTION", expr)
... View more
01-18-2012
01:32 PM
|
0
|
0
|
2159
|
|
POST
|
Sorry, "mapnumber" was the field I tested the script with (I thought I changed them all). You can change str(row.mapnumber) to str(current).
... View more
01-18-2012
12:09 PM
|
0
|
0
|
2159
|
|
POST
|
In arcgisscripting, I think you need to add the line row = rows.next()
between creating the SearchCursor and the loop. You also need to add that line to the very end of the loop to advance the cursor. See this help page to see an example.
... View more
01-18-2012
11:46 AM
|
0
|
0
|
2159
|
|
POST
|
Oh, sorry - didn't see you're on 9.3. Arcpy only works on 10. You can basically use the same script format, just substitute arcgisscripting for arcpy and create the geoprocessor object as you did above.
... View more
01-18-2012
11:43 AM
|
0
|
0
|
2159
|
|
POST
|
You can adapt this to suit your needs: import arcpy
arcpy.env.overwriteOutput = True
fc = "d:/Travaux/NantesMetropole/lines.shp" # path to input feature class
field = "blines" # field name to get unique values
arcpy.MakeFeatureLayer_management(fc, "lyr") # make feature layer
rows = arcpy.SearchCursor(fc, "", "", "", field) # make cursor, sort by field
firsttime = 1
prev = -1
for row in rows: # loop through each feature
current = row.getValue(field) # get current field value
if firsttime == 1 or prev != current:
prev = row.getValue(field) # set prev to current value
arcpy.SelectLayerByAttribute_management("lyr", "NEW_SELECTION", field + " = " + str(row.mapnumber))
arcpy.CopyFeatures_management("lyr", "d:/Travaux/NantesMetropole/lines" + str(current) + ".shp")
arcpy.Delete_management("lyr")
del row
del rows
... View more
01-18-2012
10:39 AM
|
0
|
0
|
2159
|
|
POST
|
Can you define "uphill area"? Are you talking about sloped sections of highway (use the Slope tool)? Or are you talking about land adjacent to roads being uphill or downhill from the road (seems like you should be able to apply a flow direction type analysis)?
... View more
01-17-2012
01:01 PM
|
0
|
0
|
4440
|
| Title | Kudos | Posted |
|---|---|---|
| 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 | |
| 2 | 07-16-2020 11:31 AM |
| Online Status |
Offline
|
| Date Last Visited |
07-15-2023
12:11 AM
|