[gdal-dev] sqlite dialect: OpenFileGDB and FID Column selection

Rahkonen Jukka jukka.rahkonen at maanmittauslaitos.fi
Fri Sep 1 01:28:28 PDT 2023


Hi,

Feature IDs are confusing. Some formats require FID, some do not directly support FID at all (shapefile). Sometimes FID must be an integer, sometimes it is always a string (gml_id), and sometimes it is either or (GeoJSON). Ogr2ogr has 3 parameters for FIDs, and vector drivers add their own options. Primary key acts usually as a FID, but can a composite PK be a FID? FIDs are really meant for the machines and GDAL usually hides FIDs, but they may be meaningful also for humans as well and sometimes users would like to expose them as a normal attribute with tricks like SELECT *, fid_field as my_fid.

I agree that something like a dedicated wiki page about FIDs in GDAL would be nice to have. Maybe documenting how OBJECTID in FileGDB behaves with different SQL dialects is a rather small detail to be documented separately.

-Jukka Rahkonen-

Lähettäjä: andy <aborruso at gmail.com>
Lähetetty: perjantai 1. syyskuuta 2023 9.54
Vastaanottaja: Rahkonen Jukka <jukka.rahkonen at maanmittauslaitos.fi>
Kopio: gdal dev <gdal-dev at lists.osgeo.org>
Aihe: Re: [gdal-dev] sqlite dialect: OpenFileGDB and FID Column selection

Hi Jukka,

On Fri, 1 Sept 2023 at 07:42, Rahkonen Jukka <jukka.rahkonen at maanmittauslaitos.fi<mailto:jukka.rahkonen at maanmittauslaitos.fi>> wrote:
When the SQLite dialect is used, a temporary SQLite database is created. OBJECTID is a feature identifier (FID) and I guess that the FID gets converted into a primary key with the SQLite defaults. So maybe you can find the OBJECTID from ROWID.

it works, thank you very much.

Maybe a little related note in the documentation would do. What do you think about it?

Thank you again

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230901/35f52f47/attachment-0001.htm>


More information about the gdal-dev mailing list