Dies ist eine alte Version des Dokuments!
SQL/PL-Funktion erstellen
!! Argumente alle entfernen !!
Definition:
BEGIN
New.geography_length := ST_Length( New.geography ); IF GeometryType( New.geography ) = 'POLYGON' THEN IF ST_IsValid( ST_AsText( New.geography ) ) = 't' THEN New.geography_area := ST_Area( New.geography ); New.geography_perimeter := ST_Perimeter( New.geography ); ELSE RAISE EXCEPTION 'Polygon intersection by column geography'; END IF; ELSE IF ST_IsValid( ST_AsText( New.geography_polygon ) ) = 't' THEN New.geography_area := ST_Area( New.geography_polygon ); New.geography_perimeter := ST_Perimeter( New.geography_polygon ); ELSE RAISE EXCEPTION 'Polygon intersection by column geography_polygon'; END IF; END IF; Return New;
END
Entspricht:
UPDATE discovery SET geography_area = 5, geography_length = 2 WHERE id=52