I have a PostGIS database with a table called 'sites' that includes a field sitename and a field geometry.
If I select, e.g.
select sitename, ST_AsGeoJSON(geometry) from sites limit 1;
I get:
Plot 7 | {"type":"Polygon","coordinates": [[[-111.974951718315,33.0745275800293,353], [-111.974935360975,33.0745276003588,353], [-111.974935370263,33.0745546649121,353], [-111.974951727608,33.0745546445826,353],[-111.974951718315,33.0745275800293,353]]]}
These are rectangles oriented very close to N-S. I would like to divide each plot in half along (or close to) its N-S axis. Is there an easy way to do this?
Solutions in PostGIS-SQL preferred. Ultimately I plan to write insert statements like
insert into sites (name, geometry)
values ('Site 1 E', (select ??east half of geometry?? from sites where name = 'Site 1'))
The closest I've gotten is ST_Split, which requires the polygon as well as the 'blade' (line used to split), but it is not clear how I can compute the blade from the geometry.