Hi Alex, I'm having exactly the same problem. The server responds OK, but no INSERT other than the SERIAL (INTEGER) fid. UPDATE & DELETE are perfectly working. I like the simple set-up of TinyOWS very much, and I don't want to change another server @all. I'm still struggling to fix it. Let's join hands, and share our ideas ab this.<br>
<br>cheers!!!<br><br><div class="gmail_quote">On Thu, Dec 17, 2009 at 6:00 PM, <span dir="ltr"><<a href="mailto:tinyows-users-request@lists.maptools.org">tinyows-users-request@lists.maptools.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Send TinyOWS-users mailing list submissions to<br>
<a href="mailto:tinyows-users@lists.maptools.org">tinyows-users@lists.maptools.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="http://lists.maptools.org/mailman/listinfo/tinyows-users" target="_blank">http://lists.maptools.org/mailman/listinfo/tinyows-users</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:tinyows-users-request@lists.maptools.org">tinyows-users-request@lists.maptools.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:tinyows-users-owner@lists.maptools.org">tinyows-users-owner@lists.maptools.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of TinyOWS-users digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: INSERT without geometry (Haftish 21)<br>
2. Re: INSERT without geometry (Olivier Courtin)<br>
3. Re: INSERT without geometry (Haftish 21)<br>
4. INSERT is not working (Alexander Sch?fer)<br>
5. Re: INSERT is not working (Olivier Courtin)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Wed, 16 Dec 2009 18:32:54 +0100<br>
From: Haftish 21 <<a href="mailto:haftish21@gmail.com">haftish21@gmail.com</a>><br>
Subject: Re: [TinyOWS-users] INSERT without geometry<br>
To: Olivier Courtin <<a href="mailto:olivier.courtin@gmail.com">olivier.courtin@gmail.com</a>><br>
Cc: <a href="mailto:tinyows-users@lists.maptools.org">tinyows-users@lists.maptools.org</a><br>
Message-ID:<br>
<<a href="mailto:52cf5e870912160932l78b415a4l83aad7565817789d@mail.gmail.com">52cf5e870912160932l78b415a4l83aad7565817789d@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
It seems the problem is with the feature id TinyOWS is creating (fid), my<br>
database table has five columns (geometry column + 4 attributes). the fid is<br>
going to the first column of my table by default. Do I have to get one<br>
column ready for fid or what?<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://lists.maptools.org/pipermail/tinyows-users/attachments/20091216/b10088a2/attachment.html" target="_blank">http://lists.maptools.org/pipermail/tinyows-users/attachments/20091216/b10088a2/attachment.html</a><br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Wed, 16 Dec 2009 20:47:54 +0100<br>
From: Olivier Courtin <<a href="mailto:olivier.courtin@gmail.com">olivier.courtin@gmail.com</a>><br>
Subject: Re: [TinyOWS-users] INSERT without geometry<br>
To: Haftish 21 <<a href="mailto:haftish21@gmail.com">haftish21@gmail.com</a>><br>
Cc: <a href="mailto:tinyows-users@lists.maptools.org">tinyows-users@lists.maptools.org</a><br>
Message-ID: <<a href="mailto:FA06AFD3-007C-4A0A-BF23-20EE11D3EB15@gmail.com">FA06AFD3-007C-4A0A-BF23-20EE11D3EB15@gmail.com</a>><br>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes<br>
<br>
<br>
On Dec 16, 2009, at 6:32 PM, Haftish 21 wrote:<br>
<br>
><br>
> It seems the problem is with the feature id TinyOWS is creating<br>
> (fid), my database table has five columns (geometry column + 4<br>
> attributes). the fid is going to the first column of my table by<br>
> default. Do I have to get one column ready for fid or what?<br>
<br>
<br>
Yes there's two conditions to make transactional WFS works on a<br>
PostGIS table:<br>
<br>
1) Having a geometry column (with a correct entry in<br>
geometry_columns table)<br>
2) Having a Primary Key column defined for the table (as serial or<br>
int type)<br>
<br>
<br>
--<br>
Olivier<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Wed, 16 Dec 2009 21:51:52 +0100<br>
From: Haftish 21 <<a href="mailto:haftish21@gmail.com">haftish21@gmail.com</a>><br>
Subject: Re: [TinyOWS-users] INSERT without geometry<br>
To: Olivier Courtin <<a href="mailto:olivier.courtin@gmail.com">olivier.courtin@gmail.com</a>><br>
Cc: <a href="mailto:tinyows-users@lists.maptools.org">tinyows-users@lists.maptools.org</a><br>
Message-ID:<br>
<<a href="mailto:52cf5e870912161251l69004015nfe1a65d1fec9e40b@mail.gmail.com">52cf5e870912161251l69004015nfe1a65d1fec9e40b@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
yeha!!<br>
For my five columns inside my table I have a form which requires three<br>
entries, expecting TinyOWS will take care of the PK and the geometry<br>
columns. I've also mapped correctly the form entries with their<br>
corresponding table attributes.<br>
<br>
However, it seems that I'm not the only one who encountered this problem. I<br>
read some similar questions raised on OL & TinyOWS ML. It would've been nice<br>
had these guys share how they solved their problem. I think I should be<br>
patient and wait for the new version.<br>
<br>
Cheers!!!<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: <a href="http://lists.maptools.org/pipermail/tinyows-users/attachments/20091216/f510ffd9/attachment-0001.htm" target="_blank">http://lists.maptools.org/pipermail/tinyows-users/attachments/20091216/f510ffd9/attachment-0001.htm</a><br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Thu, 17 Dec 2009 09:34:26 +0100<br>
From: Alexander Sch?fer <<a href="mailto:alexander.schaefer@intevation.de">alexander.schaefer@intevation.de</a>><br>
Subject: [TinyOWS-users] INSERT is not working<br>
To: <a href="mailto:tinyows-users@lists.maptools.org">tinyows-users@lists.maptools.org</a><br>
Message-ID: <<a href="mailto:200912170934.26759.alexander.schaefer@intevation.de">200912170934.26759.alexander.schaefer@intevation.de</a>><br>
Content-Type: text/plain; charset="iso-8859-1"<br>
<br>
Hello,<br>
<br>
I use tinyows 0.7.0/SVN Version (Revision 185) as a WFS Server with OpenLayers<br>
2.8. The update and delete feature works fine. But it is not possible for me<br>
to save newly drawn features.<br>
If I draw a polygon and save it, the request is successfully but only the id<br>
(serial PK) stored in the database and neither the geometry nor its<br>
attributes. If i reload the page all newly drawn features are gone.<br>
<br>
The only way for me to work around this is to use the update function:<br>
- Draw a new feature, save it,<br>
- update the feature and than save it again.<br>
After this the geometry with all attributes is stored. ?<br>
<br>
I tried some changes to solve the problem but nothing works:<br>
- Used WFS Version 1.1.0 and 1.0.0<br>
- Created new table with POLYGON, LINE or POINT geometrycolumn and<br>
? draw/saved corresponding features<br>
- Copied the successfully postrequest from the tinyows example<br>
? <a href="http://dev4.mapgears.com/bdga/bdgaWFS-T.html" target="_blank">http://dev4.mapgears.com/bdga/bdgaWFS-T.html</a>, fit it, and send it via<br>
? curl to my tinyows server, e.g. "curl xyz"<br>
<br>
My Tinyows and OpenLayers Configuration and Requests<br>
<br>
Tinyows config.xml<br>
<br>
<tinyows online_resource="http://*******/cgi-bin/tinyows"<br>
schema_dir="/usr/local/tinyows/schema/"<br>
log="/tmp/tinyows.log"<br>
><br>
<br>
<pg host="**********" user="postgres" password="********"<br>
dbname="tinyows_demo<br>
" port="5432"/><br>
<br>
<metadata name=""<br>
title="TinyOWS Server - Demo Service"/><br>
<br>
<contact name="TinyOWS Server"<br>
site="<a href="http://www.tinyows.org/" target="_blank">http://www.tinyows.org/</a>"<br>
email="<a href="mailto:tinyows-users@lists.maptools.org">tinyows-users@lists.maptools.org</a>" /><br>
<br>
<layer retrievable="1"<br>
prefix="tows"<br>
server="http://*******/"<br>
name="world"<br>
title="World Administrative Boundaries"/><br>
<br>
<layer retrievable="1"<br>
writeable="1"<br>
prefix="tows"<br>
server="http://**********/"<br>
name="france_linie"<br>
title="French Administrative Sub Boundaries (IGN - GeoFLA<br>
Departements)"/><br>
</tinyows><br>
_____________________________________________________________<br>
<br>
OpenLayers Configuraion:<br>
<br>
var saveStrategy = new OpenLayers.Strategy.Save();<br>
<br>
var wfs = new OpenLayers.Layer.Vector("France", {<br>
strategies: [new OpenLayers.Strategy.BBOX(), saveStrategy],<br>
protocol: new OpenLayers.Protocol.WFS({<br>
version: "1.0.0",<br>
url: "http://********/cgi-bin/tinyows",<br>
featureType: "france_linie",<br>
featureNS: "http://*******/tows",<br>
geometryName: "the_geom",<br>
schema: "http://******/cgi-bin/tinyows?service=WFS&versio<br>
n=1.0.0&request=DescribeFeatureType&TypeName=france_linie",<br>
})<br>
<br>
});<br>
--------------------------------------------------------------------------------------------<br>
<br>
onclick to save function from openlayers example:<br>
<br>
<a href="http://openlayers.org/dev/examples/wfs-protocol-transactions.html" target="_blank">http://openlayers.org/dev/examples/wfs-protocol-transactions.html</a><br>
<br>
var DeleteFeature = OpenLayers.Class(OpenLayers.Control, {<br>
initialize: function(layer, options) {<br>
OpenLayers.Control.prototype.initialize.apply(this,<br>
[options]);<br>
this.layer = layer;<br>
this.handler = new OpenLayers.Handler.Feature(<br>
this, layer, {click: this.clickFeature}<br>
);<br>
},<br>
clickFeature: function(feature) {<br>
// if feature doesn't have a fid, destroy it<br>
if(feature.fid == undefined) {<br>
this.layer.destroyFeatures([feature]);<br>
} else {<br>
feature.state = OpenLayers.State.DELETE;<br>
this.layer.events.triggerEvent("afterfeaturemodified",<br>
{feature: feature});<br>
feature.renderIntent = "select";<br>
this.layer.drawFeature(feature);<br>
}<br>
},<br>
setMap: function(map) {<br>
this.handler.setMap(map);<br>
OpenLayers.Control.prototype.setMap.apply(this, arguments);<br>
},<br>
CLASS_NAME: "OpenLayers.Control.DeleteFeature"<br>
});<br>
<br>
____________________________________________________________________<br>
<br>
Insert Request which is only store the id but not the attributes<br>
<br>
Geometry: Linestring<br>
<br>
WFS Version 1.0.0<br>
<br>
Insert Request<br>
<br>
POST:<br>
<br>
<?xml version="1.0"?><br>
<wfs:Transaction xmlns:wfs="<a href="http://www.opengis.net/wfs" target="_blank">http://www.opengis.net/wfs</a>"<br>
xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>" service="WFS"<br>
version="1.0.0" xsi:schemaLocation="<a href="http://www.opengis.net/wfs" target="_blank">http://www.opengis.net/wfs</a><br>
<a href="http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd" target="_blank">http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd</a><br>
http://*********/tows<br>
http://**********/cgi-bin/tinyows?service=WFS&amp;version=1.0.0&amp;request=DescribeFeatureType&amp;TypeName=france_linie2"><br>
<wfs:Insert><br>
<feature:france_linie2 xmlns:feature="http://******/tows"><br>
<feature:the_geom><br>
<gml:LineString xmlns:gml="<a href="http://www.opengis.net/gml" target="_blank">http://www.opengis.net/gml</a>"<br>
srsName="EPSG:27582"><br>
<gml:coordinates decimal="." cs=","<br>
ts=" ">671270.13157895,2322786.3289474<br>
685178.15789474,1942633.6096491</gml:coordinates><br>
</gml:LineString><br>
</feature:the_geom><br>
</feature:france_linie2><br>
</wfs:Insert><br>
</wfs:Transaction><br>
<br>
RESPONSE:<br>
<br>
<?xml version="1.0" encoding="UTF-8"?><br>
<wfs:WFS_TransactionResponse version="1.0.0"<br>
xmlns:wfs="<a href="http://www.opengis.net/wfs" target="_blank">http://www.opengis.net/wfs</a>"<br>
xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>"<br>
xmlns:ogc="<a href="http://www.opengis.net/ogc" target="_blank">http://www.opengis.net/ogc</a>"<br>
xsi:schemaLocation='<a href="http://www.opengis.net/wfs" target="_blank">http://www.opengis.net/wfs</a><br>
<a href="http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd" target="_blank">http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd</a>'><br>
<wfs:InsertResult handle="TinyOWS-WFS-default-handle"><ogc:FeatureId<br>
fid="france_linie2.80"/></wfs:InsertResult><br>
<wfs:TransactionResult><br>
<wfs:Status><wfs:SUCCESS/></wfs:Status><br>
</wfs:TransactionResult><br>
</wfs:WFS_TransactionResponse><br>
<br>
_____________________________________________________________<br>
<br>
Alex<br>
<br>
--<br>
Alexander Sch?fer | ++49-541-335083-0 | <a href="http://www.intevation.de/" target="_blank">http://www.intevation.de/</a> |<br>
Intevation GmbH, Neuer Graben 17, 49074 Osnabr?ck | AG Osnabr?ck, HR B 18998<br>
Gesch?ftsf?hrer: Frank Koormann, Bernhard Reiter, Dr. Jan-Oliver Wagner<br>
<br>
<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Thu, 17 Dec 2009 09:55:34 +0100<br>
From: Olivier Courtin <<a href="mailto:olivier.courtin@gmail.com">olivier.courtin@gmail.com</a>><br>
Subject: Re: [TinyOWS-users] INSERT is not working<br>
To: Alexander Sch?fer <<a href="mailto:alexander.schaefer@intevation.de">alexander.schaefer@intevation.de</a>><br>
Cc: <a href="mailto:tinyows-users@lists.maptools.org">tinyows-users@lists.maptools.org</a><br>
Message-ID: <<a href="mailto:680967CE-E66B-4C71-8698-C1BD707A79F9@gmail.com">680967CE-E66B-4C71-8698-C1BD707A79F9@gmail.com</a>><br>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes<br>
<br>
<br>
On Dec 17, 2009, at 9:34 AM, Alexander Sch?fer wrote:<br>
<br>
Hi Alex<br>
<br>
> I use tinyows 0.7.0/SVN Version (Revision 185) as a WFS Server with<br>
> OpenLayers<br>
> 2.8. The update and delete feature works fine. But it is not<br>
> possible for me<br>
> to save newly drawn features.<br>
<br>
Tks for your (very) detailled report !<br>
I just created a ticket related to this point<br>
<<a href="http://tinyows.org/trac/ticket/42" target="_blank">http://tinyows.org/trac/ticket/42</a>><br>
<br>
I also think that a short tutorial, to explain howto<br>
deploy TinyOWS with OpenLayers could be nice<br>
<br>
I will have time to look further on this point next week,<br>
<br>
--<br>
Olivier<br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
TinyOWS-users mailing list<br>
<a href="mailto:TinyOWS-users@lists.maptools.org">TinyOWS-users@lists.maptools.org</a><br>
<a href="http://lists.maptools.org/mailman/listinfo/tinyows-users" target="_blank">http://lists.maptools.org/mailman/listinfo/tinyows-users</a><br>
<br>
<br>
End of TinyOWS-users Digest, Vol 7, Issue 5<br>
*******************************************<br>
</blockquote></div><br><br clear="all"><br>-- <br><br>¯`'•.¸(¯`'•.¸*♥♥♥♥*¸.•'´¯)¸.•' ´¯)<br>♥(¯`'•.¸(¯`'•.¸*♥♥*¸.•'´¯)¸.•' ´¯)♥<br>♥♥(¯`'•.¸(¯`'•.¸**¸.•'´¯)¸.•'´ ¯)♥♥<br>----==--12hsitfaHaftish21--==----<br>
(_¸.•'´(_¸.•'´*♥♥♥♥*`'•.¸_)`'• .¸_)<br>♥(_¸.•'´(_¸.•'´*♥♥*`'•.¸_)`'•. ¸_)♥<br>♥♥(_¸.•'´(_¸.•'´**`'•.¸_)`'•.¸ _)♥♥<br>