[gdal-dev] FileGDB -preserve_fid

Jeremy Palmer JPalmer at linz.govt.nz
Wed Dec 12 17:24:40 PST 2012


Hi,

I'm trying to copy data from PostgreSQL to FileGDB. My PostgreSQL table has a primary key column and ogr indenties it as the FID e.g

CREATE TABLE public.test_fileGDB (
    id INTEGER PRIMARY KEY,
    data1 TEXT,
    shape GEOMETRY(POINT, 4167)
);

INSERT INTO public.test_fileGDB (id, data1, shape) VALUES (100, 'FileGDB test record', ST_SetSrid(ST_MakePoint(160, -40), 4167));

ogrinfo PG:'dbname=my_db' public.test_filegdb
INFO: Open of `PG:dbname=my_db'
      using driver `PostgreSQL' successful.

Layer name: test_filegdb
Geometry: Point
Feature Count: 1
Extent: (160.000000, -40.000000) - (160.000000, -40.000000)
Layer SRS WKT:
GEOGCS["NZGD2000",
    DATUM["New_Zealand_Geodetic_Datum_2000",
        SPHEROID["GRS 1980",6378137,298.257222101,
            AUTHORITY["EPSG","7019"]],
        TOWGS84[0,0,0,0,0,0,0],
        AUTHORITY["EPSG","6167"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4167"]]
FID Column = id
Geometry Column = shape
data1: String (0.0)

OGRFeature(test_filegdb):100
  data1 (String) = FileGDB test record
  POINT (160 -40)

However when I try to copy it into a FileGDB the FID data is lost:

ogr2ogr -preserve_fid --config FGDB_BULK_LOAD YES -f FileGDB test.gdb PG:'dbname=my_db' public.test_filegdb -nln test_filegdb

ogrinfo test.gdb test_filegdb
INFO: Open of `test.gdb'
      using driver `FileGDB' successful.

Layer name: test_filegdb
Geometry: Point
Feature Count: 1
Extent: (160.000000, -40.000000) - (160.000000, -40.000000)
Layer SRS WKT:
GEOGCS["NZGD2000",
    DATUM["New_Zealand_Geodetic_Datum_2000",
        SPHEROID["GRS 1980",6378137,298.257222101,
            AUTHORITY["EPSG","7019"]],
        TOWGS84[0,0,0,0,0,0,0],
        AUTHORITY["EPSG","6167"]],
    PRIMEM["Greenwich",0,
        AUTHORITY["EPSG","8901"]],
    UNIT["degree",0.0174532925199433,
        AUTHORITY["EPSG","9122"]],
    AUTHORITY["EPSG","4167"]]
FID Column = OBJECTID
Geometry Column = SHAPE
data1: String (0.0)
OGRFeature(test_filegdb):1
  data1 (String) = FileGDB test record
  POINT (160 -40)


Is this a bug or did I use the wrong ogr2ogr options?

Cheers,
Jeremy


This message contains information, which is confidential and may be subject to legal privilege. If you are not the intended recipient, you must not peruse, use, disseminate, distribute or copy this message. If you have received this message in error, please notify us immediately (Phone 0800 665 463 or info at linz.govt.nz) and destroy the original message. LINZ accepts no responsibility for changes to this email, or for any attachments, after its transmission from LINZ. Thank You.


More information about the gdal-dev mailing list