Hi Martin, > > recently I was converting dbf files [1] to PostgreSQL database. Some > fields are recognized as characters even they contain numeric types, > eg. > > ogrinfo OBCE.DBF OBCE -so > INFO: Open of `OBCE.DBF' > using driver `ESRI Shapefile' successful. > > Layer name: OBCE > ICOB: String (6.0) > > ICOB is ID of a city, OGR driver defines this attribute as character.
Yes, looking in the DBF header shows that it is declared as 'C' (character) field > I tried ADJUST_TYPE option, but it didn't make difference. ADJUST_TYPE in the shapedriver only does Real->Integer/Integer64 or Integer64- >Integer field types adjustment as documented > > Thanks in advance for any hint, Martin One workaround is to convert to CSV and use the AUTODETECT_TYPE=YES open option: ogr2ogr -f CSV OBCE.CSV OBCE.DBF ogr2ogr -f PostgreSQL PG:xxxx OBCE.CSV -oo AUTODETECT_TYPE=YES Even -- Spatialys - Geospatial professional services http://www.spatialys.com _______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
