Closed chmnata closed 4 years ago
Function created in gis.geopandas_transform(geometry)
CREATE OR REPLACE FUNCTION gis.geopandas_transform(geom geometry) RETURNS geometry AS $$
BEGIN
RETURN (st_dump(ST_rotate(ST_transform(geom, 26917), -pi()/10, ST_setsrid(ST_geomfromtext('POINT(-79.3902683939991 43.7268356102524)'), 26917)) )).geom ;
END;
$$ LANGUAGE plpgsql;
Rotating geometry with geopandas is a little bit buggy and complicated when plotting multi features. Create a function in postgres to transform input geometry using the centroid of city of Toronto boundary with ST_rotate().