csvsql SQLite --insert causes ID to change

المشرف العام

Administrator
طاقم الإدارة
I have a question that stems from a solution provided in this Question:

Join a CSV file to shapefile using gdal/ogr?

I've been using this to do joins successfully but for some reason, I have a field called geoid which is an 11 digit Census Tract ID. However, when I insert the csv into the db it changes the geoid from something like

36047101800to:

1687363432And is read in QGIS when I import that table as an Integer.

csvsql --db sqlite:///myjoindb.db --insert myjoincsv.csv I've tried to set the field length longer: http://csvkit.readthedocs.org/en/latest/scripts/csvsql.html

csvsql --db sqlite:///myjoindb.db --insert myjoincsv.csv -z 30But this doesn't work.

Is there some better way to do this so I don't lose the ID. What's crazy is when I go to do the join

ogr2ogr -f "ESRI Shapefile" -sql "SELECT csv.*, shp.* FROM myjoinshp shp INNER JOIN myjoincsv csv ON csv.geoid = shp.geoid" joined_output.shp myjoindb.dbIt works, but only the incorrect geoid carries over.



أكثر...
 
أعلى