Hi,

I would recommend to alter table and make primary key as numerical with 
autoincrement and let Geoserver use it. It is the default configuration and it 
should be easy and reliable. Make another unique constraint to your current ID 
and your users must send unique values for that with inserts. If that solution 
does not please you, search for a similar thread from Geoserver user archives. 
Me and Andrea Aime were writing in that thread and it was not very long time 
ago.

-Jukka Rahkonen-
________________________________________
Lähettäjä: danielsan [[email protected]]
Lähetetty: 13. tammikuuta 2012 19:51
Vastaanottaja: [email protected]
Aihe: [Geoserver-users] Using WFS-T insert with a specified id instead of       
generated

Hello,

i have set a simple postgresdb table and loaded it into geoserver. The table
has a id column  of the type varchar primary key and i would like to insert
new feature with transactional insert.
I got it working sending and xml similar to this:

<wfs:Transaction service="WFS" version="1.0.0"
  xmlns....
  <wfs:Insert>
    <test:test_feature>
      <test:id>id.1</test:id>
      <ballade:the_geom>
        <gml:Point srsDimension="2" srsName="urn:x-ogc:def:crs:EPSG:4326">
                        <gml:coordinates xmlns:gml="http://www.opengis.net/gml";
decimal="." cs="," ts=" ">xx.xx,xx.xx</gml:coordinates>
                </gml:Point>
      </test:the_geom>
    </test:test_feature>
  </wfs:Insert>
</wfs:Transaction>

The problem is when inserting the new feature the id is always auto
generated  with a value like "fid-5e1837f9_134d7d07d6e_-7fed" even though i
specified it in the insert request. Is there a way of specifying your own id
value with the WFS-T insert, something like id.1?
The resulting fid is then would be something like test_feature.id.1.

I hope someone has some tipps, thank you for any help,
Daniel

--
View this message in context: 
http://osgeo-org.1803224.n2.nabble.com/Using-WFS-T-insert-with-a-specified-id-instead-of-generated-tp7184876p7184876.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to