Skip to content

Doc: Add export-schema examples#14639

Open
geographika wants to merge 3 commits into
OSGeo:masterfrom
geographika:export-schema
Open

Doc: Add export-schema examples#14639
geographika wants to merge 3 commits into
OSGeo:masterfrom
geographika:export-schema

Conversation

@geographika
Copy link
Copy Markdown
Collaborator

@geographika geographika commented May 24, 2026

Adds some more examples to gdal vector export-schema.

There are issues when trying to save the output of the command to file using PowerShell, and then using the schema file with gdal vector create. I've documented some (not ideal) workarounds. Maybe it would be possible to have an optional --output-file so GDAL could write directly to a file. Writing directly to the command-line by default is very handy for quickly checking schemas though, so it would be good to leave that as the default.

I added an example of validating output against the schema, but it currently fails with:

  Best Match:
    $.layers[0]: Additional properties are not allowed ('fidColumnName' was unexpected)
  All Errors:
    $.layers[0]: Additional properties are not allowed

I updated the schema to allow for fidColumnName, but this should be reviewed.

Finally, in the pipeline example I was looking for an easy way to rename a field. I used the sql step, which works fine, but was wondering if I was missing an easier/more explicit way of doing this.

Preview at https://gdal--14639.org.readthedocs.build/en/14639/programs/gdal_vector_export_schema.html

@geographika geographika added documentation Issues and contributions to the documentation content funded through GSP Work funded through the GDAL Sponsorship Program labels May 24, 2026
@rouault
Copy link
Copy Markdown
Member

rouault commented May 24, 2026

Maybe it would be possible to have an optional --output-file

filed as #14640

@geographika geographika marked this pull request as draft May 26, 2026 07:15
@geographika
Copy link
Copy Markdown
Collaborator Author

Thanks @elpaso ! I'll get the latest version and test on Windows, and use this parameter in the example.

@elpaso
Copy link
Copy Markdown
Collaborator

elpaso commented May 26, 2026

Thanks @elpaso ! I'll get the latest version and test on Windows, and use this parameter in the example.

Thank you for checking this out, please let me know if you find any issues.

@geographika
Copy link
Copy Markdown
Collaborator Author

Tested on PowerShell versions 5.1 and 7.6.2 - all works fine.

There is Sphinx related issue. I added using the :option:--output option in the PR to link to the option above, however
Sphinx creates a link to option on a different page - https://gdal--14639.org.readthedocs.build/en/14639/programs/gdal_dataset_identify.html#cmdoption-o

This seems to be the case in a few places. I'll open a separate issue for this.

image

See https://gdal--14639.org.readthedocs.build/en/14639/programs/gdal_vector_export_schema.html#programs/gdal_vector_export_schema-2

@geographika geographika marked this pull request as ready for review May 27, 2026 13:24
@geographika
Copy link
Copy Markdown
Collaborator Author

Option link fixed (as discussed in #14670). Ready for review from my side.
The main item to check is the fidColumnName fix in the schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Issues and contributions to the documentation content funded through GSP Work funded through the GDAL Sponsorship Program

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants