[GRASS-dev] [GRASS GIS] #3407: v.in.ogr fails to import ESRI Shapefile with empty attribute table cells
GRASS GIS
trac at osgeo.org
Wed Aug 23 10:28:25 PDT 2017
#3407: v.in.ogr fails to import ESRI Shapefile with empty attribute table cells
----------------------+-------------------------
Reporter: mikatt | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone:
Component: Default | Version: 7.2.1
Resolution: | Keywords:
CPU: x86-64 | Platform: Linux
----------------------+-------------------------
Comment (by mmetz):
Replying to [comment:2 rouault]:
> > This is a GDAL/OGR issue.
>
> Actually it is a feature / per design. See
https://svn.osgeo.org/gdal/branches/2.2/gdal/MIGRATION_GUIDE.TXT about RFC
67 : https://trac.osgeo.org/gdal/wiki/rfc67_nullfieldvalues
>
> > v.in.ogr has been fixed in r71431,2 (trunk, relbr72) to account for
the new behaviour of GDAL 2.2, supporting older versions of GDAL.
>
> The fix is not ideal as it considers an empty string as NULL.
v.in.ogr translates attributes from OGR to the GRASS default database
driver, and (at least for sqlite), empty strings are not allowed, but need
to be replaced with something else. Therefore I decided to set empty
strings to "NULL". Testing the imported vector with v.db.select yields the
expected result, i.e. an empty field as in the original csv file.
Do you have another suggestion about how to replace an empty string?
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3407#comment:3>
GRASS GIS <https://grass.osgeo.org>
More information about the grass-dev
mailing list