0

I'm having an issue similar to https://groups.google.com/forum/#!msg/django-users/I-YH28xg0po/59ZJawSlTVkJ in which when I upload data into my database via LayerMapping import utility, it is truncating the float fields all the way down to integer values. I have not found a solution anywhere.

I'm loading data from a geodatabase (.gdb file) with latitude and longitude values.

My code is on another network and I am unable to post it here, but I am essentially doing exactly what is outlined in step 3 here:

from django.contrib.gis.utils import LayerMapping
from geoapp.models import TestGeo
mapping = {'name' : 'str', # The 'name' model field maps to the 'str' layer field.
               'poly' : 'POLYGON', # For geometry fields use OGC name.
               } # The mapping is a dictionary
lm = LayerMapping(TestGeo, 'test_poly.shp', mapping)
lm.save(verbose=True) # Save the layermap, imports the data.

I've done this numerous times with the exact same code and same file format, and never run into issues. If this is a known issue I was unable to locate it.

brock
  • 365
  • 1
  • 3
  • 11

0 Answers0