Hi Deen,
yes, it is normal behavior. There is a WFS 1.1 only option (not available
in WFS 1.0, and then removed in WFS 2.0)
that allows to force the server to use the specified ids.
You should be able to add idgen='UseExisting' as an attribute in your
insert element, and if the backend
is a database (can't remember if there are extra conditions), it should
preserve the key your specified.
E.g.:
<?xml version="1.0"?>
<wfs:Transaction xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="
http://www.opengis.net/gml" xmlns:gs="http://geoserver.org" service="WFS"
version="1.1.0">
<wfs:Insert idgen="UseExisting">
<gs:bar gml:id="bar.1234">
<gs:name>acme</gs:name>
</gs:bar>
</wfs:Insert>
</wfs:Transaction>
Mind, you might have to follow the GeoServer convention of using
"typename"."dbKey" on your keys.
Hope that helps
Cheers
Andrea
On Thu, Mar 30, 2017 at 12:52 PM, Deen <kensong...@gmail.com> wrote:
> Hello all,
>
> Recently I am playing a lot with GeoServer WFS-T and try to understand it.
> What I want to achieve is simple, namely inserting multiple features to a
> PostGIS table. However, today I found out that the insertion of features is
> not in order, Here is a sample XML request I sent:
>
> <wfs:Transaction xmlns:fct="http://www.edf.curtis.net/fct"
> xmlns:gml="http://www.opengis.net/gml"
> xmlns:ogc="http://www.opengis.net/ogc"
> xmlns:wfs="http://www.opengis.net/wfs"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" service="WFS"
> version="1.1.0" xsi:schemaLocation="http://www.opengis.net/wfs
> http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
> <wfs:Insert>
> <fct:heat_point gml:id="986684c8-f1fa-438a-8f28-abb7d6c87ae0">
> <fct:label>label_1</fct:label>
> <fct:id>1</fct:id>
> <fct:geom>
> <gml:Point srsDimension="3"
> srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
> <gml:pos>6.731851120607754 35.005625827160316
> 6.731851120607754</gml:pos>
> </gml:Point>
> </fct:geom>
> </fct:heat_point>
> <fct:heat_point gml:id="cdd0af0b-d979-4280-b710-3ef70dfff3d3">
> <fct:label>label_2</fct:label>
> <fct:id>2</fct:id>
> <fct:geom>
> <gml:Point srsDimension="3"
> srsName="http://www.opengis.net/gml/srs/epsg.xml#4326">
> <gml:pos>1.119891889721274 5.823437826550625
> 1.119891889721274</gml:pos>
> </gml:Point>
> </fct:geom>
> </fct:heat_point>
> </wfs:Insert>
> </wfs:Transaction>
>
> After the request is sent, 2 features are inserted to the table called
> "heat_point". However, when I check out the table, the second feature with
> the ID 2 is firstly inserted instead of the one with ID 1. Is that a
> normal
> behaviour of GeoServer WFS-T
> or am I missing something important? Besides, it seems that GeoServer
> automatically generates an ID for the public key column, which means, the
> insertion ignores my id. Is that also a normal behaviour?
>
> Best Regards
> Deen
>
>
>
>
>
> --
> View this message in context: http://osgeo-org.1560.x6.
> nabble.com/Inserting-features-not-in-order-with-WFS-T-tp5314942.html
> Sent from the GeoServer - User mailing list archive at Nabble.com.
>
> ------------------------------------------------------------
> ------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Geoserver-users mailing list
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
--
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it
*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*
Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.
The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.
-------------------------------------------------------
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users