<div dir="ltr">Good day, <div><br></div><div>I need to automatically split polygons based on a percentage value of the original polygon.</div><div><br></div><div>For example, if I have a polygon with a size of 100 ha, I want to split it so that I have two polygons one that is 25ha  (25% of the size of the original) and another that is 75ha (75% of the size of the original).</div><div><br></div><div>The split can be done from any direction as long as the polygon is split in the the right sized parts.</div><div><br></div><div>I have found an SQL script , working in PostGIS of course, that is suppose to split a polygon in to two equal parts, but I'm having some trouble modifying it to slits based on the percentage values. The script is below. Will it even be possible to use this to do what I want?</div><div><br></div><div>Can anyone help,<br></div><div><br></div><div>-----script to split a polygon in to 2 equal parts</div><div><pre class="" style="margin-top:0px;margin-bottom:10px;padding:5px;border:0px;font-size:12px;vertical-align:baseline;overflow:auto;width:auto;max-height:600px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;color:rgb(57,51,24);word-wrap:normal;line-height:18px;background-color:rgb(238,238,238)"><code style="margin:0px;padding:0px;border:0px;vertical-align:baseline;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;color:rgb(34,34,34);white-space:inherit"><span class="" style="margin:0px;padding:0px;border:0px;vertical-align:baseline;color:rgb(0,0,0)">WITH RECURSIVE
ref(the_geom, env) AS (
SELECT the_geom,
ST_Envelope(the_geom) As env,
ST_Area(The_geom)/2 As targ_area,
1000 As nit
FROM Table
),

T(n,overlap) AS (
VALUES (CAST(0 As Float),CAST(0 As Float))
UNION ALL
SELECT n + nit, ST_Area(ST_Intersection(the_geom, ST_Translate(env, n+nit, 0)))
FROM T CROSS JOIN ref
WHERE ST_Area(ST_Intersection(the_geom, ST_Translate(env, n+nit, 0)))> ref.targ_area
) ,  

bi(n) AS
(SELECT n
FROM T
ORDER BY n DESC LIMIT 1)  

SELECT bi.n,
ST_Difference(the_geom, ST_Translate(ref.env, n,0)) As geom_part1,
ST_Intersection(the_geom, ST_Translate(ref.env, n,0)) As geom_part2
FROM bi CROSS JOIN ref;</span></code></pre></div><div>----end script<br></div><div><br></div><div><br></div><div>Thanks in advance!!</div><div><br></div><div>Regards,</div><div>Jacobus Strydom</div></div>