Efficiently Assigning Numerical Values from Multiple Intersecting Polygons to Overlapping Areas: A Case Study of Austin Council Districts
This project aims to assign numerical values from multiple intersecting polygons to overlapping areas efficiently, focusing on a case study of Austin Council Districts. It solves one-to-many cardinality issues commonly encountered in Geographic Information Systems (GIS) analysis.
The project addresses the challenge of assigning numerical codes to polygons based on the council districts in which they intersect. Traditional spatial join methods suffer from one-to-one cardinality limitations, leading to incomplete data representation. This project offers a solution to overcome these limitations by accurately identifying and assigning multiple council districts to intersecting polygons.
-
Efficient Algorithm: Utilizes ArcPy in ArcGIS Pro to implement an efficient algorithm for identifying intersecting polygons and assigning corresponding council districts.
-
One-to-Many Handling: Handles one-to-many cardinality issues by populating a new TEXT field with comma-separated lists of council district numbers for each polygon.
-
Documentation: Provides detailed documentation on the workflow, solution components, and potential optimizations.
--The highlighted polygon with a yellow outline is actually intersected by two council districts in purple and orange. However, in the attribute table, only one number is assigned, coming from whichever district was reached by the code in the background of Add Spatial Join. This is the famous case of one-to-one cardinality in GIS. What I need is a one-to-many handling mentioning both Council Districts as a value (e.g., 9, 3)
To use the script in your ArcGIS Pro environment, follow these steps:
-
Create a new TEXT field in the polygon layer to store the Council District numbers.
-
Open the Field Calculator in ArcGIS Pro and set the expression to:
get_council_districts(!Shape!)
Adjust the name of the fields based on your needs and run the calculation to populate the new field with the Council District numbers for each polygon.
--In front of the field called “District” there are two numbers separated by comma (4,7) standing for the two Council Districts intersecting the highlighted polygon.
The project discusses potential factors contributing to slow performance, such as data size, complexity of geometries, intersect analysis, and spatial indexing. It offers insights into optimizing the code and improving processing efficiency. I hope to improve the speed.
Contributions to the project are welcome! Feel free to open an issue or submit a pull request if you have suggestions for improvements, optimizations, or new features.
This project is licensed under the MIT License.
- Special thanks to the City of Austin for providing the dataset used in this case study.
- Inspired by the need for efficient spatial analysis in GIS applications.
For questions, feedback, or inquiries about the project, please contact Milad Korde.