0

When uploading CSV files to CartoDB through their web interface, all columns default to string as their data type, despite the CSV file containing a number of number-only columns. An example row is

1400000US55025000100,55025000100,"Census Tract 1, Dane County, Wisconsin",1401,118,1070,128,903,136,167,82,131,62,36,34,0,9,179,74,179,74,0,9,0,9,0,9,0,9,36,31,35,28,6,11,75,45

I know I can change the data type in the table editor, but when you have a large number of columns, this becomes very tedious. According to their documentation, CartoDB should automatically assigns the right data type. Any advice on how to make this work?

1 Answer 1

0

CSV does not have the concept of data types and that's why CartoDB tries to guess the type of the column. In any case CartoDB can not have a 100% success rate.

if you want to ensure your data types are kept use a format that allow data types (geojson, shp for example)

In this case I think it's a problem with ogr2ogr (the tool we use under the hood to process files). I reported this as a bug https://github.com/CartoDB/cartodb/issues/2600 so you can track it

1
  • Thanks! I'll follow your bug report on GitHub and for now just change the data types manually/with SQL.
    – vgXhc
    Commented Mar 5, 2015 at 16:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.