[Mapbender-users] Create points with a geoserver WFS-T
Daniel Grum
daniel.grum at unibw.de
Thu Nov 5 14:15:21 EST 2009
Sebastian Krohn-Grimberghe schrieb:
> Hello,
>
>
>> FOR current_row IN
>> SELECT *
>> 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, 5),t.the_geom)
>> AND
>> ST_Intersects(ST_Buffer(NEW.the_geom, 5),e.the_geom) AND
>> ST_Intersects(ST_Buffer(NEW.the_geom, 5),w.the_geom) AND
>> ST_Intersects(ST_Buffer(NEW.the_geom, 5),s.the_geom) AND
>> ST_Intersects(ST_Buffer(NEW.the_geom, 5),k.the_geom) AND
>> ST_Intersects(ST_Buffer(NEW.the_geom, 5),r.the_geom)
>>
>> LOOP
>> -- intersection found
>> RAISE EXCEPTION 'Gebaeude kann hier nicht errichtet werden!!!';
>> END LOOP;
>>
>> -- no intersection, new geometry will be inserted
>> RETURN NEW;
>>
>
> I guess the mistake is in the SELECT statement. First of all you should
> replace each “AND by “OR”. Because with “AND” a new geometry is only not
> inserted if it intersects a geometry in each table. But I guess you do not
> want to insert a new geometry even if it intersects a geometry in only one
> table.
> But this should not be the only mistake. So you could check the SELECT
> statement on its own. Replace “NEW.the_geom” by a geometry like
> “GeomFromText('POINT(1 1)',-1)” WHERE “-1” must be replaced by your EPGS
> code and check if the statement returns what you are expecting.
> Or you could change the trigger function by making a LOOP for each table,
> like:
>
> FOR current_row IN
> SELECT * FROM public.holzfaeller t
> WHERE ST_Intersects(ST_Buffer(NEW.the_geom, 5),t.the_geom
> LOOP
> RAISE EXCEPTION 'Gebaeude kann hier nicht errichtet werden!!!';
> END LOOP;
>
> FOR current_row IN
> SELECT * FROM public.erzmine e
> WHERE ST_Intersects(ST_Buffer(NEW.the_geom, 5),e.the_geom)
> LOOP
> RAISE EXCEPTION 'Gebaeude kann hier nicht errichtet werden!!!';
> END LOOP;
>
> …more LOOPs …
>
> RETURN NEW;
>
> Best regards,
> Sebastian
>
> --
> Sebastian Krohn-Grimberghe
> Entwicklung
>
> IP SYSCON GmbH
>
> Tiestestraße 16-18
> D-30171 Hannover
>
> _______________________________________________
> Mapbender_users mailing list
> Mapbender_users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapbender_users
>
>
I have to answer you for help.
I have not solved the problem with the WFS-T and the Trigger yet.
My WFS will not save the date in the table-->he allways print an error
message
So I can't digitize geodate now... can the mistake be in the trigger?
CREATE TRIGGER my_trigger
BEFORE INSERT OR UPDATE
ON erzmine ????????????
FOR EACH ROW
EXECUTE PROCEDURE my_trigger_function();
after the ON statement , in my case the tabel erzmine, have to be the
name of the table whre the trigger is in, RIGHT???
I think there is a mistake in the trigger and not in the trigger function?!
--daniel
More information about the Mapbender_users
mailing list