I have a file places.csv with the following contents:
name,lat,lon,type,population Aalfang,48.8393882,15.0675236,village,410 Abern,48.0556773,13.1533381,village,203 Abersee,47.7266536,13.4169871,village,320 Abetzberg,48.0839721,14.76567,village,260 Abfaltersbach,46.7564042,12.5298515,village,616 Absam,47.2965003,11.5051409,village,6543 Abschlag,48.6241667,14.8638577,village,78 Absdorf,48.4001618,15.9803689,village,459 and an accompanying file places.csvt to specify the column types:
"String","CoordY","CoordX","String","Integer" I am using ogr2ogr to filter the CSV file for entries in a spatial region with this command:
ogr2ogr -spat 12.0 47.0 15.0 49.0 -a_srs EPSG:4326 -oo X_POSSIBLE_NAMES=lon -oo Y_POSSIBLE_NAMES=lat places_filtered.csv places.csv In the resulting CSV file, all values in the column population are represented as Strings with double quotes:
name,lat,lon,type,population Abern,48.0556773,13.1533381,village,"203" Abersee,47.7266536,13.4169871,village,"320" Abetzberg,48.0839721,14.76567,village,"260" Abschlag,48.6241667,14.8638577,village,"78" How can I get ogr2ogr to output unquoted integer values for the integer field?
I tried many options, but no success. I haven't found a way to specify field/column types explicitly, besides supplying the .csvt file with equal name as the input file. Also the -oo AUTODETECT_TYPE=YES option gives the same result.