Select to view content in your preferred language

Add a Geoprocessing Tool to Create Lines Between Matching Polygons

249
12
2 weeks ago
Status: Open
Labels (1)
AmrMortada
Frequent Contributor

It would be helpful if ArcGIS Pro included a single geoprocessing tool that creates line features directly between matching polygons from two polygon feature layers.

The tool could accept the following parameters:

  • Input Polygon Layer 1
  • Input Polygon Layer 2
  • Match Field (Layer 1)
  • Match Field (Layer 2)
  • Output Line Feature Class

Currently, this workflow requires multiple geoprocessing tools, such as Feature To Point, joins, and XY To Line, or a custom Python script. A dedicated tool would eliminate these intermediate steps and temporary datasets, making the workflow simpler, more efficient, and easier to automate in ModelBuilder and geoprocessing workflows.

12 Comments
DanLee
by Esri Regular Contributor

Hello AmrMortada,

I am a little curious about your use case. Would you mind describing what polygon features you are dealing with and why you need to create lines between points (in polygons) with matching field values?  Are the Match Field values in the two layers unique, meaning always 1:1 match, or there could be 1:m, m:1, or m:n matches? Do you use the lines for visualization purposes or for some analysis? 

Thanks for your time in advance!

Dan

AmrMortada

Hi @DanLee ,

Thanks for your question.

My use case is in the telecommunications industry. I work with two polygon feature layers:

  • A hexagon KPI layer, where each hexagon represents an area with network performance metrics.
  • A sector coverage layer, where each polygon represents the coverage area of a cell sector.

Both layers contain a common field that identifies the serving sector. Each hexagon has a single serving sector, while a sector can serve many hexagons, However, I think the tool should support both 1:1 and 1 relationships by creating one line for every matching pair of polygons based on the common field.

The primary purpose is visualization. I want to generate lines from each hexagon to its serving sector so users can immediately see which sector is serving each hexagon. This makes it much easier to interpret KPI maps, investigate coverage issues, and validate sector assignments.

Thanks again for taking the time to review the idea!

BobBooth1

You could make a model in ModelBuilder with the tools you use in the manual workflow, set up the inputs and outputs, and mark those as parameters.  You could then use that model as a tool when you need it, or embed it in larger models.

https://doc.esri.com/en/arcgis-pro/latest/help/analysis/geoprocessing/modelbuilder/create-a-model-to...

 

DanLee
by Esri Regular Contributor

Hello AmrMortada,

Thank you very much for describing your use case in detail. It's indeed a good use of lines to visualize polygon relationships effectively. 

For the time being,  BobBooth1 is right. You can easily make a model and use it as a tool in your workflow.  Here is an example model I made for your reference. I did it in ArcGIS Pro 3.7 so the model has the new look. Please let me know if you have any questions or need help to get it work.  - Dan

DanLee_0-1785880872966.png

 

 

AmrMortada

Hi @DanLee and @BobBooth1 ,

Thank you both for your time and for the helpful suggestions. I really appreciate you creating and sharing the ModelBuilder example, Dan.

I agree that ModelBuilder is a great workaround. My idea is simply to have this workflow available as a built-in geoprocessing tool, making it easier to discover and use without requiring users to build their own model.

Thanks again for your feedback and for taking the time to help!

Amr

DanLee
by Esri Regular Contributor

You are welcome, AmrMortada.

Yes, I got your idea and our team is watching the votes. Your use case is for polygons. The same functionality could go with points and lines, or any combinations.

To all who may have similar needs, it would be great if you could post your cases here.

Dan

AmrMortada

Hi @DanLee ,

Thank you for the clarification and for taking the time to review the idea. I really appreciate you and the team considering it.

I agree that extending the functionality to points, lines, and combinations of geometry types could make the tool even more useful for a wider range of workflows.

Thanks again for your support!

Amr

DanLee
by Esri Regular Contributor

You are welcome, AmrMortada! Thank you for proposing the idea.

Dan

DuncanHornby

Unless I have missed an important point in this discussion, a tool already exists that achieves this? No need for a model. Its The generate origin-destination links tool.

DuncanHornby_0-1786460650619.png

 

DanLee
by Esri Regular Contributor

Hi  DuncanHornby,

You are right. It seems that Generate Origin-Destination Links serves the purpose. Thank you for pointing that out. For some reason it didn't come to my mind.

Hi  AmrMortada,

You can give that tool a try and see if it satisfies your need.