[gdal-dev] CSV driver does not understand allCountries.txt

Even Rouault even.rouault at spatialys.com
Fri Aug 28 02:35:29 PDT 2015


Le vendredi 28 août 2015 11:04:26, Jukka Rahkonen a écrit :
> Jukka Rahkonen <jukka.rahkonen <at> maanmittauslaitos.fi> writes:
> > Hi,
> > 
> > I have understood that CSV driver should automatically recognize the
> > allCountries.txt file from geonames.org. However, my GDAL 2.0 on Windows
> > does not find any fields from the file. What is the expected output of
> > 
> > ogrinfo -al -so -nocount -noextent allCountries.txt
> > 
> > For me it only
> > Geometry: None
> > Layer SRS WKT: (unknown)
> > [the first line of the allCountries.txt file]
> 
> By closer look it is not exactly that way. However, I guess that the
> structure of data is changed.
> http://download.geonames.org/export/dump/readme.txt is listing fields
> "name", "asciiname", "alternatenames" but the data sample that we have in
> autotest/ogr/data/allCountries.txt?rev=27748
> seems to have just one name field.

Hi Jukka,

The structure hasn't changed. In autotest, there is an empty field (so 2 
consecutive tab delimiters), which is OK
The issue is with the latest allCountries.txt files where the first line has 
both tab as field delimiters, and one field has a comma. The autodetection of 
the delimiter is then confused and pick up wrongly comma.

Fixed by https://trac.osgeo.org/gdal/ticket/6086

A workaround is to rename allCountries.txt to allCountries.tsv

Even

> 
> > -Jukka Rahkonen-
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list