problem with fid after wfs-t Insert

View: New views
7 Messages — Rating Filter:   Alert me  

problem with fid after wfs-t Insert

by CB-15 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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" 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>
)

-------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Re: problem with fid after wfs-t Insert

by aaime :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

-------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Re: problem with fid after wfs-t Insert

by CB-15 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> 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@...
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Re: problem with fid after wfs-t Insert

by Justin Deoliveira-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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@...
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>
> !DSPAM:4007,47e7c028130782092453641!
>


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

-------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Re: problem with fid after wfs-t Insert

by GeoUser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

Re: problem with fid after wfs-t Insert

by Justin Deoliveira-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

-------------------------------------------------------------------------
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@...
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Re: problem with fid after wfs-t Insert

by GeoUser :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

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@openplans.org

-------------------------------------------------------------------------
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
LightInTheBox - Buy quality products at wholesale price