python - arcpy query not working -


I have an ArcPy script whose purpose is to select the desired attributes (both E-dom> and e -subdom & ndash; a feature based on a question, see the examples given below from the table.)

  myQuery = '"VM_POLY" = \' e-dom \ ' Or "VM_POLY" = \ 'E subdom \' myInputShapeFile = r 'd: \ FieldStudy.shp "myOutputShapefile = r' d: \ Endangered.shp" arcpy.Select_analysis (myInputShapeFile, myOutputShapefile, myQuery)  

When the script ends, only one type of attribute is selected from the query myInputShapeFile e-dom and e-subdomain attributes, but the script will only return e -> myOutputShapefile Suppress me I know that the problem is probably in the query ( myQuery ), but I'm not sure how to solve it.

If someone provides some guidance If so, it will be appreciated.

Could it be that you get your opossom wrong?

  myQuery = '"VM_POLY" = \' e-dom \ "or" VM_POLY "= \ 'e subdom \' # # Those drags marked with a python string delimited by apostrophe a  ^ ; ¨ ^ ^ ^ ¨¨ ^ ^  

escaped ¨ And therefore the parts of the string)

I think your query should be:

  myQuery = '"VM_POLY" = \ 'E-dom' or "VM_POLY" = \ 'e subdom \' "# ^ ¨ ¨ ¨ ^  

Because or is not interpreted by dragon Should be (logical Pretr applied to two strings), but S should be part of the query text.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

lua - HowTo create a fuel bar -