[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 11:41:20 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 rouault):

 > Regarding export from GRASS to OGR, what happens if a field is not
 explicitly set or unset? Is it now unset or set, but NULL? Do we need to
 adjust v.out.ogr using `OGR_F_SetFieldNull()` and/or `OGR_F_UnsetField()`
 instead of not touching the field at all?

 By default and by definition, a field that is not set ... is unset :-)
 This is no different in GDAL 2.2 than in previous versions. So depending
 on drivers, they might react differently on writing if a field is unset or
 if it set to an empty string. For CSV and Shapefile, this will result in
 the same file. For GeoJSON, a unset field doesn't appear at all in the
 result, whereas an empty string is written as '"field" : "" '

 With GDAL 2.2, you can also set a field to NULL. The behaviour will depend
 on drivers. For CSV and Shapefile, NULL will be dealt as unset or empty
 string. For GeoJSON, it will be written as ' "field": null '.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3407#comment:6>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list