I am using ArcMap 10.5.1. My table contains pairs of parcel numbers and looks like this. Thank you.
It seems like the table is sorted on PARCEL_NO. Would it be possible to sort this table and create a new table, or is that not an option. This would probably create new OBJECTID and that would allow you to select by attributes using the following SQL:
MOD <SPAN class="punctuation token">(</SPAN>OBJECTID<SPAN class="punctuation token">,</SPAN> <SPAN class="number token">2</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="operator token">=</SPAN> <SPAN class="number token">0</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN></SPAN>
Given a parcel number, which address to you want to select? The low or high address, e.g., 1066 Pine St or 1068 Pine St?
The table order is important in this case. Cherie
Either all the high addresses or all low addresses. It doesn't matter which, as long as it's consistently high or low. Cherie
You can generate an OID list and then pass every other element to Layer.setSelectionSet:
lyr = # ArcPy mapping layer object fields = ["OID@", "PARCEL_NO", "WHOLEADDRESS"] sql = "ORDER BY PARCEL_NO, WHOLEADDRESS" with arcpy.da.SearchCursor(lyr, fields, sql_clause=(None,sql)) as cur: oid_list = [row[0] for row in cur] lyr.setSelectionSet("NEW", oid_list[::2]) <SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
That's great! Thanks for your help. I will give it a try. Cherie
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.