Select to view content in your preferred language

ERROR 000520: Unexpected TopoEngine Error, SelectLayerByLocation

397
2
09-17-2010 09:05 AM
CarlBeyerhelm
Occasional Contributor
A Python script cursors through a set of 6,743 measured routes and uses SelectLayerByLocation with the WITHIN argument to select the route's underlying arcs.  The script begins normally and produces the desired results, but it eventually wrecks, and never at the same record.  In several trial runs, it has successfully processsed anywhere between 582 records on the low end and 1,842 records on the high end.

Script coding appears valid, as desired results are consistently produced.  I don't think it is a data problem because the script never wrecks in the same place, or near to the same place.  In my view, that just leaves a breakdown in processing.

Any suggestions or insights would be appreciated.
0 Kudos
2 Replies
KimOllivier
Regular Contributor II
You are reinventing ArcGIS in a Python script. There is rarely a need to loop through a set of features to do a selection. You will be running out of memory in double quick time. It is tempting to run a cursor with a few hundred records, but calling a tool while in a cursor is also very slow.

I am not sure what your process is, but there must be a command in the toolbox that would do what you appear to be wanting to do with one overlay command that will attach the respective objectids as an attribute in one fast step. I have been doing a similar overlay process this week with 700,000 records on a route system made from 500,000 records and it completes in around 7 minutes.

I did avoid CalibrateRoutes and used a modified PointsToPolylines to build a routesystem directly.
0 Kudos
CarlBeyerhelm
Occasional Contributor
Quite right.  The IDENTITY tool would do the trick, and quite rapidly.  Thanks.

On a more rhetorical level, however, I'm curious why my script has run successfully on 6 or 7 occassions in 9.2 (on the same PC, using the same dataset) but fails in 9.3.1.
0 Kudos