I have ROAD (POLYLINE) Shape File with more than 400,000 Records. I am working on a code which goes like this:

  1. Loop through all Feature of the Shape File
  2. Take First Feature
  3. Find the LAST VERTEX of that feature. I get a POINT
  4. Query to FEATURE Layer all the POLYLINES Connected to that POINT and get back result in feature cusros
  5. Do some Process on returned feature of RESULT Cursor
  6. Go to Step1 until Loop is not completed.

When I do STEP-4, it obviously take lot of time because, I create a BUFFER of Say 1 meter on that POINT and Make a spatial FILTER and Run LAYER.SEARCH QUERY on entire featurelayer using that SPATIAL FILTER. Everytime querying 400,000 records making it very slow.

Is there a better way to do this thing ?

  • I have to use ArcObjects VBA.
  • I do not want to Create NETWORK from the layer.
  • Welcome to GIS.SE. Please read gis.stackexchange.com/help/formatting on how to format your questions correctly. – Nathan W Jul 10 '13 at 6:46
  • 2
    I notice you mention shapefile, have you added a spatial index? This can significantly improve the performance for such types of processing. – Hornbydd Jul 10 '13 at 9:28
  • @Hornbydd, Yes. Spatial Indexes are created on Shape File. Step-4 is eating most of the time and making loop run very slowly. Any other suggestion ? – user17345 Jul 18 '13 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.