Problem description:
I have two layers: 1) [Polygon] city blocks, and 2) [Point] the city center. The City blocks layer has 110,681 records. And The city center layer has just one record because there is only one city center in this city.
arcpy.SelectLayerByLocation_management("CityBlocks","WITHIN_A_DISTANCE","CityCenter","1 Kilometers","ADD_TO_SELECTION")
The code above selects census blocks that are 1 kilometer away from the city center in ArcMap.
Question:
Now, I have to add a field called "ring" onto the city blocks layer. And, I have to write a code that does:
ring = 1 if city blocks are 1km away from the city center.
ring = 2 if city blocks are in the ring of 1km to 2km from the city center.
ring = 3 if city blocks are in the ring of 2km to 3km from the city center.
...
It stops if there are no city blocks in the ring of (N-1)km to (N)km from the center.
How do we write a code for that selection process using arcpy?
Thanks a ton in advance!