POST
|
Python is kinda weird with division, and will return an integer anytime all the inputs are integer (example: 3/2 = 1). The trick is to just force one of the variables to be a decimal (aka float). (example: 3/float(2) = 1.5). Try this: gp.calculatefield_management ("highway", "minutes", "!length_mile!*float(60)/!minutes!","PYTHON")
... View more
07-26-2010
07:56 PM
|
0
|
0
|
677
|
POST
|
Maybe a cursor would be faster - that is cursor through the .mdb file and build a shapefile that way? Seems like your .mdb file is on a network... Could it be that the network is slow? I would try to 1st copy the .mdb file locally, and then make the XYEventLayer.
... View more
07-23-2010
04:06 PM
|
0
|
0
|
666
|
POST
|
To be ESRI-compliant, you should really use pgdbList = gp.listworkspaces("","ACCESS") and fgdbList = gp.listworkspaces("","FILEGDB") as part of the os.walk command, but how about this: import os
rootDir = r"D:\csny490"
gdbList = []
mdbList = []
for dirPath, dirNames, fileNames in os.walk(rootDir, topdown=True):
if dirPath.endswith(".gdb") or ".gdb." in dirPath:
gdbList.append(dirPath)
for file in fileNames:
if file.endswith(".mdb"):
mdbList.append(dirPath + "\\" + file)
... View more
07-23-2010
09:25 AM
|
0
|
0
|
1725
|
POST
|
This may get you part way there: http://arcscripts.esri.com/details.asp?dbid=16700
... View more
07-21-2010
02:30 PM
|
0
|
1
|
476
|
POST
|
Try naming your shapefile something else than a number (1.shp). Generally it is a bad idea to name a layer or field with a number as the 1st character.
... View more
07-21-2010
09:00 AM
|
0
|
0
|
193
|
POST
|
For the addition to work (or pretty much any other raster math), your rasters must have the same spatial extent. So basically (I assume these are the light poles) for each raster you need to create a new raster where the NoData within your study area is 0 (or some other non NoData value). Here's some Python code that might give you some ideas: # Name: make_fast_mosaic_v93.py
#
# Description
# -----------
# This script will mosaic a bunch of grids, but using a secret method that is
# mucho faster than the standard v9.3.1 SP1 mosaic tool.
#
# Written By: Chris Snyder, WA DNR, 03/01/2010, chris.snyder(at)wadnr.gov
#
# Written For: Python 2.5.1 and ArcGIS v9.3.1 SP1
#
# UPDATES:
#
# Notes on input parameters (for the toolbox):
# VARIABLE PAREMETER_INDEX PARAMETER_DATA_TYPE
# -------------------------------------------------------------------
# gridList 0 Grids
# outputGrid 1 Grid
# tempWorkspace 2 Workspace
# mosaicMethod 3 String (MAX, MIN, or MEAN)
# tempNoDataValue 4 Long Integer
try:
#Process: Import some modules
import os, string, sys, time, traceback, arcgisscripting
#Process: Create the gp object
gp = arcgisscripting.create(9.3)
#Process: Defines some functions used for getting messages from the gp and python
def showGpMessage():
gp.AddMessage(gp.GetMessages())
print >> open(logFile, 'a'), gp.GetMessages()
print gp.GetMessages()
def showGpWarning():
gp.AddWarning(gp.GetMessages())
print >> open(logFile, 'a'), gp.GetMessages()
print gp.GetMessages()
def showGpError():
gp.AddError(gp.GetMessages())
print >> open(logFile, 'a'), gp.GetMessages()
print gp.GetMessages()
def showPyLog(): #just print to the log file!
print >> open(logFile, 'a'), str(time.ctime()) + " - " + message
def showPyMessage():
gp.AddMessage(str(time.ctime()) + " - " + message)
print >> open(logFile, 'a'), str(time.ctime()) + " - " + message
print str(time.ctime()) + " - " + message
def showPyWarning():
gp.AddWarning(str(time.ctime()) + " - " + message)
print >> open(logFile, 'a'), str(time.ctime()) + " - " + message
print str(time.ctime()) + " - " + message
def showPyError():
gp.AddError(str(time.ctime()) + " - " + message)
print >> open(logFile, 'a'), str(time.ctime()) + " - " + message
print str(time.ctime()) + " - " + message
#Specifies the root directory variable, defines the logFile variable, and does some minor error checking...
dateTimeString = str(time.strftime('%Y%m%d%H%M%S'))
scriptName = os.path.split(sys.argv[0])[-1].split(".")[0]
userName = string.lower(os.environ.get("USERNAME")).replace(" ","_").replace(".","_")
tempPathDir = os.environ["TEMP"]
logFileDirectory = r"\\snarf\am\div_lm\ds\gis\tools\log_files"
if os.path.exists(logFileDirectory) == True:
logFile = os.path.join(logFileDirectory, scriptName + "_" + userName + "_" + dateTimeString + ".txt")
try:
print >> open(logFile, 'a'), "Write test successfull!"
except:
logFile = os.path.join(tempPathDir, scriptName + "_" + userName + "_" + dateTimeString + ".txt")
else:
logFile = os.path.join(tempPathDir, scriptName + "_" + userName + "_" + dateTimeString + ".txt")
if os.path.exists(logFile)== True:
os.remove(logFile)
message = "Created log file " + logFile; showPyMessage()
message = "Running " + sys.argv[0]; showPyMessage()
#Process: Attempts to check out a Spatial Analyst license
try:
gp.CheckOutExtension("Spatial")
except:
message = "ERROR: Spatial analyst license is unavailable... Exiting script!"; showPyError(); sys.exit()
#Process: Check out the highest license available
try:
if gp.CheckProduct("ArcView") == "Available":
gp.SetProduct("ArcView")
elif gp.CheckProduct("ArcEditor") == "Available":
gp.SetProduct("ArcEditor")
elif gp.CheckProduct("ArcInfo") == "Available":
gp.SetProduct("ArcInfo")
except:
message = "ERROR: Could not select an ArcGIS license level! Exiting script..."; showPyError(); sys.exit()
message = "Selected an " + gp.ProductInfo() + " license"; showPyMessage()
#Process: Sets some gp environment variables
gp.overwriteoutput = True
gp.pyramid = "NONE"
gp.rasterStatistics = "NONE"
#Process: Collect the input parameters
## gridList = r"D:\csny490\usgs_dem10m\dem11746;D:\csny490\usgs_dem10m\dem11747"
## outputGrid = r"D:\csny490\temp\temp\howaboutthis"
## processingWorkspace = r"D:\csny490\temp\temp"
## mosaicMethod = "MAX"
## tempNoDataValue = "-32000"
gridList = gp.GetParameterAsText(0)
outputGrid = gp.GetParameterAsText(1)
processingWorkspace = gp.GetParameterAsText(2)
mosaicMethod = gp.GetParameterAsText(3)
tempNoDataValue = gp.GetParameterAsText(4)
#Process: Print out the input parameters
message = "INPUT PARAMETERS"; showPyMessage()
message = "----------------"; showPyMessage()
message = "Input Grids = " + gridList; showPyMessage()
message = "Output Grid = " + outputGrid; showPyMessage()
message = "Processing Workspace = " + processingWorkspace; showPyMessage()
message = "Mosaic Method = " + mosaicMethod; showPyMessage()
message = "Temp NoData Value = " + tempNoDataValue + "\n"; showPyMessage()
#Process: Figure out the maximum extent of all the input grids
message = "Calculating maximum extent of input rasters..."; showPyMessage()
i = 0
gridsToProcessList = gridList.split(";")
for grid in gridsToProcessList:
i = i + 1
dsc = gp.describe(grid)
if i == 1:
xMin = dsc.extent.xmin
yMin = dsc.extent.ymin
xMax = dsc.extent.xmax
yMax = dsc.extent.ymax
else:
if dsc.extent.xmin < xMin:
xMin = dsc.extent.xmin
if dsc.extent.xmax > xMax:
xMax = dsc.extent.xmax
if dsc.extent.ymin < yMin:
yMin = dsc.extent.ymin
if dsc.extent.ymax > yMax:
yMax = dsc.extent.ymax
gp.extent = str(xMin) + " " + str(yMin) + " " + str(xMax) + " " + str(yMax)
message = "Maximum extent of input rasters is " + str(gp.extent) + "..."; showPyMessage()
#Process: Now build some new grids that have the max extent
maxString = ""
tempGridList = []
i = 0
tempGridDict = {}
for grid in gridsToProcessList:
i = i + 1
message = "Normalizing extent of " + grid + "..."; showPyMessage()
dsc = gp.describe(grid)
if dsc.format != "GRID": #if it aint a grid, make it one
tempConvertGrid = gp.createscratchname("","","RASTER",processingWorkspace)
gp.extent = ""
gp.CopyRaster_management(grid, tempConvertGrid, "", "", "", "", "", "")
tempGridList.append(tempConvertGrid)
somaExp = "con(isnull(" + tempConvertGrid + "), " + str(tempNoDataValue) + ", " + tempConvertGrid + ")"
else:
somaExp = "con(isnull(" + grid + "), " + str(tempNoDataValue) + ", " + grid + ")"
tempGrid = gp.createscratchname("","","RASTER", processingWorkspace)
tempGridList.append(tempGrid)
maxString = maxString + tempGrid + ","
gp.extent = str(xMin) + " " + str(yMin) + " " + str(xMax) + " " + str(yMax)
gp.SingleOutputMapAlgebra_sa(somaExp, tempGrid)
#Process: Max, then put back to null
message = "Mosaicing - This will take a while..."; showPyMessage()
tempGrid = gp.createscratchname("","","RASTER",processingWorkspace)
tempGridList.append(tempGrid)
if mosaicMethod == "MIN":
somaExp = "min(" + maxString + ")"
if mosaicMethod == "MAX":
somaExp = "max(" + maxString + ")"
if mosaicMethod == "MEAN":
somaExp = "mean(" + maxString + ")"
gp.SingleOutputMapAlgebra_sa(somaExp, tempGrid)
somaExp = somaExp = "con(" + tempGrid + " == " + str(tempNoDataValue) + ", setnull(1), " + tempGrid + ")"
if outputGrid.split(".")[-1] in (".bmp",".gif",".img",".jpg",".jp2",".png",".tif") or\
".gdb" in outputGrid or ".mdb" in outputGrid or ".sde" in outputGrid:
tempMosaicGrid = gp.createscratchname("","","RASTER", processingWorkspace)
tempGridList.append(tempMosaicGrid)
gp.SingleOutputMapAlgebra_sa(somaExp, tempMosaicGrid)
gp.CopyRaster_management(tempMosaicGrid, outputGrid, "", "", "", "", "", "")
else:
gp.SingleOutputMapAlgebra_sa(somaExp, outputGrid)
#Process: Delete all the temp grids
message = "Removing temporay processing grids..."; showPyMessage()
for tempGrid in tempGridList:
try:
gp.Delete_management(tempGrid, "")
except:
message = "WARNING: Failed to delete processing grid " + str(tempGrid) + "..."; showPyWarning()
message = "All done!"; showPyMessage()
except:
message = "\n*** PYTHON ERRORS *** "; showPyMessage()
message = "Python Traceback Info: " + traceback.format_tb(sys.exc_info()[2])[0]; showPyMessage()
message = "Python Error Info: " + str(sys.exc_type)+ ": " + str(sys.exc_value) + "\n"; showPyMessage()
... View more
07-20-2010
01:53 PM
|
0
|
0
|
418
|
POST
|
Yes, I meant that indeed imbeded cursors work, but there is a big difference between working and working fast. Dictionaries are basically a way to build light-speed database tables(s) in memory. Some practical examples using Python dictionaries: http://forums.esri.com/thread.asp?t=275202&f=1729&c=93#948148 (see the .zip file) http://arcscripts.esri.com/details.asp?dbid=16700
... View more
07-20-2010
08:02 AM
|
0
|
0
|
569
|
POST
|
Here's two different methods to reorder fields via Python: 1. Add some dummy fields, calc over the values (FIELD1_DUMMY = FIELD1_ORIG), delete the original fields, add the fields you want in the order you want, calc over the values (FIELD1_ORIG = FIELD1_DUMMY), then delete the dummy fields. 2. Build a blank table, add the fields you want to retain in the order you want, then run the append tool to append the original records into the blank table with the reordered fields. As long as the field names/types are exactly the same, use the NO_TEST option, otherwise you have to use the ugly field mapping object which is a real pain.
... View more
07-19-2010
02:59 PM
|
0
|
0
|
732
|
POST
|
Is your data in a geographic projection? If so, you may need to project it into something like stateplane or UTM...
... View more
07-16-2010
09:48 AM
|
0
|
0
|
306
|
POST
|
Take a look at the Near tool: http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=1352&pid=1347&topicname=Near_(Analysis) You must have an ArcInfo license to run it however...
... View more
07-16-2010
09:30 AM
|
0
|
0
|
306
|
POST
|
Sounds as if your subprocess script is failing immediately after it is called. It might be useful for it to write some sort of log file so you can see how far it gets. for calling scripts from a "parent" script I have always used the old fashioned os.spawnv. For example: rootDir = r"D:\temp"
script = r"\\snarf\div_lm\script.py"
dateTimeStamp = time.strftime('%Y%m%d%H%M%S')
for path in sys.path:
if os.path.exists(os.path.join(path, "python.exe")) == True:
pythonExePath = os.path.join(path, "python.exe")
parameterList = [pythonExePath, script, rootDir, dateTimeStamp[:8]]
os.spawnv(os.P_WAIT, pythonExePath, parameterList)
#or to not wait for the spawned process to finish...
os.spawnv(os.P_NOWAIT, pythonExePath, parameterList) If you figure out how to get the subprocess module to use a "no wait" method, can you post it? I never found a way to do it...
... View more
07-14-2010
08:29 AM
|
0
|
0
|
1120
|
POST
|
Locks often remain for the duration of an ArcMap or ArcCatalog session, even though you aren't currently looking/accessing the FGDB. Also, the gp object does the same thing! Make sure you don't have any ArcWhatever or python.exe running (that are looking or ever looked at one time at the FGDB), and then run your script.
... View more
07-08-2010
03:25 PM
|
0
|
0
|
1253
|
POST
|
The fishnet tool is basically a way to make a polygon layer that looks like, well, a fishnet that has adjacent rectangualr (or square) polygons (like a checkerboard). I do a lot of large-dataset processing in Python, and the Fishnet tool is always my step #1 in being able to break up large datasets to get them to work with the ESRI tools. For example: # Description
# -----------
# This creates an area of interest feature class, a few buffers of the area of interest, and a fishnet polygon to use for tile-by-tile psudo-parallel processing.
# Written for Python version: 2.5.1 (PythonWin)
# Written for ArcGIS version: 9.3.1 (should be forward compatible).
# Author: Chris Snyder, WA Department of Natural Resources, chris.snyder(at)wadnr.gov
# Date created:
# Last Updated: 20090923, csny490
try:
#Import system modules and creates the Geoprocessor object (the v9.2 way)
import sys, string, os, glob, shutil, time, traceback, arcgisscripting
gp = arcgisscripting.create(9.3)
#Defines some functions
def showGpMessage():
try:
print >> open(logFile, 'a'), "\n" + gp.GetMessages() + "\n"
print "\n" + gp.GetMessages() + "\n"
except:
pass
def showPyMessage():
try:
print >> open(logFile, 'a'), str(time.ctime()) + " - " + str(message)
print str(time.ctime()) + " - " + str(message)
except:
pass
#Sets a date/time stamp variable in the format yyyymmddhhmmss (example: 20060330132345)
dateTimeStamp = time.strftime('%Y%m%d%H%M%S')
#Specifies the root variable, makes the logFile variable, and does some error checking...
root = sys.argv[1]
if os.path.exists(root)== False:
print "Specified root directory: " + root + " does not exist... Bailing out!"
sys.exit()
scriptName = sys.argv[0].split("\\")[len(sys.argv[0].split("\\")) - 1][0:-3] #Gets the name of the script without the .py extension
logFile = root + "\\log_files\\" + scriptName + "_" + dateTimeStamp[:8] + ".log" #Creates the logFile variable
if os.path.exists(root + "\\log_files") == False:
os.mkdir(root + "\\log_files")
if os.path.exists(logFile)== True:
os.remove(logFile)
message = "Deleting log file with the same name and datestamp... Recreating " + logFile; showPyMessage()
workspaceDir = "overlay_index"
if os.path.exists(root + "\\" + workspaceDir)== False:
message = "Creating layer directory: " + root + "\\" + workspaceDir; showPyMessage()
os.mkdir(root + "\\" + workspaceDir)
#Attempts to check out the highest grade license available...
if gp.CheckProduct("ArcInfo") == "Available":
gp.SetProduct("ArcInfo")
elif gp.CheckProduct("ArcEditor") == "Available":
gp.SetProduct("ArcEditor")
elif gp.CheckProduct("ArcView") == "Available":
gp.SetProduct("ArcView")
else:
messsage = "No ArcGis licesnses are available... Exiting script!"; showPyMessage(); sys.exit()
message = "Selected an " + gp.ProductInfo() + " license"; showPyMessage()
#Sets some environment variables
gp.overwriteoutput = True
gp.loghistory = False
sr = 'PROJCS["NAD_1983_HARN_StatePlane_Washington_South_FIPS_4602_Feet",GEOGCS["GCS_North_American_1983_HARN",DATUM["D_North_American_1983_HARN",SPHEROID["GRS_1980",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",1640416.666666667],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-120.5],PARAMETER["Standard_Parallel_1",45.83333333333334],PARAMETER["Standard_Parallel_2",47.33333333333334],PARAMETER["Latitude_Of_Origin",45.33333333333334],UNIT["Foot_US",0.3048006096012192]]'
gp.OutputCoordinateSystem = sr
gp.XYTolerance = "0.001 METERS"
gp.XYResolution = "0.0005 METERS"
gp.workspace = root + "\\" + workspaceDir
#Process: Creates a FGDB to hold all the spatial layers
fgdbName = "overlay_index"
fgdbPath = gp.workspace + "\\" + fgdbName + ".gdb"
gp.CreateFileGDB_management(gp.workspace, fgdbName); showGpMessage()
#Process: Makes a FC of the PLS polys we want
plsFC = root + "\\gis_layers\\pls.gdb\\pls"
plsFL = "pls_feature_layer"
gp.MakeFeatureLayer_management(plsFC, plsFL, "SUR_OWN_CD > 0 OR TIM_OWN_CD > 0", "", ""); showGpMessage()
dnrMgmtAllFC = fgdbPath + "\\dnr_mgmt_all"
gp.Dissolve_management(plsFL, dnrMgmtAllFC, "", "", "SINGLE_PART"); showGpMessage()
#Process: Creates a fishnet layer (the basis of the index polygons)
fishnetLine1FC = fgdbPath + "\\fishnet_line1"
dsc = gp.describe(dnrMgmtAllFC)
xMin = dsc.extent.xmin
yMin = dsc.extent.ymin
xMax = dsc.extent.xmax
yMax = dsc.extent.ymax
bufferWidth = 1 #Buffer width expands the the extent of the fishnet by that many map units (to make sure it extends past DNR lands a bit)
numberOfRows = 6
numberOfColumns = 6
gp.CreateFishnet_management(fishnetLine1FC, str(xMin - bufferWidth) + " " + str(yMin - bufferWidth), str(xMin - bufferWidth) + " " + str(yMin), "0", "0", numberOfRows, numberOfColumns, str(xMax + bufferWidth) + " " + str(yMax + bufferWidth), "NO_LABELS", ""); showGpMessage()
fishnet1FC = fgdbPath + "\\fishnet_poly1"
gp.FeatureToPolygon_management(fishnetLine1FC, fishnet1FC, "", "", ""); showGpMessage()
gp.Delete_management(fishnetLine1FC, ""); showGpMessage()
#Process: Creates a 2nd fishnet layer (that is more dense than the original)
fishnetLine2FC = fgdbPath + "\\fishnet_line2"
densificationFactor = 12 #this densification factor ABSOLUTELY NEEDS to be a multiple of 2 (e.g. 2,4,6,8,etc)
gp.CreateFishnet_management(fishnetLine2FC, str(xMin - bufferWidth) + " " + str(yMin - bufferWidth), str(xMin - bufferWidth) + " " + str(yMin), "0", "0", str(numberOfRows * densificationFactor), str(numberOfColumns * densificationFactor), str(xMax + bufferWidth) + " " + str(yMax + bufferWidth), "NO_LABELS", ""); showGpMessage()
fishnet2FC = fgdbPath + "\\fishnet_poly2"
gp.FeatureToPolygon_management(fishnetLine2FC, fishnet2FC, "", "", ""); showGpMessage()
gp.Delete_management(fishnetLine2FC, ""); showGpMessage()
#Process: Updates fishnet1FC with fishnet2FC for specified areas
hcpUnitFC = root + "\\gis_layers\\hcpunit.gdb\\hcpunit"
oesfFC = fgdbPath + "\\oesf"
gp.Select_analysis(hcpUnitFC, oesfFC, "HCPUNIT_ID = 1", "", ""); showGpMessage()
fishnet1FL = "fishnet_1_feature_layer"
gp.MakeFeatureLayer_management(fishnet1FC, fishnet1FL, "", "", ""); showGpMessage()
gp.SelectLayerByLocation_management(fishnet1FL, "INTERSECT", oesfFC, "", "NEW_SELECTION"); showGpMessage()
fishnet2FL = "fishnet_2_feature_layer"
gp.MakeFeatureLayer_management(fishnet2FC, fishnet2FL, "", "", ""); showGpMessage()
gp.SelectLayerByLocation_management(fishnet2FL, "HAVE_THEIR_CENTER_IN", fishnet1FL, "", "NEW_SELECTION"); showGpMessage()
gp.Delete_management(oesfFC, ""); showGpMessage()
fishnetFC = fgdbPath + "\\fishnet_poly"
gp.Update_analysis(fishnet1FC, fishnet2FL, fishnetFC, "BORDERS", ""); showGpMessage()
#Process: Make a line FC version of fishnetFC
fishnetLineFC = fgdbPath + "\\fishnet_lines"
gp.FeatureToLine_management(fishnetFC, fishnetLineFC, "", "NO_ATTRIBUTES"); showGpMessage()
#Process: Unions everything together
union1FC = fgdbPath + "\\union1"
gp.Union_analysis(fishnetFC + ";" + dnrMgmtAllFC, union1FC, "ONLY_FID", "", "GAPS"); showGpMessage()
#BLAH BLAH BLAH - I had to trim this part out to post it to the forum (stupid 10,000 charater limit!!!)
#Process: Compacts the PGDB
gp.Compact_management(fgdbPath); showGpMessage()
#Process: Creates a .txt file that indicates to other scripts how many tiles there are (this is used so that the run_union_master script doesn't have to use the gp and waste memory)
print >> open(root + "\\log_files\\" + "therearethismanytiles_" + str(numberOfTiles) + ".txt", 'a'), "therearethismanytiles_" + str(numberOfTiles)
message = "ALL DONE!"; showPyMessage()
print >> open(root + "\\log_files\\" + scriptName + "_isalldone.txt", 'a'), scriptName + "_isalldone.txt"
except:
print >> open(root + "\\log_files\\" + scriptName + "_bombed.txt", 'a'), scriptName + "_bombed.txt"
message = "\n*** LAST GEOPROCESSOR MESSAGE (may not be source of the error)***"; showPyMessage()
showGpMessage()
message = "\n*** PYTHON ERRORS *** "; showPyMessage()
message = "Python Traceback Info: " + traceback.format_tb(sys.exc_info()[2])[0]; showPyMessage()
message = "Python Error Info: " + str(sys.exc_type)+ ": " + str(sys.exc_value) + "\n"; showPyMessage()
message = "\n*** PYTHON LOCAL VARIABLE LIST ***"; showPyMessage()
variableCounter = 0
while variableCounter < len(locals()):
message = str(list(locals())[variableCounter]) + " = " + str(locals()[list(locals())[variableCounter]]); showPyMessage()
variableCounter = variableCounter + 1
showPyMessage()
... View more
07-08-2010
09:54 AM
|
0
|
0
|
1261
|
POST
|
In v9.3.1 ArcInfo level, the Clip_managment tool does indeed have an option for using a vector featureclass as a psudo-mask (see the "in_template_dataset" parameter). This is tool to use when you have a multi-band image, since the output can be any ESRI-supported format (not just GRID like the ExtractByMask tool). Check it out...
... View more
07-08-2010
08:47 AM
|
0
|
0
|
658
|
POST
|
If workstation fails (try the regionbuffer tool), you might try this in ArcGIS: 1. Convert your lake polys to a line (FeatureToLine tool) 2. Buffer the lines 20m (on both sides, round ends). If the shoreline buffer fails try: a. Build a fishnet polygon (CreateFishnet tool and then FeatureToPolygon) of sufficient # of cells to break the large contiguous line features into smaller segments. This might take a couple tries to get right. b Buffer the "chopped up" lines. 3. Erase the buffer from the lake poly. If the erase fails try: a. Intersect the lake polys with the fishnet you created for the buffers b. Try the intersect again with the "chopped up" lake polys Generally, the issue is that ArcGIS chokes when you try to do some sort of geoprocessing operation with a feature that has a kajillion vertices. The reason being that all the feature's x,y, pairs need to get loaded into memory in order to do the operation, and often the number of vertrices in a complex feature exceed the limits of the ArcGIS algorithm. The solution is to break your input features into small enough pieces to allow the algorithms to run without maxing out the memory limitations.
... View more
07-08-2010
08:17 AM
|
0
|
0
|
1261
|
Title | Kudos | Posted |
---|---|---|
1 | 02-13-2012 09:06 AM | |
2 | 10-05-2010 07:50 PM | |
1 | 02-08-2012 03:09 PM | |
1 | 10-31-2013 02:18 PM | |
1 | 06-20-2011 07:53 AM |
Online Status |
Offline
|
Date Last Visited |
a week ago
|