Hello everybody , I'm trying to run Topo to Raster by Arcpy, in a ArcGIS Desktop 10.2 , however, every time appears the following warning and ArcGis closes. I did an experiment by turning the Topo to Raster directly from ArcToolbox and worked perfectly. I also tried to run the tool in ModelBuilder , successfully. The error message are attached.
Rodrigo
Please email me (slynch@esri.com) a zipped copy of the data and the parameters that you are using.
Thanks
-Steve
Hello Steve, how long did I remain without accessing this forum!
I followed your suggestion and used a region with fewer outline lines (very small).
I did not quite understand your other suggestion of using a stand-alone script.
The shapefiles I used, as well as the script are attached.
I tried to run it again in the Python terminal of Arcgis (10.2) again,
but the same error described at the beginning persists.
Hi Peter,
In previous attempts, I explored the syntax arcpy.sa.TopoToRaster the most. The vertical contour interval feature class that I am using is 10m and the cellsize I use is 5m. I also use a feature class boundary. The extent already is a parameter that generates me questions. I don't know if I declare in the script as a variable using previously arcpy.env.extent.
In another experiment, I tried to create a model in ModelBuilder, using TopoToRaster and declaring the workspace. After running the tool, captured the code with their respective parameters and variables used by the Results> Copy As Python Snippet. Later, I pasted the code in ArcMap Python Window and ran. TopoToRaster with the same parameters and variables now in arcpy, after 99% closed by error.
Some friends of nearby universities, working in the geomatics area when they heard of this problem, suggested that this is a bug in arcpy.
But I still could not reach a conclusion. I will continue performing tests. I will do another test considering Peter's suggestions.
Any news, I write. But I ask everyone to continue trying to help.
Regards, Rodrigo
Hi Rodrigo
I suspect its the environment settings that are not being explicitly being set when you run the TopoToRaster from Python. When you run it from within ArcMap your current environment settings would be used. I also noted that you have not provided a Boundary Feature Class or set the output Cell Size of the DEM that you are generating. I would try to first provide a boundary Feature Class to limit the DEM extent that is being generated. Make sure they are both using same projected coordinate system.
I run TopoTo Raster on a daily basis on very large data sets that few would ever require and using the following workflow have had no errors:
Hope the following helps
What about trying it with fewer contour lines (i.e. select about 80%)?
What about in a standalone script?
How many columns and rows does the output raster have?
Curtis, both env.worspace as env.scratchworkspace are declared in the script, however, to get 99% of the running, the pop-up on the Visual Fortran Error appears and then closes the ArcGis!
Already I tested without declaring environment, but the problem persists!
Also revised all path and spelling, but all are correct.
Dan Patterson, read about the suggested article "How large the DEM can the tool TopoToRaster create?"(https://geonet.esri.com/external-link.jspa?url=https%3A%2F%2Fblogs.esri.com%2Fesri%2Farcgis%2F2012%2F08%2F13%2Fhow-large-a-dem-can-the-topotoraster-tool-create%2F), however, the expected DEM are within the processing capacity (Win7, Intel i5-650, 4GB RAM, ArcGis10.2, etc).
Anyway, I appreciate the ideas. The discussion is always welcome!
The following script text below:
... from arcpy import env
... from arcpy.sa import *
...
... # Set environment settings
... env.workspace = r"C:\Users\rodrigotr\Documents\01_PROCESSOS\2016\indice_cartas_split_buffer"
... env.scratchWorkspace = r"C:\Users\rodrigotr\Documents\01_PROCESSOS\2016\indice_cartas_split_buffer"
... # Set local variables
... input = r"C:\Users\rodrigotr\Documents\01_PROCESSOS\2016\indice_cartas_split_buffer\CN_cartas_buff5mUTM23sirgas2k\CN_buff5m_26124se.shp"
... outputFolder = r"C:\Users\rodrigotr\Documents\01_PROCESSOS\2016\indice_cartas_split_buffer\outMDE"
... inContours = TopoContour([[input, 'COTA']])
... inFeatures = ([inContours])
... # Execute TopoToRaster
... outTTR = TopoToRaster(inFeatures)
... # Save the output
... outTTR.save(outputFolder + "\\" + outTTR + ".tif")
That's all folks!
Steve, what intrigues me is the fact to error only when running in arcpy. If I use the same inputs and cellsize in TopoToRaster directly from ArcToolbox, can generate raster without any problem !!!
The solution presented by the link: https://geonet.esri.com/thread/102133#comment-468079 would not be the cause, for my Desktop is already with such a configuration ...
This problem is occurring in ArcGIS 10.2 ...
Any help is still welcome
Thanks for help and still available.
If the inputs are the same, I would look at the difference in environment. The error message is low-level and makes it look like files can't be written... have you set the env workspace and scratchWorkspace the same as they are set in the ArcMap session, or are they None -- or set to a non-existent workspace (by a typo or misspelling the path by neglecting to use raw strings (r"c:\workspace")
Correct, however, there are still constraints and you might want to read How large a DEM can the TopoToRaster tool create?
I suspect not Fortran 77 ... sigh
...we'll need info 🙂
I would guess that it is related to the output raster size and/or number of inputs. Try changing the output cellsize or limiting the number of input contours. We have done much work on trapping the "out of memory" errors so this may be non-reproducible in versions post 10.2
BTW, TopoToRaster is written in Fortran and that is most likely the reason for throwing this error.
seen 3 years ago... https://community.esri.com/message/468079#comment-468079
no closed resolution
Les membres connectés peuvent publier, suivre les mises à jour, et plus encore. Nouveau ici ? Inscrivez-vous gratuitement.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.