[TinyOWS-users] Fids/GML:ids missing if the table has noprimary key

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Mon May 16 04:53:17 EST 2011


Olivier Courtin wrote: 
> 
> On May 16, 2011, at 9:46 AM, Rahkonen Jukka wrote:
> 
> Hi Jukka,
> 
> > I forgot to create primary keys into my OSM tables after 
> update and I
> > noticed that GML from TinyOWS comes now without fids or 
> gml:ids. Is  
> > this
> > a planned behaviour?
> 
> 
> Humm when you said 'now', you mean it wasn't always the case ?

This has to do with my data and not with TinyOWS. I meant "Now when I
forgot to create PK". Before the update I did have PK.

> 'Normal' behaviour is to expose PK, only on demand (expose_pk  
> parameter).
> But what to expose if no PK available ?

Well, Geoserver is generating some random fid in that case, like 
<gml:featureMember>
    <topp:Vakken fid="fid-20a01e80_11c2d38a583_37bc">

I could not find easily how the Geoserver fid generator works. Anyway I
do not believe those fids are stable enough for deletes or updates.
However, they are usable for some strict WFS clients which are checking
both the existence of fid and that they are unique in the result set.
With missing fids or double fids they can refure parsing the result set.

I can see that Geoserver folks were considering to utilise oids with
PostGIS backend but I suppose that solution is not usable any more
because oids are not compulsory.
http://jira.codehaus.org/browse/GEOS-186

This is one more pecularity with the OpenStreetMap data, osm_id is not
necessarily unique but I must create a new serial column for PK. 
Right thing to do is naturally to have a primary key in tables.

Sorry about a stupid question but I am a beginner with TinyOWS. Can I
publish PostGIS views through TinyOWS and if yes, then where are  the
fids taken?


-Jukka Rahkonen-




More information about the TinyOWS-users mailing list