|
POST
|
I have no idea how to find out how many points each buffer overlaps. Maybe it is an easy problem but does anyone have an idea? If you have an ArcGIS Advanced license, Point Distance (with a 300m search distance) will make a table you can then process with Frequency to get the count you want.
... View more
02-25-2013
09:29 AM
|
0
|
0
|
2689
|
|
POST
|
Not a crazy question! You can get these extent numbers a couple of ways: From the ArcMap menu: Geoprocessing > Environments > Extent and choosing Same as Display -- you'll see the numbers populate and you can then copy and paste them into the Create Fishnet tool. [noparse][/noparse] The following Python code, pasted into the Python command window, will also get these numbers for you.
import arcpy.mapping
mxd = arcpy.mapping.MapDocument("CURRENT")
print mxd.activeDataFrame.extent
If you need to automate this process, you can, using ModelBuider.
... View more
02-25-2013
09:25 AM
|
0
|
0
|
991
|
|
POST
|
If you ran Point Density, then multiplied by the area of the neighborhood used, you'd get a count in the neighborhood for every cell in the output raster. This could then be transferred to your points using the Extract Values To Points tool. On the vector side, you can use the Point Distance tool followed by Frequency. Both of these vector tools, however, require an ArcGIS Advanced (aka ArcInfo) license.
... View more
02-25-2013
08:12 AM
|
0
|
0
|
877
|
|
POST
|
28082012120133 time '28/08/2012 12:01:36' 28082012120136 Runtime error Traceback (most recent call last): File "<string>", line 48, in <module> File "c:\program files (x86)\arcgis\desktop10.1\arcpy\arcpy\management.py", line 11034, in CopyRaster raise e ExecuteError: ERROR 001143: Background server threw an exception. Your output location is a personal geodatabase. Have you consider writing to a file geodatabase, which doesn't have a 2GB size limit? My guess is you're hitting the limit. (didn't see this is months ago, but probably good to add this to the thread anyway!).
... View more
02-22-2013
11:36 AM
|
0
|
0
|
1971
|
|
POST
|
I'm not sure I know how to check for the existence of a VAT. A raster can have a RAT but be all NoData. Here's how I suggest checking:
if Raster(srcras).minimum == None:
raise Exception, "Raster is all NoData!"
What I've been wondering is if my source point raster is fully created and VAT built prior to the CostDistance running. I am also creating the source point raster with that same extents and resolution, spatial reference as the cost grid. Is that necessary? You must set the snapRaster and cellSize so the source grid will line up with your cost grid. This is true whether you are making a source grid or providing points to the tool. I'd look at those scratch grids to try to verify that your source grid is ok when it fails.
... View more
02-22-2013
11:19 AM
|
0
|
0
|
3676
|
|
POST
|
Something to try: Make sure your environment extent and snap raster are set to the flow direction grid for your run of the watershed tool.
... View more
02-22-2013
10:50 AM
|
2
|
1
|
6272
|
|
POST
|
I have written a Python GeoProcessing task for running Cost Distance and Cost Path analysis. It runs sometimes and errors other times. This is the error that it normally returns when trying to run the arcpy.sa.CostDistance() method I'm trying to think why the raster attribute table would intermittently come up missing. If one of the inputs is all NoData, it will not have an attribute table even if you run BuildAttributeTable. You could get a NoData source grid if for example you extent cuts off your input points. You should probably check the existence of the attribute table if situation is going to happen just based on your input data.
... View more
02-22-2013
09:51 AM
|
0
|
0
|
3676
|
|
POST
|
I think the tool you were looking for was Nibble. I think of it as the raster equivalent of the Eliminate tool. You can use Region Group and Zonal Geometry to find the area of each clump of contiguous values, then use Set Null to mark the areas you want to remove as NoData, followed by Nibble to fill them in with nearby values.
... View more
02-21-2013
01:41 PM
|
0
|
0
|
3212
|
|
POST
|
I've wanted to do so myself, so I implemented some validation code to do this. In the documentation you would specify that the field must be FLOAT or DOUBLE.
def updateParameters(self):
"""Modify the values and properties of parameters before internal
validation is performed. This method is called whenever a parmater
has been changed."""
if self.params[0].value:
fldName = self.params[1].value
if not fldName:
# set default value
fldName = "XFIELD"
else:
# validate field name
wk = arcpy.Describe(self.params[0].value).catalogPath
fldName = arcpy.ValidateFieldName(fldName,wk).upper()
self.params[1].value = fldName
# populate filter (picklist) with the current field name
# plus existing field names
flds = arcpy.Describe(self.params[0].value).Fields
fldNames = [f.name.upper() for f in flds if f.type not in ["OID","Geometry"]]
self.params[1].filter.list = [fldName] + fldNames
return
def updateMessages(self):
"""Modify the messages created by internal validation for each tool
parameter. This method is called after internal validation."""
# If field exists, make sure it's a numeric field
fldName = self.params[1].value
if fldName:
flds = arcpy.Describe(self.params[0].value).Fields
fldNames = [f.name.upper() for f in flds]
try:
fType = flds[fldNames.index(fldName)].type
# no error means field found - make sure it's a number
if fType not in ["Double","Single"]:
self.params[1].setIDMessage("Error",889) # invalid field type
except:
pass
return
... View more
02-20-2013
07:15 AM
|
0
|
0
|
1271
|
|
POST
|
when I run the tool if I enter new field names it stops me with an error because the fields do not exist. I do still want the combo provided from the field type since there are cases where the field will exist though. I'm thinking it might be a matter of adjusting the validation logic but I've no experience doing that. Any ideas? Thanks in advance. The easy way to do this is to provide the field name as a string parameter (you can give it a default name and make it optional to save user typing). Then your script can see if the field is there and act accordingly. It's best practice to name the string parameter a "field name" instead of a "field" so it's obvious that it's a string. (Like the Add Field tool.) You can't have a pick list without writing python validation code to populate the list of picks with the existing field names (using arcpy.Describe().Fields). You'd want to add a user entered field name (if they did that) to your list. This could get complicated and I'm not sure it is worth the effort. However, if you really want to dive into that, the help is here: Customizing script tool behavior
... View more
02-19-2013
01:36 PM
|
0
|
0
|
1271
|
|
POST
|
The table was not found. [%Name%] I highly recommend you focus on using the iterator method; multi-values are a bear to work with. I don't see where you are populating a Name variable. If the variable does not exist, it gets put into your tool arguments unmodified. The normal way to get that value is to use the Parse Path tool as described above in this thread.
... View more
02-19-2013
06:44 AM
|
0
|
0
|
1221
|
|
POST
|
Thank you for the helpful tip. I was wondering, however, if the desktop.pth file would accept a network path. I would like to have my programming machine separate from my GIS machine, for example. I haven't tried it, but I would think it quite unlikely that arcpy would work without ArcGIS installed on the computer on which you are executing your script. ArcPy is an interface to communicate with ArcGIS, not a standalone python package.
... View more
02-14-2013
10:36 AM
|
0
|
0
|
1786
|
|
POST
|
it would need to be two perpendicular sides with at least 1000', if that makes it any clearer! If you have access to Spatial Analyst, you may want to try Zonal Geometry As Table using a unique polygon identifier as the zone value. The Thickness value this tool calculates may be what you need.
... View more
02-14-2013
10:21 AM
|
0
|
0
|
2636
|
|
POST
|
When I do what you have suggested, I can see the options in my tool, select "Same as Display" but the values of Top Bottom Left Right don't get sent to their respective counterparts in the Extent part of the Fishnet tool. Were you able to actually tie these together? Yes, when I connected the Extent variable I created to the fishnet tool, it seemed to work. I didn't run the tool though -- I'm using 10.1 SP1. I have gotten Fishnet to work consistently in previous versions by using the Calculate Value tools to extract and calculate parameters based on the extent. You may have to do it that way -- it's a bit kludgy but it works: [post]250138[/post] Calculate Value is a tool to get to know!
... View more
02-14-2013
09:47 AM
|
0
|
0
|
1481
|
|
POST
|
The Fishnet tool has an extent and if you select it as a parameter you get a drop down of all the [feature and raster layers] only within the working mxd. What I'd like to do is have the ability to set the Template Extent values (Top Bottom Left Right) to the values obtained from the Environment Settings > Processing Extent using the "Same As Display" option. This has to do with how the validation was set up for this tool. I discovered that if you right click / create variable of type Extent you can connect it to the Create Fishnet tool. You could then mark that value as a parameter and I think you will have what you want, the dialog will allow you to pick Same As Display.
... View more
02-14-2013
08:21 AM
|
0
|
0
|
1481
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-11-2021 01:26 PM | |
| 5 | 12-10-2021 04:58 PM | |
| 1 | 02-27-2017 09:30 AM | |
| 2 | 12-04-2023 01:05 PM | |
| 1 | 04-12-2016 10:17 AM |
| Online Status |
Offline
|
| Date Last Visited |
06-19-2024
12:10 AM
|