OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.79k stars 2.51k forks source link

ogr2ogr -resolveDomains switch not creating additional field using OpenFileGDB and GPKG #6185

Closed learning4life closed 2 years ago

learning4life commented 2 years ago

Expected behavior and actual behavior.

Expected output CSV file header: RC,RC_resolved,UFI,UNI,FC,DSG,PC,CC1,...

Actual output CSV file header: RC,UFI,UNI,FC,DSG,PC,CC1,...

How to output the Code Description like "Russia/ Central Asia" from a FGDB with Coded Value to a CSV-file?

Steps to reproduce the problem.

When using the resolveDomains switch on a FGDB with a attribute domain:

docker run --rm -v /home:/home osgeo/gdal:ubuntu-full-latest ogr2ogr \
  -f CSV -resolveDomains \
  -sql "SELECT * FROM GeoNamesFeature WHERE OBJECTID='1'" \
  ~/sw/docker-containers/DockerPythonGDAL/test_data/test_csv.csv \
  ~/sw/docker-containers/DockerPostgreSqlPostGIS/test_data/NGA_Geonames.gdb \
  -lco SEPARATOR=COMMA \
  --debug ON

I tested the domain using ogrinfo:

docker run --rm -v /home:/home osgeo/gdal:ubuntu-full-latest \
  ogrinfo -so -fielddomain RC_List ~/sw/docker-containers/DockerPostgreSqlPostGIS/test_data/NGA_Geonames.gdb GeoNamesFeature \
  --debug ON

Based on input from https://web.libera.chat/#gdal I also tested the GPKG with the same result as shown here:

https://bpa.st/UN3A

Operating system

Official ubuntu-full-docker image

GDAL version and provenance

3.3.3, 3.5.1 and latest docker build

learning4life commented 2 years ago

Thanks for fixing this issue!