Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Re: [udig-users] ID of FID

On Mon, Mar 17, 2008 at 5:06 PM, Jody Garnett <jgarnett@xxxxxxxxxxxxxxx> wrote:
>  > Hi, I'm taking this to the devel list, since I also need some clarification.
>  > Am I right in saying that the primary key column is taken as the FID field?
>  >
>  Depends which DataStore; you can also have multiple primary keys - for
>  details see the JDBCDataStore FidMapper class.

I wonder what in that case is done.

> > This, in my opinion brings to different behaviours.
>  > Imagine I have a postgis table with 4 fields, one of which is primary key.
>  > case 1: I load it into udig through the postgis connection. Then I
>  > export the layer to shapefile and what I gain is a file containing
>  > only 3 fields, since the original primary key field was transformed
>  > into FID and therefore distorting it, and also the FID is not
>  > exported.
>  >
>  > case 2: I export the shapefile through pgsql3shp. I get my nice
>  > shapefile with all 4 fields.
>  >
>  > Is this a known behaviour? Is this a proper behaviour?
>  >
>  It is up to you the developer what you want to do; some file based
>  datastore formats can store the feature id you provided (the property
>  datastore can for example); others like shapefile have a very simple
>  definition of primary key (ie row number).

Not sure here. As a developer in these "standard" things I want to
rely on the "standard" tools of the application and not fork some
stuff and then maintain a fork.

> > I have a strange feeling in knowing that I will lose a field in exporting a postgis layer through udig.
>  >
>  Please note that if you import the shapefile you exported as pgsql3shp
>  you will have 4 fields AND a primary key (so 5 bits of information).
>  If your table had an ID column that was not a primary key I think the
>  default behavior is to use the "oid" information for the row - which is
>  only stable for rows that have not been updated or something.

I agree about that, but anyway for the shapefiles the fid is never
stable, since every time I edit and save, the fid column is refreshed
and the original fid table is lost.
So in the case I export a shapefile from postgis, the primary key
column is changed from int to a string and every time I edit, the id
mapping is no more the same as the original. I'm just asking for
information.

>  I think you can set a Hint or configuration option to include keys as
>  readable attributes (up to you).

Again, I would not want to fork anything. Is this what you mean?

Ciao
Andrea


>  Jody
>  _______________________________________________
>  User-friendly Desktop Internet GIS (uDig)
>  http://udig.refractions.net
>  http://lists.refractions.net/mailman/listinfo/udig-devel
>


Back to the top