The Multipart Split plugin can do this during the Edit session and saves the results in the current layer instead of creating a new one. You can download this from the toolbar:
Plugins > Manage and Install Plugins
When enabled, it will appear in the Edit menu and should also appear as an icon in the toolbar:
You need to understand the Shapely binary predicates:
1) If the two polygons intersects the result of union or unary_union (in red) is a Polygon therefore you can computes the exterior
2) If the two polygons are disconnected, the result is necessary a MultiPolygon (in red with two polygons)
And if you work with Shapefiles, without topology, this may ...
For ArcGIS v. 10.1 and older I'd create new field of integer type and populate it using:
Note parser is set to Python.
It is much faster with Add Geometry Attributes tool available in newer versions of ArcGIS. Tool creates required field for you. This is how attributes on offer look like for multipart point input:
I found this tool ...
If you are using the sf classes then you cast it from MULTIPOLYGON to POLYGON. Example using data from spData package:
ncsf = st_read(system.file("shapes/sids.shp", package = "spData"))
 100 23
100 features there. Some are MULTIPOLYGON, so let's split:
> ncmp = st_cast(ncsf,"POLYGON")
In st_cast.sf(ncsf, "POLYGON")...
Your approach is almost correct. Singleparts to multipart from vector menu is (from version 2.16) using same tools as in processing toolbox, and as other processing tools from toolbox takes only selected features from input vector data by default. This can be configured in menu Processing -> Options....
So deselect all features in layer, and run it again....
Seems it has been solved by Philipp Schwarz on github :
import geopandas as gp
import pandas as pd
gpdf = gp.read_file('Germany/vg2500_bld.shp')
gpdf_singlepoly = gpdf[gpdf.geometry.type == 'Polygon']
gpdf_multipoly = gpdf[gpdf.geometry.type == 'MultiPolygon']
for i, row in gpdf_multipoly.iterrows():
With a small test sample as below:
(1) A multipart line layer.
(2) Created a polygon by geometry generator bounds($geometry). One large box encompasses all lines, as you have pointed out...
(3) So I used bounds(geometry_n($geometry, @geometry_part_num)), to create a box for each line.
Hope these red boxes (dashed) are what you were looking for.
When using the sp class, there are two functions that explode multipart features into single part features.
ms_explode from rmapshaper which works for multipart polygons and multipart lines but not for SpatialMultiPoints as described in the help file for feature.
disaggregate from sp also splits into single parts but I have found situations where it leads ...
Three days ago they are answered to my QGIS ticket. They said that from QGIS 3.0 the program load always multi part geometry. The only way to work with single part geometry, is work with new format geopackage.
In QGIS, the purpose of the Multipart to singlepart tool is not to change the layer's geometry type, but instead to separate features containing several (geometry) parts into individual features.
If you want to change the layer geometry type, you can the Convert Geometry Type instead. In the New geometry type option select Linestrings.
OK, I have been over thinking things when I posted the question. Removing segments from a road networks is much easier than that.
Road Network segment removal:
Select the road network layer in the layers panel
choose select features by polygon in the top menu bar
select all parts of the network you want be removed. Be careful, some streets might extend ...