[Geoserver-users] problem with fid after wfs-t Insert

Hello,

After sending a transactionrequest to a 1.6.1 GeoServer (default
installation), I get a response like this:
<InsertResult>
    <ogc:FeatureId fid="new0"/>
    <ogc:FeatureId fid="new1"/>
</InsertResult>

Why the bogus fid? How do I get the valid fid?

Thanks for any insight.

(Here's one Insert element in the request:
    <wfs:Insert">
        <tiger:tiger_roads xmlns:tiger="http://www.census.gov">
            <tiger:the_geom>
                <gml:MultiLineString
xmlns:gml="http://www.opengis.net/gml&quot; srsName="EPSG:4326">
                    <gml:lineStringMember>
                        <gml:LineString>
                            <gml:coordinates>-74.000069,40.735937
-73.999099,40.735868</gml:coordinates>
                        </gml:LineString>
                    </gml:lineStringMember>
                </gml:MultiLineString>
            </tiger:the_geom>
            <CFCC>Z99</CFCC>
            <NAME>East</NAME>
        </tiger:tiger_roads>
    </wfs:Insert>
)

CB ha scritto:

Hello,

After sending a transactionrequest to a 1.6.1 GeoServer (default
installation), I get a response like this:
<InsertResult>
    <ogc:FeatureId fid="new0"/>
    <ogc:FeatureId fid="new1"/>
</InsertResult>

Why the bogus fid? How do I get the valid fid?

Hum, bogus fids are usually generated when the backing datastore
does not have a good way to compute one... which datastore
are you using?
Should work fine with JDBC based datastores on tables
that do have a serial type primary key.

Cheers
Andrea

CB ha scritto:
> Hello,
>
> After sending a transactionrequest to a 1.6.1 GeoServer (default
> installation), I get a response like this:
> <InsertResult>
> <ogc:FeatureId fid="new0"/>
> <ogc:FeatureId fid="new1"/>
> </InsertResult>
>
> Why the bogus fid? How do I get the valid fid?

Hum, bogus fids are usually generated when the backing datastore
does not have a good way to compute one... which datastore
are you using?
Should work fine with JDBC based datastores on tables
that do have a serial type primary key.

No idea what the datastore is -- I installed GeoServer with, as far as
I know, all the default settings.
The table is one of the samples installed with GeoServer -- tiger_roads.

Sounds like we need a different datastore.
Thanks for the reply.

Yeah, that layer is actually just a shapefile, which does not do ID's with transactions properly. You should be able to load it into a PostGIS database, define a primary key, and then readd the layer to GeoServer. Then you will see better results.

-Justin

CB wrote:

CB ha scritto:

Hello,

After sending a transactionrequest to a 1.6.1 GeoServer (default
installation), I get a response like this:
<InsertResult>
    <ogc:FeatureId fid="new0"/>
    <ogc:FeatureId fid="new1"/>
</InsertResult>

Why the bogus fid? How do I get the valid fid?

Hum, bogus fids are usually generated when the backing datastore
does not have a good way to compute one... which datastore
are you using?
Should work fine with JDBC based datastores on tables
that do have a serial type primary key.

No idea what the datastore is -- I installed GeoServer with, as far as
I know, all the default settings.
The table is one of the samples installed with GeoServer -- tiger_roads.

Sounds like we need a different datastore.
Thanks for the reply.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

!DSPAM:4007,47e7c028130782092453641!

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

is it even possible to get a proper feature id after the insert operation
when using shapefiles?
--
View this message in context: http://www.nabble.com/problem-with-fid-after-wfs-t-Insert-tp16200193p18576739.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

I could be wrong (someone with better knowledge of the shapefile code will know for sure), but unfortunately not. This only works properly with a relational database.

GeoUser wrote:

is it even possible to get a proper feature id after the insert operation
when using shapefiles?

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

Ok, thanks anyway. I used the PostGIS instead. Works great :slight_smile:

Justin Deoliveira-4 wrote:

I could be wrong (someone with better knowledge of the shapefile code
will know for sure), but unfortunately not. This only works properly
with a relational database.

GeoUser wrote:

is it even possible to get a proper feature id after the insert operation
when using shapefiles?

--
Justin Deoliveira
The Open Planning Project
jdeolive@anonymised.com

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's
challenge
Build the coolest Linux based applications with Moblin SDK & win great
prizes
Grand prize is a trip for two to an Open Source event anywhere in the
world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
View this message in context: http://www.nabble.com/problem-with-fid-after-wfs-t-Insert-tp16200193p18642771.html
Sent from the GeoServer - User mailing list archive at Nabble.com.