|
POST
|
But if you wanted to code a Boolean check box in a scripting tool using Python and ArcToolbox you would do something like this. myboolean = arcpy.GetParamterAsText(0) When you add the script to a ArcToolbox scripting tool you would define the parameter as type Boolean. Depending on whether the checkbox is checked or not, myboolean would have a value of "true' or 'false'. Then you could do something like if myboolean =='true': your code here...
... View more
09-12-2014
10:19 AM
|
1
|
0
|
1619
|
|
POST
|
Dan, Thanks for the reply. I am not trying to change the underlying data, just symbolize it in a different. In the grid layer properties I can see that the min and max values are between 0 and 1. My question is, when I try to symbolize those data by classes I see a different range of values. Why?
... View more
09-05-2014
10:07 AM
|
0
|
0
|
2972
|
|
POST
|
Why don't you turn the script into a scripting tool. This will allow the users to add parameters using a GUI which is available in ArcToolbox. ArcGIS Desktop Help 9.3 - An overview of creating script tools
... View more
09-04-2014
04:26 PM
|
2
|
4
|
2291
|
|
POST
|
In my ArcMap project I have a grid. When displaying the grid with stretched values I see a range of 0 to (almost)1 like I would expect. See the first image below. I can use the identify tool to select pixels in the grid and the identify returns values from 0 to (almost) 1 as expected. If I try to classify these data I am only allowed to classify values from 0 to 0.47 (see the second image below). Why is there a difference between the stretched range and the classified range? ArcGIS 10.1.2
... View more
09-04-2014
04:11 PM
|
0
|
3
|
5538
|
|
POST
|
I had the same problem using 10.1 going from tables in a gdb to feature dataset feature classes. Changing the output to something other than the name of the input table solved my two days of head scratching. Thanks!
... View more
08-22-2014
09:27 AM
|
0
|
0
|
1433
|
|
POST
|
What do you mean by 'not regular'? Are the cells not all perfect squares, is the distribution of the cells not rectangular, or are there cases where the 3 x 3 groupings will leave left-overs? If the cells are squares and the distribution of squares lends itself to 3 x 3 groupings across the surface then... Use the create fishnet tool to generate a feature class of cells that are 1500m x 1500m. Then use a spatial join to populate the original cells with the OID of the 1500 x 1500 cells.
... View more
06-16-2014
01:05 PM
|
0
|
0
|
547
|
|
POST
|
I have been able to successfully register folders using the manager for ArcGIS for Server 10.1. Thanks to everyone that helped by responding with helpful posts. I tried to register a new folder today using the same methods and parameters that have worked in the past only today I get a message that the folder is being registered (and the spinning 'please wait bar') but nothing happens. The spinning bar just spins! What would prevent me from registering a directory today when I have used the same methods in the past?
... View more
06-16-2014
12:12 PM
|
0
|
0
|
1634
|
|
POST
|
Thank you for your suggestions, but these usual ways don't work here on tidal flats (see attached) with low slopes. The contour lines make differences vizualising the river direction, but the method surface-slope not really. With this method I can't consider the direction. Also reclassification doesn't bring a benefit. Low slopes shouldn't make a difference. Convert the contours to a surface model using the advice posted by others like topo to raster. Generate a slope raster from the surface model. Use focal statistics in the Spatial Analyst toolbox to return a new surface with the average slope over some user-defined area. Reclassify the focal statistics output. It also sounds like you want to view the direction of flow. Is that right? If you want to see which way the water would flow across your surface then generate a flow accumulation surface from your surface model using the Spatial analyst /hydrology tools. After you have created the flow accumulation surface, go into the flow accumulation symbology, change the gamma stretch to something like 20 and set the standard deviation to 0.5. This will really bring out the flow directions. I hope this helps.
... View more
06-10-2014
12:48 PM
|
0
|
0
|
1934
|
|
POST
|
An alternative might be to create points along the line using this geoprocessing tool: ftp://lnnr.lummi-nsn.gov/GIS_Scripts/CreatePointsAlongALine/ Make the points with a 10 meter spacing. The output features will be points on your line attributed with distance from the start node. The tool even would with lines with bends. Next, this tool will populate the resulting point file with a new attribute with a modulo value. ftp://lnnr.lummi-nsn.gov/GIS_Scripts/Modulo/ Given your example you calculate a modulo value of 20 on the distance values. Using the new modulo values, select any point with a modulo other than zero and you will get a selection of the points at 10m, 30m, 50m from the start node. Of course, this works for one line of length 200m, or for all the lines in your line feature class with length of 200m. If you have many lines of different lengths, and you have Python or Modelbuilder skills, you could iterate the lines, get the lengths, calculate the division disance, and run the process using the values from each iteration. Good luck!
... View more
05-15-2014
12:20 PM
|
0
|
0
|
584
|
|
POST
|
Thanks, hua17! That is a more elegant solution than my hack as shown below.
infc =r'C:\MultiPartFeatureClass.shp'
outfc = r'C:\FisrtPartFeatureClass.shp'
newarray = []
for row in arcpy.da.SearchCursor(infc, ["OID@", "SHAPE@"]):
partnum = 0
for part in row[1]:
if partnum == 0:
thispart = []
for pnt in part:
if pnt:
thispart.append([pnt.X, pnt.Y])
partnum += 1
newarray.append(thispart)
features = []
for feature in newarray:
features.append(arcpy.Polyline(arcpy.Array([arcpy.Point(*coords) for coords in feature])))
arcpy.CopyFeatures_management(outfc, SingleParts)
... View more
05-09-2014
02:56 PM
|
0
|
0
|
556
|
|
POST
|
I have a line feature class with multi-part geometries. I would like to cursor through the geometries and delete any parts that are not the first part. Does anyone have any code to share?
... View more
05-09-2014
08:39 AM
|
0
|
2
|
816
|
|
POST
|
Yes, unless you changed the default z factor parameter to something other than 1.
... View more
04-17-2014
08:31 AM
|
0
|
4
|
2796
|
|
POST
|
Try running this version with an error handler and see if you get an error message to post.
# ---------------------------------------------------------------------------
# NeighborScore.py
# Created on: 2013-01-07 13:26:35.00000
# Updated on: 2014-02-12
# Description: Will create output tables based on the average and sum of neighboring polygon values
# ---------------------------------------------------------------------------
#B comment: I believe this is as the script was delivered on Feb 12 2014
#B comment: See most recent NeighborScore_Working version for most current version
try:
import sys
import traceback
import scipy.ndimage
import numpy,arcpy
import string
import PIL.Image
arcpy.env.overwriteOutput = True
inpRaster=arcpy.GetParameterAsText(0)
desc = arcpy.Describe(inpRaster)
layersource = desc.catalogPath
imageread=scipy.ndimage.imread(layersource)
sobelimage=scipy.ndimage.sobel(imageread,0)
outimage=PIL.Image.fromarray(sobelimage)
Out=outimage.save('D:\Outputs\sobel.jpg')
except arcpy.ExecuteError:
print "error"
msgs = arcpy.GetMessages(2)
arcpy.AddError(msgs)
print msgs
except:
print "error"
tb = sys.exc_info()[2]
tbinfo = traceback.format_tb(tb)[0]
pymsg = "PYTHON ERRORS:\nTraceback info:\n" + tbinfo + "\nError Info:\n" + str(sys.exc_info()[1])
msgs = "ArcPy ERRORS:\n" + arcpy.GetMessages(2) + "\n"
arcpy.AddError(pymsg)
arcpy.AddError(msgs)
print pymsg + "\n"
print msgs
... View more
04-17-2014
08:21 AM
|
0
|
0
|
1421
|
|
POST
|
Do the polygon feature class and the gird share the same coordinate system, datum, and projection? As a general rule any tool that uses both raster and vector data need the same coordinate system, datum, and projection.
... View more
04-11-2014
10:55 AM
|
0
|
0
|
454
|
|
POST
|
Whether the TIN interpolation (straight lines with a constant slope between points) or some raster interpolation method is more accurate is unknown. The density of your points, the weights you give them, and the raster interpolation method will all influence the resulting surface model in different ways. You could assess the quality of your surfaces using root mean square error (http://en.wikipedia.org/wiki/Root-mean-square_deviation). In order to do that you would need a statistically sound number of surveyed point locations (not your GPS points) with z values to calculate RMSE.
... View more
04-11-2014
10:46 AM
|
0
|
0
|
1191
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-26-2025 08:30 AM | |
| 1 | 10-29-2024 03:51 PM | |
| 1 | 06-26-2024 08:32 AM | |
| 1 | 12-06-2023 11:53 AM | |
| 1 | 06-12-2012 07:42 AM |
| Online Status |
Offline
|
| Date Last Visited |
a month ago
|