docs: def addfeature(self, geometry, fields=None):
          """
          add a feature to the vector object from a geometry
          
          Parameters
          ----------
          geometry: :osgeo:class:`ogr.Geometry`
              the geometry to add as a feature
          fields: dict or None
              the field names and values to assign to the new feature
  
          Returns
          -------
          
          """
          
          feature = ogr.Feature(self.layerdef)
          feature.SetGeometry(geometry)
          
          if fields is not None:
              for fieldname, value in fields.items():
                  if fieldname not in self.fieldnames:
                      raise IOError('field "{}" is missing'.format(fieldname))
                  try:
                      feature.SetField(fieldname, value)
                  except NotImplementedError as e:
                      fieldindex = self.fieldnames.index(fieldname)
                      fieldtype = feature.GetFieldDefnRef(fieldindex).GetTypeName()
                      message = str(e) + '\ntrying to set field {} (type {}) to value {} (type {})'
                      message = message.format(fieldname, fieldtype, value, type(value))
                      raise(NotImplementedError(message))
          
          self.layer.CreateFeature(feature)
          feature = None
          self.init_features()