Skip to content

Add GDALVector::serialize() to save the state of a GDALVector object in a .gdalg.json file #896

@ctoney

Description

@ctoney

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions