Create points with a geoserver WFS-T

11 messages Options
Embed this post
Permalink
Daniel Grum

Create points with a geoserver WFS-T

Reply Threaded More More options
Print post
Permalink
Hi,

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
be digitized!

Do I have to create a PostGIS SQL script to stop the digitizing of an
new point?
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?!

I wrote this in the postgis mailing list too, with now answer!

Are there any ideas??

--daniel
_______________________________________________
Mapbender_users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapbender_users
Verena Diewald

Re: Create points with a geoserver WFS-T

Reply Threaded More More options
Print post
Permalink
Hi Daniel,

to check your new geometry you can write a database rule (or function, I don't
know exactly) to avoid that this geometry is inserted if it is part of
another geometry.
What I'm not sure about in this case is the response xml GeoServer will give
back to the Mapbender digitizing module. For your case there should be a
special return value so that you can react on that return value in the
Mapbender script with a special client message.

Greetings

Verena

 
Am Dienstag 13 Oktober 2009 13:55:48 schrieb Daniel Grum:

> Hi,
>
> 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
> be digitized!
>
> Do I have to create a PostGIS SQL script to stop the digitizing of an
> new point?
> 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?!
>
> I wrote this in the postgis mailing list too, with now answer!
>
> Are there any ideas??
>
> --daniel
> _______________________________________________
> Mapbender_users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapbender_users



--
_______________________________________________
Mapbender_users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapbender_users
Daniel Grum

Re: Create points with a geoserver WFS-T

Reply Threaded More More options
Print post
Permalink
Verena Diewald schrieb:

> Hi Daniel,
>
> to check your new geometry you can write a database rule (or function, I don't
> know exactly) to avoid that this geometry is inserted if it is part of
> another geometry.
> What I'm not sure about in this case is the response xml GeoServer will give
> back to the Mapbender digitizing module. For your case there should be a
> special return value so that you can react on that return value in the
> Mapbender script with a special client message.
>
> Greetings
>
> Verena
>
>  
> Am Dienstag 13 Oktober 2009 13:55:48 schrieb Daniel Grum:
>  
>> Hi,
>>
>> 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
>> be digitized!
>>
>> Do I have to create a PostGIS SQL script to stop the digitizing of an
>> new point?
>> 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?!
>>
>> I wrote this in the postgis mailing list too, with now answer!
>>
>> Are there any ideas??
>>
>> --daniel
>> _______________________________________________
>> Mapbender_users mailing list
>> [hidden email]
>> http://lists.osgeo.org/mailman/listinfo/mapbender_users
>>    
If I unstand you correctly, I have to write a function in my PostgreSQL
database. I never programmed a function in PostgreSQL by my
self...should this be sth. like a Trigger: so the Trigger startet after
the user created the object?! and wrote the message? and stop the action
saving the new point in my database!

Has anybody else an idea?
--daniel
_______________________________________________
Mapbender_users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapbender_users
Sebastian Krohn-Grimberghe

RE: Create points with a geoserver WFS-T

Reply Threaded More More options
Print post
Permalink
In reply to this post by Verena Diewald
Hello Daniel,

> If I unstand you correctly, I have to write a function in my PostgreSQL
> database. I never programmed a function in PostgreSQL by my
> self...should this be sth. like a Trigger: so the Trigger startet after
> the user created the object?! and wrote the message? and stop the
> action
> saving the new point in my database!

You are right... You can create a trigger for your geometry table, which is
called when GeoServer inserts a new geometry into the table. There you can
check with PostGIS functions if the new (buffered) point intersects other
geometries. If the point intersects another geometry you can raise an
exception. By raising the exception the new point will not be stored in the
database and GeoServer should receive and pass a failure message.

The trigger function could look like this:

CREATE OR REPLACE FUNCTION my_trigger_function() RETURNS trigger AS
 $$
   DECLARE
        -- declare variables
      current_row RECORD;
   BEGIN
        -- get all existing geometries which intersect the new geometry
(NEW.the_geom)
        -- around the new geometry is a buffer of 50 meters (or whatever
your unit is)
      FOR current_row IN SELECT * from my_geom_table t WHERE
ST_Intersects(ST_Buffer(NEW.the_geom, 50),t.the_geom) LOOP
                -- intersection found
                RAISE EXCEPTION 'my error message';
      END LOOP;

        -- no intersection, new geometry will be inserted
      RETURN NEW;
   END;
 $$ LANGUAGE 'plpgsql';

CREATE TRIGGER my_trigger BEFORE INSERT OR UPDATE ON my_geom_table FOR EACH
ROW EXECUTE PROCEDURE my_trigger_function();


I use a similar trigger with an OpenLayers client. When an exception is
raised, GeoServer returns XML with a failure information. But the message is
always the same, so it is not affected by the error message in the trigger
function. I do not know how the error messages of WFS transactions are
handled by Mapbender. So I cannot help you with this yet, but I hope this
helps you with the database part.


Best regards,
Sebastian

--
Sebastian Krohn-Grimberghe
Entwicklung

IP SYSCON GmbH

Tiestestraße 16-18
D-30171 Hannover
Tel.: +49 (511)  85 03 03 - 0
Fax: +49 (511)  85 03 03 - 30
E-Mail: [hidden email]
http://www.ipsyscon.de/

_______________________________________________
Mapbender_users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapbender_users
Daniel Grum

Re: Create points with a geoserver WFS-T

Reply Threaded More More options
Print post
Permalink
Sebastian Krohn-Grimberghe schrieb:

> Hello Daniel,
>
>  
>> If I unstand you correctly, I have to write a function in my PostgreSQL
>> database. I never programmed a function in PostgreSQL by my
>> self...should this be sth. like a Trigger: so the Trigger startet after
>> the user created the object?! and wrote the message? and stop the
>> action
>> saving the new point in my database!
>>    
>
> You are right... You can create a trigger for your geometry table, which is
> called when GeoServer inserts a new geometry into the table. There you can
> check with PostGIS functions if the new (buffered) point intersects other
> geometries. If the point intersects another geometry you can raise an
> exception. By raising the exception the new point will not be stored in the
> database and GeoServer should receive and pass a failure message.
>
> The trigger function could look like this:
>
> CREATE OR REPLACE FUNCTION my_trigger_function() RETURNS trigger AS
>  $$
>    DECLARE
> -- declare variables
>       current_row RECORD;
>    BEGIN
> -- get all existing geometries which intersect the new geometry
> (NEW.the_geom)
> -- around the new geometry is a buffer of 50 meters (or whatever
> your unit is)
>       FOR current_row IN SELECT * from my_geom_table t WHERE
> ST_Intersects(ST_Buffer(NEW.the_geom, 50),t.the_geom) LOOP
> -- intersection found
> RAISE EXCEPTION 'my error message';
>       END LOOP;
>
> -- no intersection, new geometry will be inserted
>       RETURN NEW;
>    END;
>  $$ LANGUAGE 'plpgsql';
>
> CREATE TRIGGER my_trigger BEFORE INSERT OR UPDATE ON my_geom_table FOR EACH
> ROW EXECUTE PROCEDURE my_trigger_function();
>
>
> I use a similar trigger with an OpenLayers client. When an exception is
> raised, GeoServer returns XML with a failure information. But the message is
> always the same, so it is not affected by the error message in the trigger
> function. I do not know how the error messages of WFS transactions are
> handled by Mapbender. So I cannot help you with this yet, but I hope this
> helps you with the database part.
>
>
> Best regards,
> Sebastian
>
> --
> Sebastian Krohn-Grimberghe
> Entwicklung
>
> IP SYSCON GmbH
>
> Tiestestraße 16-18
> D-30171 Hannover
> Tel.: +49 (511)  85 03 03 - 0
> Fax: +49 (511)  85 03 03 - 30
> E-Mail: [hidden email]
> http://www.ipsyscon.de/
>
> _______________________________________________
> Mapbender_users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapbender_users
>
>  
At first: thank you for this creat ideas and the examples.

Now the question: my_geom_table --> is this a variable for the
table/tables where new building should be inserted?
--> the problem is that the_geom of a lumberjack will be save in an
other table than the_geom of a stonee etc.
Can I make one my_trigger_function for a number of new geoms?

--daniel

_______________________________________________
Mapbender_users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapbender_users
Daniel Grum

Re: Create points with a geoserver WFS-T

Reply Threaded More More options
Print post
Permalink
In reply to this post by Sebastian Krohn-Grimberghe
Sebastian Krohn-Grimberghe schrieb:

> Hello Daniel,
>
>  
>> If I unstand you correctly, I have to write a function in my PostgreSQL
>> database. I never programmed a function in PostgreSQL by my
>> self...should this be sth. like a Trigger: so the Trigger startet after
>> the user created the object?! and wrote the message? and stop the
>> action
>> saving the new point in my database!
>>    
>
> You are right... You can create a trigger for your geometry table, which is
> called when GeoServer inserts a new geometry into the table. There you can
> check with PostGIS functions if the new (buffered) point intersects other
> geometries. If the point intersects another geometry you can raise an
> exception. By raising the exception the new point will not be stored in the
> database and GeoServer should receive and pass a failure message.
>
> The trigger function could look like this:
>
> CREATE OR REPLACE FUNCTION my_trigger_function() RETURNS trigger AS
>  $$
>    DECLARE
> -- declare variables
>       current_row RECORD;
>    BEGIN
> -- get all existing geometries which intersect the new geometry
> (NEW.the_geom)
> -- around the new geometry is a buffer of 50 meters (or whatever
> your unit is)
>       FOR current_row IN SELECT * from my_geom_table t WHERE
> ST_Intersects(ST_Buffer(NEW.the_geom, 50),t.the_geom) LOOP
> -- intersection found
> RAISE EXCEPTION 'my error message';
>       END LOOP;
>
> -- no intersection, new geometry will be inserted
>       RETURN NEW;
>    END;
>  $$ LANGUAGE 'plpgsql';
>
> CREATE TRIGGER my_trigger BEFORE INSERT OR UPDATE ON my_geom_table FOR EACH
> ROW EXECUTE PROCEDURE my_trigger_function();
>
>
> I use a similar trigger with an OpenLayers client. When an exception is
> raised, GeoServer returns XML with a failure information. But the message is
> always the same, so it is not affected by the error message in the trigger
> function. I do not know how the error messages of WFS transactions are
> handled by Mapbender. So I cannot help you with this yet, but I hope this
> helps you with the database part.
>
>
> Best regards,
> Sebastian
>
> --
> Sebastian Krohn-Grimberghe
> Entwicklung
>
> IP SYSCON GmbH
>
> Tiestestraße 16-18
> D-30171 Hannover
> Tel.: +49 (511)  85 03 03 - 0
> Fax: +49 (511)  85 03 03 - 30
> E-Mail: [hidden email]
> http://www.ipsyscon.de/
>
> _______________________________________________
> Mapbender_users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapbender_users
>
>  
I tried to solve the problem, but after I made this TRIGGER function I
can not create new points(buildings) anymore!!! I allways get the
message that the new point can not by saved in my database from the
WFS-T :-(

My TRIGGER function is:

-- Function: my_trigger_function()

-- DROP FUNCTION my_trigger_function();

CREATE OR REPLACE FUNCTION my_trigger_function()
  RETURNS trigger AS
$BODY$
   DECLARE
    -- declare variables
      current_row RECORD;
   BEGIN
    -- get all existing geometries which intersect the new geometry
NEW.the_geom
    -- around the new geometry is a buffer of 50 meters (or whatever
your unit is)
      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;
   END;
 $BODY$
  LANGUAGE 'plpgsql' VOLATILE
  COST 100;
ALTER FUNCTION my_trigger_function() OWNER TO postgres;

I tried a low buffer but the but the error message was the same :-(
Where can be the mistake???
--daniel
_______________________________________________
Mapbender_users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapbender_users
Sebastian Krohn-Grimberghe

RE: Create points with a geoserver WFS-T

Reply Threaded More More options
Print post
Permalink
In reply to this post by Sebastian Krohn-Grimberghe
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
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapbender_users
Daniel Grum

Re: Create points with a geoserver WFS-T

Reply Threaded More More options
Print post
Permalink
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
> [hidden email]
> 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
_______________________________________________
Mapbender_users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapbender_users
Sebastian Krohn-Grimberghe

RE: Create points with a geoserver WFS-T

Reply Threaded More More options
Print post
Permalink
In reply to this post by Sebastian Krohn-Grimberghe
Hello,

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

No, you just have to replace the trigger function.

> 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.

If this does not work I cannot help you with this, except for giving you the
advice to test the select statements and change them until they return the
correct results. It works fine with my data, but of course I do not know
anything about the data you are using.

Best regards,
Sebastian

--
Sebastian Krohn-Grimberghe
Entwicklung

IP SYSCON GmbH

Tiestestraße 16-18
D-30171 Hannover

_______________________________________________
Mapbender_users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapbender_users
Daniel Grum

Re: Create points with a geoserver WFS-T

Reply Threaded More More options
Print post
Permalink
Sebastian Krohn-Grimberghe schrieb:

> Hello,
>
> Daniel Grum wrote:
>  
>> Do I hve to delete all the Triggers in the data tables and create this
>> new, if I have changed the trigger function?
>>    
>
> No, you just have to replace the trigger function.
>
>  
>> 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.
>>    
>
> If this does not work I cannot help you with this, except for giving you the
> advice to test the select statements and change them until they return the
> correct results. It works fine with my data, but of course I do not know
> anything about the data you are using.
>
> Best regards,
> Sebastian
>
> --
> Sebastian Krohn-Grimberghe
> Entwicklung
>
> IP SYSCON GmbH
>
> Tiestestraße 16-18
> D-30171 Hannover
>
> _______________________________________________
> Mapbender_users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/mapbender_users
>
>  
Thank you for the help.

I will solve it in the next days I think....
_______________________________________________
Mapbender_users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapbender_users
Daniel Grum

Re: Create points with a geoserver WFS-T

Reply Threaded More More options
Print post
Permalink
In reply to this post by Sebastian Krohn-Grimberghe
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
> [hidden email]
> 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
_______________________________________________
Mapbender_users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapbender_users