girs.feat.layers.LayersWriter.__init__

LayersWriter.__init__(*args, **kwargs)

Instantiate a LayersWriter object

Example:

srs0 = get_srs(epsg=4326)
fields0 = [FieldDefinition("Name", ogr.OFTString), FieldDefinition("Area", ogr.OFTReal)]
fields1 = [FieldDefinition("Code", ogr.OFTInteger), FieldDefinition("Capital", ogr.OFTString)]
LayersWriter(None, [ogr.wkbPolygon, srs0, fields0], [ogr.wkbPoint, srs0, fields1])
LayersWriter('', [ogr.wkbPolygon, srs0, fields0], [ogr.wkbPoint, srs0, fields1])
LayersWriter(D:/tmp/mfile.shp, ['', ogr.wkbPolygon, srs0, fields0])
LayersWriter(D:/tmp/mfile.gml, ['park', ogr.wkbPolygon, srs0, fields0],
             ['area', ogr.wkbPoint, srs0, fields1], drivername='GML')
Parameters:
  • args

    layer parameters with at least name and geometry type. Any of the following lists is valid:

    • [name, geometry type]
    • [name, geometry type, spatial reference system]
    • [name, geometry type, spatial reference system, list of girs.feat.layers.FieldDefinition]
  • kwargs
    key source:(str) source name (e.g., file name with extension)
    key drivername:a short driver name (see FeatDrivers.get_driver_names()). E.g., ‘Memory’