This video demonstrates how to calculate line density in ESRI ArcGIS for a polyline shp file.
The Line Density tool calculates the density of linear features in the neighborhood of each output raster cell. Density is calculated in units of length per unit of area.
Conceptually, a circle is drawn around each raster cell center using the search radius. The length of the portion of each line that falls within the circle is multiplied by its Population field value. These figures are summed, and the total is divided by the circle’s area.