Select to view content in your preferred language

Please Add {Snap_to_Mid_Point} Option to Polygon To Centerline Tool

1964
8
09-06-2023 04:51 PM
WentaoChe
Frequent Contributor

It would be nice to have {Snap_to_Mid_Point} Option to Polygon To Centerline Tool

I have generated road centerlines from dissolved road polygons. I've observed that some centerlines are snapped to the corner of dead-end roads, while others are snapped to the midpoints. This behavior persists regardless of whether I set {connecting_features} as the dissolved road polygons.

Here is an example:Polygon_To_CenterLine_Capture.png

 

8 Comments
PatrickAllen3

Along with this Idea, why doesn't GIS offer to snap perpendicular to a line or feature. This would allow to draw a line segment or get a distance measurement perpendicular to a line or feature. 

DrewFlater
Status changed to: Needs Clarification

Hi again @WentaoChe .

This is a Topographic Production tool, but unfortunately our Ideas system does not offer that as a label, so I will act as a go-between to that development team. 

This enhancement was submitted last year but marked as a known limitation by the development team as of this year:

https://support.esri.com/en-us/bug/the-line-endpoints-output-from-the-polygon-to-centerlin-bug-00014...

I have marked this Idea as Needs Clarification, to see if the workaround provided by the development team can satisfy your request. 

  1. Make a copy of the input features.
  2. Measure the width of the polygon.
  3. Launch the Densify geoprocessing tool and use half the width of the polygon for the Distance parameter.
  4. Launch the Polygon To Centerline geoprocessing tool and use the densified features for the Input Features parameter.
WentaoChe

Hi @DrewFlater ,

It's always nice to receive your help and advice.

I followed the 4 steps provided by the development team:

1. Make a copy of the input features.
2. Measure the width of the polygon.
3. Densify the dissolved road polygons with the Distance of 2 meters.

  • The data size increased from 5.96MB to 34.34MB, and the processing time increased from 3 minutes to 13 minutes. Considering that the total number of polygons is 129,222, it's still much faster than I expected. Great job!

4. Launch the Polygon To Centerline tool and use the densified road polygons.

The results are excellent! Most of the centerline endpoints are positioned at the centers rather than the corners. Thank you very much!

Here is an axample:

Polygon_To_CenterLine_Capture_New.png

 

 

KoryKramer

@WentaoChe It's great to see that densifying the input polygons produced a better result. I'm curious whether you see a different result on the original data if you run the Collapse Hydro Polygon tool: https://pro.arcgis.com/en/pro-app/latest/tool-reference/cartography/collapse-hydro-polygon.htm 

WentaoChe

Hi @KoryKramer,

Thank you very much for pointing out the Collapse Hydro Polygon tool!

I run it on the original data set and compare the results with the densified polygons. Here are my findings as following:

1. It's incredibly fast! The process took only 1 minute and 48 seconds for 129,222 original road polygons. In comparison, the Polygon To Centerline tool took 2 minutes and 54 seconds for the dissolved road polygons (not Densified).

2. Collapse Hydro Polygon tool created more centerlines which were positioned to corners other than the centers of road polygons compared to the Polygon To Centerline tool.

3. The Polygon To Centerline tool created better centerlines in the intersections than the Collapse Hydro Polygon tool did.

I will dedicate more time to learning the Collapse Hydro Polygon tool going forward.

I will try Collapse Hydro Polygon tool for the 2 meter densified road polygons later. Thank you again!

Here is an example:

Polygon_To_CenterLine_Capture_3.png

WentaoChe

Hi @KoryKramer,

After densifying the original 129,222 road polygons by 2 meters, the results significantly improved compared to without densification.

Here are my steps to create the centerlines from the road polygons.

1. Launch the Densify geoprocessing tool on the original road polygons, setting the distance to 2 meters.

2. Use the Select tool to extract the non-intersection road polygons.

3. Launch the Collapse Hydro Polygon tool to generate centerlines for non-intersection road polygons.

4. Use the Select tool again to extract the intersections within the road polygons.

5. Launch the Polygon To Centerline tool to create centerlines for these intersections.

6. Merge the centerlines of intersections and non-intersections.

7. Use the Select Layer By Location tool to identify centerlines whose start or end nodes align with road polygon corners.

8. Use arcpy.da.UpdateCursor to trim the first or last 5-10 vertices of incorrect centerlines.

9. Use arcpy.edit.ExtendLine tool to extend any incorrect centerlines to the road polygon boundaries.

Here is an example of Collapse Hydro Polygon tool for 2m-Densified road polygons:

Polygon_To_CenterLine_Capture_4.png

 

 

 

WentaoChe

Hi @KoryKramer,

Densifying the original 129,222 road polygons by 2 meters took only 57 seconds.

Collapse Hydro Polygon tool generated centerlines for these polygons in just 2 minutes and 55 seconds.

It's incredibly fast! Great job, and thank you again!

KoryKramer

That's great @WentaoChe I'm glad you have some options that are working for you.