[Mapbender-users] Create points with a geoserver WFS-T

Daniel Grum daniel.grum at unibw.de
Thu Oct 15 07:51:47 EDT 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 understand what I have done not right.

I changed the trigger function in that version with the numer of 
differnet loops, but... the error message after changing the function 
and reloading my geoserver was the same.

Do I hve to delete all the Triggers in the data tables and create this 
new, if I have changed the trigger function?

--daniel


More information about the Mapbender_users mailing list