I have a road shapefile in polygon format and I want to take the centreline and end up with a shapefile in line format because I need the road's intersections.
It sounds good! And after the second step (split polylines), I think I can then select the line with very small length and remove them (I am not sure yet). I will try and let you know.
Unfortunately it did not work, because when I split the line by vertices it split it in all vertices, which makes it very difficult to do the selection by attributes (based on the length of the line) in order to clean the line which enclose the polygon.
Hi Patrik, maybe you can use "Tools for graphics and Sahpes", its a tool for ArcGis 10.xx. Its free and for me works very fine. Check it in http://www.jennessent.com/arcgis/shapes_graphics.htm,
This extension includes a large suite of tools for calculating geometric attributes of vector features and for selecting and naming graphics. All tools are available at the ArcView license level.
Among many other functions, this extension offers tools for calculating the true area and centroid of polygons as they lay on the sphere, thereby avoiding errors caused by projection distortions. This extension also offers tools to calculate true lengths of polylines as they lie on the spheroid, using Vincenty's equations. The manual thoroughly explains all algorithms used to calculate geometric attributes on the sphere and spheroid.
This extension also includes a tool to create a new shapefile from within ArcMap, either by creating an empty shapefile or by converting graphics.
I found an article that may be useful. https://support.esri.com/en/technical-article/000012414
If you have a lot of roads, editing all the ends may be a monumental task. Maybe you can automate this a little by creating nodes at all the ~90 degrees intersection and selecting all the features that are shorter to the width of the road (i.e. 50 m.) and deleting them before integrating the parallel lines into one centerline.
Alternatively, another option is to use ArcScan, go from polygon to raster to make a bi-color raster, start editing, use arcscan to convert those pixels to lines, at the end you may want to conflate the values from your polygon roads to your centerlines via a spatial join. Here is more detail on the ArcScan process:
A: Create a raster from your polygons. - Use "features to raster" or "polygon to raster" tool. Make sure that cell size for new raster is small enough that even narrowest sections of a polygon get represented. For sidewalks, cell size of 3ft worked, default cell size of ~10ft did not (missing parts of path, disconnected) - Imperative to Reclassify resulting raster into a bi-color images with all useful pixels (the ones you wish to convert to lines, typically non-0 values in your raster) reclassified as 1, and NoData reclassified as 0. Then you can use either the ArcMap Unique Values or Classified rendering options to separate the raster into two colors; raster must be symbolized in two unique colors.
B: Set up editing environment (ArcScan works inside an Edit session only) - Create a new empty line file in which newly created centerlines will be saved - Enable ArcScan extension under Customize-Extensions pulldown menu, if you haven't yet. - Start an Edit Session, designating the new empty line file/gdb as target; remember to create a feature template for new empty line fine - Add ArcScan toolbar (Customize �?? Toolbars)
C: Use ArcScan to create lines. - If everything is set up correctly, the rasterized polygons will show up as an option in ArcScan's pulldown menu for your Raster target. - Click Vectorization pulldown menu, chose "Generate Features" - Check to see that all of your original polygons generated a center line. Some of my shortest paths may not generate a centerline; turning Noise Level to 0 in Vectorization pulldown-Vectorization Settings helps some of these centerlines to come through; using the "Show Preview" in Vectorization pulldown helps you see whether changes you have made to settings and options are having an affect (hit Apply for every change to show in preview), play with the settings until you get the desired result.
D: Spatially join from your polygon roads to your newly created centerlines to transfer all attributes.
There is a tool that will do that for you, check: https://support.esri.com/en/technical-article/000012414
It involves the Collapse Dual Lines To Centerline tool, you may need to delete small single lines that are not dual to clean up your data before proceeding.
If you have a Production Mapping license (Standard or Advance), you can use the Production Centerline tool in ArcMap (available in 10.5 onwards) or the Polygon To Centerline tool in ArcGIS Pro. Simply specify the polygon as Input Feature, and the centerline will be automatically created. No manual effort needed! :)