1

Is it possible to use shapely or some other python software to merge a LineString with a MultiLineString?

Shapely's ops.linemerge fails here.

I am attempting to merge segments of the same road, represented in different rows of the NYC streets dataset, some as LineStrings and others as MultiLineStrings. Specifically, I am using the DCM_StreetCenterLine from:

https://www1.nyc.gov/site/planning/data-maps/open-data/dwn-digital-city-map.page

zadrozny
  • 298
  • 1
  • 4
  • 14

1 Answers1

1

The shapely manual seems to suggest that you can merge LineString and MultiLineString. An approach that may work (untested) is to explode the MultiLinestring into its constituent LineStrings, you then run the merge on just all Linestrings? How to explode a MultiLineString is discussed in several ways in this Q&A.

Hornbydd
  • 43,380
  • 5
  • 41
  • 81