Conversation
| field required by the filter is removed by ``select``, it will not be | ||
| available and the command will fail with: ``ERROR 1: "worldcity" not recognised as an available field.`` | ||
|
|
||
| If you want the output to contain spatial data, you must also include the geometry |
There was a problem hiding this comment.
Should we implement gdal vector select --fields worldcity --geometry as a frendlier alternative?
There was a problem hiding this comment.
It wasn't obvious to me that geometry would have to be explicitly added to the list, particularly in a pipeline.
I'd guess excluding geometry would be the rarer use-case? Would it make sense to always include the (first/default) geometry field and have an --exclude-geometry option? Maybe even just rely on the current select --exclude "_ogr_geometry_" approach (and I can add an example to the page).
There was a problem hiding this comment.
I'd not seen that discussion - so consider me one of the surprised users!
| geometry. If no geometry field is included, reprojection will | ||
| fail with: ``ERROR 1: reproject: Layer 'ne_110m_populated_places_simple' has no spatial reference system``. | ||
|
|
||
| Finally, ensure that there are **no spaces** between the field names in the |
There was a problem hiding this comment.
@rouault do we allow spaces in field names? If not, let's just trim them from the field names.
There was a problem hiding this comment.
yes spaces are generally valid for field names (unless a driver doesn't allow them)
There was a problem hiding this comment.
From vector select
Field names with spaces, commas or double-quote should be surrounded with a starting and ending double-quote character
Maybe any leading/trailing spaces should be trimmed?
I'm guessing it is more likely a user would try:
select --fields "field1, field2, field3"
Than if they actually have trailing spaces in their field names (e.g. "field2 " and "field3 "). In that case they'd need to use the quoting as suggested:
select --fields "field1, \"field2 \", \" field3 \""
There was a problem hiding this comment.
Maybe any leading/trailing spaces should be trimmed?
I'd rather not create special cases and stick to a predicatable, even if slightly annying, syntax
|
|
||
| .. only:: html | ||
|
|
||
| .. image:: ../../images/programs/gdal_pipeline_vector_example.svg |
There was a problem hiding this comment.
The image was too wide. I've switched to using the vertical layout for this example: https://gdal--14087.org.readthedocs.build/en/14087/programs/gdal_vector_pipeline.html#programs/gdal_vector_pipeline-4

Add a new vector pipeline example. I have included notes on all the foolish user errors I encountered, in case others do the same.
I added a diagram for the pipeline, which while not complicated, does have clickable links for each of the steps involved which could be useful.
PR also fixes a RST error with existing example title.