Hi~~~
I want to fill in the Location field.
I want to write the country name in "Europe_city" in a specific polygon.
Python Window, please~~~
Thank You~~~
import arcpy
arcpy.env.workspace = 'D:/Europe/Europe21.gdb'
feature_class = 'Europe_city'
feature_class = 'nation4'
Solved! Go to Solution.
I'm not sure this is a problem where Python is really the best way, unless you had some sort of existing table or dictionary where the cities were mapped against the country (I appreciate this is only an example you have provided for another problem).
I would suggest a Spatial Join to add a new field 'Country' or 'Location' to your cities FC, whereby if the Cities FC intersects a Country polygon, the name of that country is transferred from the Country FC to the Cities FC. Spatial Join (Analysis)—ArcGIS Pro | Documentation
You would of-course need a Countries FC but that data is widely available.
What I'm trying to do is something else. It's hard to explain as an example, so I ask you a question on a European map.
I'm not sure this is a problem where Python is really the best way, unless you had some sort of existing table or dictionary where the cities were mapped against the country (I appreciate this is only an example you have provided for another problem).
I would suggest a Spatial Join to add a new field 'Country' or 'Location' to your cities FC, whereby if the Cities FC intersects a Country polygon, the name of that country is transferred from the Country FC to the Cities FC. Spatial Join (Analysis)—ArcGIS Pro | Documentation
You would of-course need a Countries FC but that data is widely available.
Thank you.
However, it is a problem that cannot be solved with a special join.
What I'm doing is not the above.
It's just an example of Europe, which is easy to explain to find an answer.
Probably best to attempt to explain the actual problem.
I lacked understanding of the special join.
I got the answer I wanted.
I'm sorry and thank you very much.