25

Script below will output a new feature class of split polygons and the lines used for splitting them. Advanced license is required. The polygons will be split like this: Using Centroid of Minimum Bounding Geometry rectangle as midpoint and split across the rectangle. import arcpy print 'Running' arcpy.env.workspace = r'C:\TEST.gdb' #Change to match ...


23

Explode lines from the Processing Toolbox will split all lines at their vertices to separate lines. Menu Processing -> Toolbox. Type "explode" into the search field to find the function. Select your line layer from the dropdown and start. This will produce a new layer. Selecting one or more lines from the line layer will produce a splitted layer ...


16

All of the necessary tools can be found from processing toolbox and you have to be a bit innovative to achieve this. Basically by adopting this method you could achieve pretty good results, although it doesn't give you 90 degree angles in all places, but roughly equal area: 1.Create enough random points inside a polygon. I did 10 000 Run k-means clustering ...


14

To update Curlew above, as of QGIS 2.18, you would use the built-in Advanced Digitizing Toolbar, which can be accessed via View > Toolbars > Advanced Digitizing Toolbar. The toolbar will look like this and the "Split Features" button is the fifth from the right: With that loaded, and the respective later selected and in Edit mode, select the "Split Features"...


14

If you want to split your features per hand: Select your vector layer and click editing (red). Then select the scissors(green) and click two-times from one side of the polygon to the other. You will see a small dotted line. After spliting simply unable the editing and choose "save changes". Look into the attribute table to see the changes.


13

from GDAL mailing list using python import os from osgeo import ogr def multipoly2poly(in_lyr, out_lyr): for in_feat in in_lyr: geom = in_feat.GetGeometryRef() if geom.GetGeometryName() == 'MULTIPOLYGON': for geom_part in geom: addPolygon(geom_part.ExportToWkb(), out_lyr) else: addPolygon(...


12

Shapefiles have no type MultiPolygon (type = Polygon), but they support them anyway (all rings are stored in one polygon = list of polygons, look at GDAL: ESRI Shapefile) It is easier with Fiona and Shapely: import fiona from shapely.geometry import shape, mapping # open the original MultiPolygon file with fiona.open('multipolygons.shp') as source: # ...


11

If you reproject the polygon data to Asia Lambert Conic (not just On-the-fly, but really reprojecting all vertex coordinates into a new file), you can dissolve the polygons by a common attribute. This should remove the common border line. If it does not work in first run, have a closer look at the border line. There may be a small gap after the reprojection,...


11

You can substract (clip) a polygon from another of the same layer by using the plugin Clipper. You have to choose the polygon you want to clip and then you do Vector->Clipper->Clip and the plugin substracts the polygon from the bigger one. Then you choose the clipped polygon and delete it. If you can't choose the polygon you really want because the QGIS ...


10

The v.split.length function from GRASS should do exactly what you want by splitting the line into equal segments defined by the user without the need for a point layer. Here's a simple example of a straight line (it also works on non-straight and multiple lines): I added a column to calculate its length using $length in the expression: Using the v.split....


10

QGIS can do the same. On the Advance Digitizing Toolbar is the 'Split Features' button: It appears more simple than MapInfo. 1) Make the layer editable 2) Select the 'Split Features' tool 3) Select the node you wish to split at. This work with polygons also.


10

In ArcGIS try Multipart To Singlepart: Creates a feature class containing singlepart features generated by separating multipart input features After that the features will be separated (but still in one feature class).


9

Have you tried first making an intersection with the grid layer and then using Vector -> Data managment tools -> Split vector layer? It sounds exactly like what you want.


9

You can use effectively Shapely, and Fiona to read a shapefile for example: import fiona # open a line shapefile file = fiona.open('lines.shp') # first element of the shapefile first = file.next print first {'geometry': {'type': 'LineString', 'coordinates': [(203317.23, 90448.75), (203679.62, 90105.68), (203882.57, 89902.74), (204143.49, 89641.81), (204394....


9

I would probably do the following: Run the Lines to polygons tool: Vector > Geometry Tools > Lines to polygons Or the Polygonize tool (as suggested by @GaborFarkas): Processing Toolbox > QGIS Geoalgorithms > Vector geometry tools > Polygonize Run the Clip tool using the output from Step 1 as the Input layer and your polygon layer as the ...


9

Here is an answer that applies sf package functions to the reproducible data kindly provided by rcs. library(sf) A <- st_as_sfc("LINESTRING(458.1 768.23, 455.3 413.29, 522.3 325.77, 664.8 282.01, 726.3 121.56)") B <- st_as_sfc("MULTIPOLYGON(((402.2 893.03, 664.8 800.65, 611.7 666.13, 368.7 623.99, 215.1 692.06, 402.2 893.03)), ((703.9 366.29, 821.2 ...


8

The Reshape Feature Tool can be helpful for this job. Draw the new common border of the polygons (here in red color):


8

You can use the reshapeGeometry function of the QgsGeometry object for this, which cuts a polygon along its intersection with a line. The following will intersect the buffer polygons with the lines, and add the split polygon features to a memory layer (QGIS 2.0 syntax): # Get the dataProvider objects for the layers called 'line' and 'buffer' linepr = ...


8

I've put together some code below which seems to create single segment lines from polyline (which can be multipart) feature classes while retaining their attributes. I recommend that you run it against a small test dataset or two first, and if it seems to do what you want, then comment out or remove the print statements to gain some performance. If you add ...


8

Here's a script that might do it for you. The native arcpy.Geometry class has a method called "cut" that will cut any feature using another polyline. Unfortunately, since you're using "points", we have to make "fake" lines out of these points. I essentially made a scratch polyline with the points [(Point.X+10, Point.Y+10), (Point.X-10, Point.Y-10)] - e.g. a ...


8

You have many solutions and I use here a simple example 1) the easiest way from shapely.geometry import Point, LineString line = LineString([(1,2),(2,4),(4,5)]) point = Point(2,4) First, you must determine if the point is within the line (Determine if shapely point is within a linestring/multilinestring) line.distance(point) < 1e-8 True print ...


8

A little dig in the processing algorithms and you can find: Split vector layer This algorithm takes a vector layer and an attribute and generates a set of vector layers in an output folder. Each of the layers created in that folder contains all features from the input layer with the same value for the specified attribute. The number of files generated is ...


8

If you look at the Split vector layer tool script, you will see that .gpkg is hard-coded inside the script. This means there is no way to change the output format of the file directly from the GUI of script tool. However, if you want the output to be shapefile not Geopakage, you need to change that inside the script. The script is called VectorSplit which ...


8

Given a polygon pol, like this: then: > library(sf) > sdist = -0.055168 > ppol = splitnarrow(pol, sdist, 1e-3) > plot(ppol, col=1:2) produces this: Here's the source code for splitnarrow. There's a zillion places where this can go wrong, and first you have to determine sdist and eps for your polygons. splitnarrow <- function(pol, sdist, ...


8

Yes, you can just loop through the individual features and save them like so: library (sf) dat <- read_sf ("~/data.shp") for (i in seq_len (nrow (dat))) { fname <- paste0 ("~/split_", i, ".shp") write_sf (dat [i, ], fname) }


7

In addition to Curlew's answer it's important to start and end your splitting line outside of the target layer. I carefully aimed for the nodes until I found that useful tip here: http://www.cartographersguild.com/tutorials-how/17469-%5Baward-winner%5D-some-pointers-using-gis.html


7

Using ArcGIS, one way to go about this is to create a 1 X 1 KM Fishnet grid followed by using the Split tool. The general workflow/model looks like this:


7

The ST_Split PostGIS function is probably what you want. PostGIS 2.2+ now supports Multi* geometries in ST_Split. For older versions of PostGIS, read on: To get a single line split by multiple points, you could use something like this multipoint wrapper plpgsql function. I've simplified it just to the "split (multi)lines with (multi)points" case below: ...


7

May be an alternative to the suggestion AndreaJ gave- Have look at Station Lines N.B. This tool expects projected coordinate systems for the feature to be splitted by planar length unit.


Only top voted, non community-wiki answers of a minimum length are eligible