It would be convenient to have a class method that saves the state of a GDALVector object in GDALG format. For example, if a GDALVector object has been created as a SQL layer, and/or has an attribute / spatial filter applied, then the state of the layer could be saved with a call like lyr$serialize(json_file).
This can already be done by passing the GDALVector object to gdal_run() for a CLI command like "vector filter", "vector select", "vector sql" etc., but would be more convenient than having to construct the CLI command manually for this case.
It could also provide an easy way to export the state of the object as a stand-alone vector dataset since something like lyr$serialize() |> ogr2ogr() should be possible.
It would be convenient to have a class method that saves the state of a
GDALVectorobject in GDALG format. For example, if aGDALVectorobject has been created as a SQL layer, and/or has an attribute / spatial filter applied, then the state of the layer could be saved with a call likelyr$serialize(json_file).This can already be done by passing the
GDALVectorobject togdal_run()for a CLI command like "vector filter", "vector select", "vector sql" etc., but would be more convenient than having to construct the CLI command manually for this case.It could also provide an easy way to export the state of the object as a stand-alone vector dataset since something like
lyr$serialize() |> ogr2ogr()should be possible.