Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I usually use ArcGis 9.3.1, but when running a python script that includes Select_by_attribute (from gp), the script runs very very slowly. Is there a way I can perform a select-by-attribute on a opensource-python-module (such as shapely?)? Will it be faster?

share|improve this question
add comment

2 Answers 2

You are likely to see faster results by adding appropriate attribute indexes to your shapefile as outlined at Modifying indexes in shapefiles by indexing an attribute, or moving your data to a FileGDB and adding indexes there.

Any performance benefits of using an opensource option are likely to be outweighed by having to then integrate the results of the query back into your ESRI geoprocessing - unless you want to move the whole process to opensource. Shapely is for manipulating geometry, to select features by attributes you could use OGR and the Shapefile driver.

share|improve this answer
add comment

I've not used the python modules, but I've used the ogr2ogr utility for subsetting records from shapefiles by attribrute selection and found it to be orders of magnitude faster than using arcgis geoprocessing (10 seconds versus 6 minutes). Example ogr2ogr selection query:

SELECT * from polylayer WHERE prop_value > 220000.0 ORDER BY prop_value DESC

To keep it in the arcgis world, I've seen gp.Select_analysis be faster than gp.Select_by_attribute. I've not investigated to find out if this is always true or just a momentary peculiarity.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.