[Mapbender-users] Create points with a geoserver WFS-T
daniel.grum at unibw.de
Mon Nov 30 04:59:55 EST 2009
I want to create points(buildings) with a WFS-T in mapbender and before
this was done there must be the possibility to control if there is
another point-(building) or linestring-(water) geometry around the
point...if there is another geometry the WFT-T should stop and write an
ERROR message: "You are not able to create a point(building) there!"
New points were digitized,with digitize tool in mapbender, but it don't
control if there is a point/line at this area where the new point will
Do I have to create a PostGIS SQL script to stop the digitizing of an
I found the "mod_digitize_messages.php" whre I can create massages for
several actions, but I don't know how I can create the "control-action"
that control if there is a point in a defined area or not?!
Later I want to create a similar trigger function that control if the
user have enough ressources to build the new building-->so this trigger
function have to work at first!
I wrote this in the postgis mailing list too, with now answer!
Are there any ideas??
The triggerfuntion I used for this now is:
"CREATE OR REPLACE FUNCTION my_trigger_function() RETURNS trigger AS
-- declare variables
-- get all existing geometries which intersect the new geometry
-- around the new geometry is a buffer of 50 meters (or whatever
your unit is)
FOR current_row IN
FROM public.holzfaeller t, public.erzmine e, public.wohnhaus w,
public.steinbruch s, public.kaserne k, public.saegerwerk r
WHERE ST_Intersects(ST_Buffer(NEW.the_geom, 50),t.the_geom) AND
ST_Intersects(ST_Buffer(NEW.the_geom, 50),e.the_geom) AND
ST_Intersects(ST_Buffer(NEW.the_geom, 50),w.the_geom) AND
ST_Intersects(ST_Buffer(NEW.the_geom, 50),s.the_geom) AND
ST_Intersects(ST_Buffer(NEW.the_geom, 50),k.the_geom) AND
-- intersection found
RAISE EXCEPTION 'my error message';
-- no intersection, new geometry will be inserted
$$ LANGUAGE 'plpgsql';
And in every table-->holzfaeller, erzmine .... there is a trigger:
"CREATE TRIGGER my_trigger
BEFORE INSERT OR UPDATE
FOR EACH ROW
EXECUTE PROCEDURE my_trigger_function();"
I get this with the help of an other mapbender user!
But what can be the variable "NEW" in the trigger function -->Where come
this from, Where was this defined?
Please help me, every idea can bring me to the solution.
More information about the Mapbender_users