On Thu, Aug 16, 2018 at 6:28 PM Moritz Lennert <[email protected]> wrote: > On 16/08/18 17:04, Markus Neteler wrote: > > On Thu, Aug 16, 2018 at 10:34 AM Moritz Lennert > > <[email protected]> wrote: > >> On 15/08/18 15:56, Anika Bettge wrote: > >> > does anyone know how I can split a polygon into n polygons? > >> > > >> > For performing area image classification I need to spatially divide my > >> > training data (points in the polygon) into spatial clumps with those I > >> > want to train different classifiers, so that I do not need to load the > >> > image data for the whole polygon at once in the mapset. The image area > >> > contains 4*10^9 pixels. > >> > >> Maybe I don't really understand what you are trying to do, but would > >> v.mkgrid be the solution for you ? > > > > Unfortunately not: we want to split the area of interest (vector > > polygon) into subareas. > > It looks like this: > > https://doc.cgal.org/latest/Partition_2/index.html > > > > but with the need of specifying the number of subareas (e.g. roughly > > of the same size). > > The polygon may have "any" shape. > > > > With v.mkgrid we may end up with tiny polygon chunks here and there. > > You could clean those in a second step with v.clean tool=rmmarea.
Yes, v.mkgrid + v.clean tool=rmarea looks like a viable approach (along with v.report to get the polygon area in order to estimate about the grid number of v.mkgrid). > Otherwise, maybe the skeleton option (-s) of v.voronoi could help ? I also tried that but... # NC data g.region vector=zipcodes_wake -p v.voronoi input=zipcodes_wake output=zipcodes_wake_centerline -s d.mon wx0 d.vect zipcodes_wake d.vect zipcodes_wake_centerline color=red ... the result is, say, complex :) Hard to topologically clean up. Markus _______________________________________________ grass-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/grass-dev
