|
POST
|
Alternatively, you can use the Append Tool to add data to those datasets. You would need to alter/create fields(I'd make a copy of your existing datasets to do this too) ahead of time, but it allows for data uploading to be done programmatically instead of manually. For more on that, see this conference proceedings http://proceedings.esri.com/library/userconf/proc14/papers/460_238.pdf
... View more
10-02-2015
11:11 AM
|
1
|
1
|
3445
|
|
POST
|
What did you use for your zone field? Are all your buffers a single entry in the attribute table, or does each have its own record in the attribute table? If they each have unique ID's then the ID field could be used as the zone field, so it calculates only the std for that particular ID area. Also perhaps I should have pointed you towards Zonal Statistics as Table Tool, it seem more like what you are looking for. ArcGIS Help (10.2, 10.2.1, and 10.2.2)
... View more
09-24-2015
08:57 AM
|
1
|
2
|
4773
|
|
POST
|
Between the help page and the examples at the bottom of it for a standalone script creating contours, I'm confused why you are having issues. Could you be a little more clear about what you are having trouble with in regards to the tool syntax or python in general? I further commented the standalone example script # Name: Contour_Ex_02.py
# Description: Creates contours or isolines from a raster surface.
# Requirements: Spatial Analyst Extension
# Import system modules - Don't Change
import arcpy
from arcpy import env
from arcpy.sa import *
# Set environment settings
#This is the folder where your DEM is located, set your own
env.workspace = "C:/sapyexamples/data"
# Set local variables
#This is the name of your DEM file, set your own
inRaster = "elevation"
#This is the amount of elevation between contours(current you would get contours at 0, 200, 400 etc.) It can be changed to any float value
contourInterval = 200
#Leave this one 0
baseContour = 0
#This is the output name and location of the contour shapefile to be created, set your own
outContours = "C:/sapyexamples/output/outcontours02.shp"
# Check out the ArcGIS Spatial Analyst extension license - Don't Change
arcpy.CheckOutExtension("Spatial")
# Execute Contour - Don't Change
Contour(inRaster, outContours, contourInterval, baseContour)
... View more
09-24-2015
08:11 AM
|
2
|
1
|
2528
|
|
POST
|
HI Jessica Have you looked at the Zonal Statistics Tool? It should be able to calculate the standard deviation for each different buffer area, if you select STD for the statistics type. ArcGIS Help (10.2, 10.2.1, and 10.2.2) Also for the record, you posted this in the GeoNET help area, which is supposed to be for questions regarding Geonet. I went ahead and shared it with Spatial Analyst and Spatial Statistics, but if possible you should move it to the correct area.
... View more
09-24-2015
07:46 AM
|
1
|
4
|
4773
|
|
POST
|
You could create an empty list and append each file path plus its workspace to the list for each workspace you need, using arcpy.da.walk on each workspace. That way you have a full file path for each shapefile or feature class in a list, which you could iterate over creating feature layers and then selecting them by location.
... View more
09-23-2015
03:28 PM
|
1
|
1
|
3055
|
|
POST
|
Whoops I missed the lack of env.workspace. Otherwise, we have to stop posting the almost same responses
... View more
09-11-2015
11:45 AM
|
0
|
0
|
3091
|
|
POST
|
Couple of ways though I think for your purpose, incorporating the original file name to the new file would be best to easily identify the new output. for boundary in FDRABoundaries: ... arcpy.Clip_analysis('Wildfires', boundary, boundary + "_Clip" , xy_tolerance) Would use the input file name and then add "_Clip" to the end of it for the output name. That way you know which dataset was used for the clip. Also xy_tolerance(aka cluster_tolerance) is the 4th parameter for this tool, not the third. See ArcGIS Help (10.2, 10.2.1, and 10.2.2)
... View more
09-11-2015
11:37 AM
|
0
|
0
|
3091
|
|
POST
|
Hi Deidre, simple fix, you need to replace arcpy.Clip_analysis('Wildfires', FDRA_Boundary, FDRA) with arcpy.Clip_analysis('Wildfires', boundary, FDRA) FDRA_Boundary is a list, which is not a valid input for the tool, whereas boundary is the place holder for the item in the list you are looping through(shapefile or GDB FC, first time through this would be 'Catskill_FDRA_Boundary', and so on and so forth). I also notice you are not defining FDRA variable, you will need to do this, and name each output from clip analysis uniquely, or it will overwrite the output of each clip, since they will have the same name and filepath. Also if your files are shapefiles(since I don't see a gdb in your file path thought they might be), you will want to add .shp to each filename in the FDRA_Boundary list. Hope this helps! EDIT: Okay maybe not so simple since there are a couple things wrong, but you are on the right track.
... View more
09-11-2015
11:14 AM
|
1
|
0
|
3091
|
|
POST
|
This is far from an ideal solution, since I am uncomfortable with dictionaries, I make a list of lists that contain the attributes for existings fields using the arcpy module. In the below example, your "template" shapefile needs to be in a seperate directory from the rest, since this script does not check to see if a field already exists. If your other shapefiles were in multiple directories or subdirectories, we would need to use the os module walk function, or arcpy.da.Walk to create the list of shapes. I do not have data to test on at the moment, so this is untested and I can't show the output. #importing Modules
import arcpy
#Creating variable for template file path
template_shp = "FilePathtoShp"
#Making a list of Field Objects
fields = arcpy.ListFields(template_shp)
#Creating empty list to append field attribute list to
allfields = []
#Looping through field objects
for field in fields:
#Creating empty list to append field attributes to
field_attributes = []
#Appending all relevant field object elements as strings to list
field_attributes.append(field.name , field.type , field.precision , field.scale, field.length, field.aliasName , field.isNullable , field.required)
#Appending list of field elements to new field list
allfields.append(field_attributes)
#Setting workspace
arcpy.env.workspace = "directoryofshapefiles"
#Creating List of FeatureClasses in workspace
shapes = arcpy.ListFeatureClasses()
#Looping through each shape
for shape in shapes:
#Looping through each field
for field in allfields:
#Adding field based on field attributes of original field
arcpy.AddField_management(shape , field[0] , field[1] , field[2], field[3], field[4] , field[5], field[6] , field[7]) I'm sure someone more proficient with python could show a better way.
... View more
09-09-2015
02:41 PM
|
0
|
6
|
10054
|
|
POST
|
If you are comfortable with python, you could make a list of all the fields of the one (template) shapefile you have set-up, then loop through each other shapefile and add a field for each field that exists in the template shapefile. If this is the way you want to go about it and you need help with this, I can get you some code to use to manage this process.
... View more
09-09-2015
01:18 PM
|
1
|
8
|
10054
|
|
POST
|
Glad it worked for you. I went ahead an updated my original response with the working code, if you wouldn't mind marking the question as answered.
... View more
09-08-2015
10:24 AM
|
0
|
0
|
663
|
|
POST
|
the return needs to be within the function, but outside the for-loop. import webbrowser def OpenLink ( [HYPERLINK] 😞 pathlist = [HYPERLINK] .split(" | ") for path in pathlist: fullpath = "U:\LWATER\SCANNED" + path webbrowser.open(fullpath) return Also, you had 3 spaces for the for-loop indent, but 4 spaces for the function. I went ahead and made it 4 and 4.
... View more
09-08-2015
10:16 AM
|
0
|
2
|
4464
|
|
POST
|
move the return in my script outside the for-loop, I think it is causing it to end the loop prematurely.
... View more
09-08-2015
09:26 AM
|
0
|
4
|
4464
|
|
POST
|
So is it not opening subsequent hyperlink if there is more than one?
... View more
09-08-2015
09:23 AM
|
0
|
6
|
4464
|
|
POST
|
Looking at the results, its literally only changing the name of the .shp files, and not some of the other file components that comprise a working shapefile. Notice your dbf file and prj file are still the old file name when shown in catalog. You could do a arcpy listfiles with wildcards for those file endings and change the names similar to what you did for the .shp files. I would also check the other elements of your shapefile in windows (.shx, .sbx, .sbn, etc.) and make sure they are properly renamed as well.
... View more
09-08-2015
06:46 AM
|
2
|
5
|
5359
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-22-2017 08:58 AM | |
| 1 | 10-05-2015 05:43 AM | |
| 1 | 05-08-2015 07:03 AM | |
| 1 | 10-20-2015 02:20 PM | |
| 1 | 10-05-2015 05:46 AM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|