I am trying to import a shapefile into a Postgres database using django. When importing problems arise: the data in the cells are shifted, the cell text can break in the middle and partially climb into the next cell. Because of this, numeric fields begin to contain spaces and other string characters. I don’t know the reason for this behavior and ask for help. I will describe my actions step by step.
There is a valid DB table with geometry (point). It is defined in the django gis model and has fields of the types AutoField, CharField, FloatField, and PointField.
I export to shape using the shapefile.py library, the export is successful, the layer opens in ArcMap 10.1, the data looks like it should.
Next, I edit the data in some cell manually in ArcMap — either in the attribute table or move the point. When I press the 'Save Edits' button for an unknown reason (I suspect that this is the cause of import errors), spaces are added to all cells and the cells begin to look like with center alignment. But the data remains in the right cells.
When importing using the same shapefile.py library, an error occurs on the 13th line: Значение '1500 5.01400' должно быть числом с плавающей запятой. This value is in a Double cell, and in the ArcGIS table it is '50 .14 '.
During the import, I output the data of each cell to the console, and starting from the 10th record I see the data offset, as described at the beginning of the topic. By the 13th row, the offset for the first time affects a Double cell, which leads to an error. The data in the cells are all the same, similar. I do not see the reason why they can voluntarily climb into other cells. And I don’t see why gaps are added to the cells when editing attributes in ArcMap.
Traceback: File "C:\imp_shp\venv\lib\site-packages\django\core\handlers\base.py" in get_response 132. response = wrapped_callback(request, *callback_args, **callback_kwargs) File "C:\imp_shp\import_data\views.py" in to_import 80. for item in shp_deserializer(f, jsonimport): File "C:\imp_shp\import_data\imp_shp.py" in Deserializer 175. for obj in PythonDeserializer(object_list, **options): File "C:\imp_shp\venv\lib\site-packages\django\core\serializers\python.py" in Deserializer 161. data[field.name] = field.to_python(field_value) File "C:\imp_shp\venv\lib\site-packages\django\db\models\fields\__init__.py" in to_python 1817. params={'value': value}, 