I'm using the world borders common dataset from CartoDB, which I've then exported so I can grab the_geom column, which CartoDB gives me as a hex value. I'm taking this CSV and uploading it another database so I can have that hex value. But when I try to reimport that data with the hex data, either the file fails to upload or CartoDB is not able to interrupt the hex value. Any ideas why this would be happening?
-
Could you give us further details? Like the exported file you're using, or the error id you're getting in the CartoDB Editor. In CSVs, geometries are stored in WKB, and they should be recognized by CartoDB. Did you change the column names of your exported file?– iriberriCommented Feb 5, 2015 at 11:37
-
This is the file I'm extracting out of the DB and attempting to import into CartoDB: dropbox.com/s/jrlfy2yut8ycd06/country-extract-test.csv?dl=0– DaversCommented Feb 5, 2015 at 16:16
-
We're not being able to reproduce the issue while exporting the World Borders table as CSV. Your file is creating the invalid_the_geom column. I've applied to it the function ST_MakeValid and it only returns valid geometries for some of the rows, the other ones are set as NULL, so it makes me think that the WKB could not be correct. Could you send us the URL to your CartoDB table from which you exported it? Did you manipulate the CSV afterwards?– iriberriCommented Feb 6, 2015 at 15:37
-
Here is the link. Only thing I have changed is the header name of the field into "the_geom"– DaversCommented Feb 12, 2015 at 17:45
Add a comment
|
1 Answer
It seems that some rows have an invalid WKB geometry in "invalid_the_geom" after exported. To sort out this, you could run an ugly trick like:
update country_extract_test set the_geom = invalid_the_geom where invalid_the_geom like '0106%'
which is avoiding those invalid_the_geoms that are null or start by "FF...". Unfortunately, I haven't been able to replicate an export with the corrupted geometries.