|
POST
|
It very well may be that these two different 'SelectByLocation' tools (when specifying the 'WITHIN_A_DISTANCE' option) are using two different buffering methods: A geodesic distance vs. a euclidean distance. I suspect that the toolbox tool is using the geodesic distance method while the (older) menu-based tool may still be using the euclidean method. Which result tool gives the "correct" answer? Is your dataset in a Geographic coordinate system or is it projected? Some more info: ---------------- http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00080000001s000000 http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000800000019000000 http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00s500000022000000.htm Both methods are correct - just depends on how you look at it.
... View more
05-18-2012
09:29 AM
|
0
|
0
|
1991
|
|
POST
|
So you get this error anytime you run any of the zonal tools? Do you have this same problem if you run any of the Zonal tools directly from the toolbox too? Hmm... You might have something wrong with your install of ArcGIS/Spatial Analyst... After exhausting other ideas, you can always try a reinstall.
... View more
05-18-2012
08:32 AM
|
0
|
0
|
682
|
|
POST
|
I think this is what you are looking for: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Using_geometry_objects_with_geoprocessing_tools/002z0000001z000000/ I've done some limited stuff with this, and it seems to work well... The idea is the geometry stuff is evaluated in RAM anyway... why not just keep it there as an object you can use instead of always reading/writting a featureclass from disk? Here is a practical example... an elaboration of some ESRI-authored code (I wrote the search tree part to get at a solution quicker)... Builds approximate maximum inscribed circles inside a polygon featureclass. Note that there is a bug with the ESRI buffer tool in v10.0 that prevents this from "always" being the actual maximum inscribed circle. Also, this code needs some refining on my part, but it should work well as-is.
try:
import arcpy, os, sys, traceback
arcpy.env.overwriteOutput = True
#Get the input feature class or layer
## inFeatures = arcpy.GetParameterAsText(0)
## outFeatures = arcpy.GetParameterAsText(1)
inFeatures = r"C:\csny490\habitat_frag_analysis_20110919\circles.gdb\mature_interior_forest"
outFeatures = r"C:\csny490\habitat_frag_analysis_20110919\circles.gdb\out_polys"
#Some housekeeping
inDesc = arcpy.Describe(inFeatures)
oidName = str(inDesc.OIDFieldName)
if inDesc.dataType == "FeatureClass":
inFeatures = arcpy.MakeFeatureLayer_management(inFeatures)
sR = inDesc.spatialReference
xyTol = sR.XYTolerance
arcpy.env.overwriteOutput = True
#Create the stub output feature class
arcpy.CopyFeatures_management(inFeatures,outFeatures)
arcpy.AddField_management(outFeatures, "BUFFDIST", "DOUBLE")
OIDFieldName = arcpy.Describe(outFeatures).OIDFieldName
arcpy.MinimumBoundingGeometry_management(outFeatures, "in_memory\\br", "RECTANGLE_BY_WIDTH", "NONE", "", "MBG_FIELDS")
#Create dictionary of ORIG_FID,MBR_WIDTH
fidWidthDict = dict([(r.ORIG_FID, r.MBG_WIDTH) for r in arcpy.SearchCursor("in_memory\\br")]) #
arcpy.Delete_management("in_memory\\br")
#Calculate the inscribed circles
rows = arcpy.UpdateCursor(outFeatures)
for row in rows:
print "Processing polygon " + str(row.getValue(OIDFieldName))
inShape = row.shape
aGeom = arcpy.Geometry()
maxBuffDist = fidWidthDict[row.getValue(OIDFieldName)] / 2
minBuffDist = xyTol
geomList = []
while (maxBuffDist - minBuffDist) >= xyTol:
midBuffDist = (minBuffDist + maxBuffDist) / 2.0
print "Checking buffer distance = " + str(midBuffDist * -1)
geomList = arcpy.Buffer_analysis(inShape, aGeom, midBuffDist * -1, "FULL","", "NONE", "")
if len(geomList) > 0:
minBuffDist = midBuffDist
else:
maxBuffDist = midBuffDist
geomList = arcpy.Buffer_analysis(inShape, aGeom, (midBuffDist - (2 * xyTol)) * -1, "FULL","", "NONE", "")
inPoint = arcpy.FeatureToPoint_management(geomList[0], aGeom, "INSIDE")[0]
geomList = arcpy.Buffer_analysis(inPoint, aGeom, (midBuffDist - xyTol), "FULL" ,"", "NONE", "")
row.BUFFDIST = midBuffDist * -1
row.shape = geomList[0]
rows.updateRow(row)
del row, rows
print "Done!!!"
except:
print "\n*** LAST GEOPROCESSOR MESSAGE (may not be source of the error)***"
print arcpy.GetMessages()
print "\n*** PYTHON ERRORS *** "
print "Python Traceback Info: " + traceback.format_tb(sys.exc_info()[2])[0]
print "Python Error Info: " + str(sys.exc_type)+ ": " + str(sys.exc_value) + "\n"
... View more
05-18-2012
08:23 AM
|
0
|
0
|
734
|
|
POST
|
Negative on the thumbdrive idea... The transfer speed is too slow and the drive capacity too small. Although some of their comoponents are similar, thumb drives are not the same thing as a SSD. Check out: http://www.amazon.com/Intel-Series-2-5-Inch-Solid-State-Drive/dp/B006VCP9G6/ref=sr_1_1?s=electronics&ie=UTF8&qid=1336666141&sr=1-1 or http://www.amazon.com/Samsung-830-Series-MZ-7PC256N-Internal/dp/B005T3GPXY Things change rapidly, but these are probably among the best SSDs you can get in May, 2012.
... View more
05-10-2012
08:10 AM
|
0
|
0
|
2263
|
|
POST
|
Don't edit the registry directly... Instead, use the "AdvancedArcMapSettings.exe" registry editor - typically stored in the C:\Program Files\ArcGIS\Desktop10.0\Utilities folder.
... View more
05-09-2012
10:50 AM
|
0
|
0
|
2263
|
|
POST
|
An update: I have been doing some testing of a machine with some newer 6.0 Gb/s SSDs (solid state hard drives). WOW!!! Huge performance increase over the 10k RPM SAS drives I had been using. Depends on the operation, but typically the hydrologic tools and associated raster-based tools (such as zonal statistics) are running 2-3 times faster with the SSDs. Raster stuff tends to be very disk I/O intensive, so I guess this makes sense. Anyway - in addition to CPU and memory... think about upgrading to SSDs also.
... View more
05-09-2012
10:22 AM
|
0
|
0
|
2263
|
|
POST
|
Can you repost using the code tag button (#)? Makes it easier to ready as indents are critical in Python...
... View more
05-08-2012
01:37 PM
|
0
|
0
|
3545
|
|
POST
|
Since you are looping through your features, are you sure that some of the subsequent loops aren't in effect overwritting some of the previous selections/counts? Can you post the code you are using?
... View more
05-04-2012
01:53 PM
|
0
|
0
|
3545
|
|
POST
|
Does not use AGREE, but could easily be made to do so. This example leverages the subprocessing module in Python to create pseudo parallel processes, which work to create a 'stream layer' from a base DEM. I wrote this script to work on data (a large LiDAR-based DEM) that has disparate "patches" (aka non-contiguous coverage). Also, WA State Plane South Feet is assumed.... And currently the parallel processing part is worthless to a contiguous DEM. The code as it currently exists would have to be altered to work on a raster with a single contiguous area of data (basically, just run the 'child' script)... Contiguous elevation data - in a hydrologic sort of sense - can't easily be "parallelized". Hopefully ESRI will fix their Basin tool so that it doesn't bomb on large datasets (#NIM033938: The Basin tool fails on large datasets). If they fix that, then these hydrologic functions would be easy to parallelize :cool:! Hope this gives you some ideas...
... View more
04-26-2012
11:00 AM
|
0
|
0
|
3072
|
|
POST
|
Tip: Ditch model builder and learn Python scripting.
... View more
04-26-2012
08:56 AM
|
0
|
0
|
3072
|
|
POST
|
Your system is entirely sufficient for using ArcGIS and ArcHydro... especially given that your dataset is relatively small. However, if you have some $$$ to blow: 1. Get the fastest/best processor you can afford. Right now (April, 2012), those would be the Intel Core i7 3960x (for a desktop), or an Intel Xeon E5-2687W (for a workstation/server). 2. Get a solid state hard drive... The Intel Cherryville 520 series is looking pretty good. Better yet, get 2 of these drives so you can use RAID0.
... View more
04-26-2012
07:12 AM
|
0
|
0
|
3072
|
|
POST
|
This might help you out too... http://forums.arcgis.com/threads/21526-Trouble-with-Feature-Datasets-in-directories-with-spaces?p=139246&viewfull=1#post139246
... View more
04-17-2012
10:02 AM
|
0
|
0
|
1508
|
|
POST
|
Don't use spaces in your dataset names. Using this line should fix your problem... outName = fc+"_"+dist.replace(" ", "_")
... View more
04-17-2012
09:56 AM
|
0
|
0
|
1508
|
|
POST
|
According to the help, the lookup tool "Creates a new raster by looking up values found in another field in the table of the input raster." I assume this is true based on the extraneous time it takes to run the tool, as well as the scratch raster I can see it creating when I run the lookup tool. Seems a simple "behind the scenes" search cursor to pull out the appropriate "VALUE" field values (the "VALUE" values that match the dot notation query) would be what needs to happen... as I am guessing this is how the old dot notation worked with INFO tables.
... View more
04-12-2012
01:05 PM
|
0
|
0
|
3668
|
|
POST
|
In a word... No. It's not complete, but have you seen this: http://forums.arcgis.com/threads/50806-ArcPy-Geoprocessor-OMD-v10-Unofficial While I wouldn't call it documentation exactly, the Python auto-complete function is pretty helpful to give you an idea of what's available in terms of methods and properties - even tool syntax. Besides, why would anyone want an easy to use reference document that, say, you could print and "look at"? I think many (all?) of us are really rooting for ESRI to change their minds and publish an arcpy OMD for v10.1.
... View more
03-28-2012
01:32 PM
|
0
|
0
|
1616
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-25-2014 12:57 PM | |
| 1 | 08-29-2024 08:23 AM | |
| 1 | 08-29-2024 08:21 AM | |
| 1 | 02-13-2012 09:06 AM | |
| 2 | 10-05-2010 07:50 PM |
| Online Status |
Offline
|
| Date Last Visited |
08-30-2024
12:25 AM
|