[gdal-dev] How to extract field domains from a gdb

Even Rouault even.rouault at spatialys.com
Tue Jan 17 07:39:53 PST 2023


Hi,

I don't think we have a ready-made utility for that, so you'll have to 
write code using the field domain API: 
https://gdal.org/doxygen/classOGRCodedFieldDomain.html and 
https://gdal.org/doxygen/classGDALDataset.html#a64d001fa0fe53c6aa51e983ca14bad39

With GDAL master, it might also be easier to use the -json output of 
ogrinfo :

$ ogrinfo -json autotest/ogr/data/filegdb/Domains.gdb

[...}

   "domains":{
     "MedianType":{
       "description":"Road median types.",
       "type":"coded",
       "fieldType":"Integer",
       "fieldSubType":"Int16",
       "splitPolicy":"default value",
       "mergePolicy":"default value",
       "codedValues":{
         "0":"None",
         "1":"Cement"
       }
     },
     "RoadSurfaceType":{
       "description":"The road surface type",
       "type":"coded",
       "fieldType":"Integer",
       "splitPolicy":"default value",
       "mergePolicy":"default value",
       "codedValues":{
         "1":"Asphalt",
         "2":"Gravel",
         "3":"Oiled Sand",
         "4":"Dirt"
       }
     },
     "SpeedLimit":{
       "description":"The maximun speed of the road",
       "type":"range",
       "fieldType":"Integer",
       "fieldSubType":"Int16",
       "splitPolicy":"default value",
       "mergePolicy":"default value",
       "minValue":40,
       "minValueIncluded":true,
       "maxValue":100,
       "maxValueIncluded":true
     }
   },


I can be imagine that a "Save as" context menu entry in QGIS would be a 
cool enhancement.

Even


Le 17/01/2023 à 16:30, Totò Fiandaca a écrit :
> QGIS with gdal 3.6+ reads and writes gdb,
> how can I export field domains to dbf/csv tables?
>
> In the QGIS Browser I see the domains and I would like to export them 
> in tables with at least two fields: code, description
>
> -- 
> *Ing. Salvatore Fiandaca*
> *mobile*.:+39 327.493.8955
> *m*: *pigrecoinfinito at gmail.com <mailto:pigrecoinfinito at gmail.com>*
> *C.F*.: FNDSVT71E29Z103G
> *P.IVA*: 06597870820
> *membro QGIS Italia - http://qgis.it/*
> *socio GFOSS.it - *http://gfoss.it/
> *member OSGeo* - *https://www.osgeo.org/member/fiandaca/* 
> <https://www.osgeo.org/member/fiandaca/>
> *blog:** https://pigrecoinfinito.com/ <https://pigrecoinfinito.com/>
> FB: Co-admin - 
> https://www.facebook.com/qgis.it/**<https://www.facebook.com/qgis.it/> *
> *TW:<http://goog_95411464>**https://twitter.com/totofiandaca*
>
> 43°51'0.54"N  10°34'27.62"E - EPSG:4326
>
> “Se la conoscenza deve essere aperta a tutti,
> perchè mai limitarne l’accesso?”
> R. Stallman
>
> Questo documento, allegati inclusi, contiene informazioni di proprietà 
> di FIANDACA SALVATORE e deve essere utilizzato esclusivamente dal 
> destinatario in relazione alle finalità per le quali è stato ricevuto. 
> E' vietata qualsiasi forma di riproduzione o divulgazione senza 
> l'esplicito consenso di FIANDACA SALVATORE. Qualora fosse stato 
> ricevuto per errore si prega di informare tempestivamente il mittente 
> e distruggere la copia in proprio possesso.
>
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20230117/88682800/attachment.htm>


More information about the gdal-dev mailing list