Skip to content

Conversation

@Sionigdha
Copy link
Contributor

This plugs the --fid option of gdal vector info into the existing
-fid option handled by GDALVectorInfo(), without re-implementing
any logic at the algorithm layer.
fixes #13763

@rouault
Copy link
Member

rouault commented Feb 11, 2026

Please add a test

@rouault
Copy link
Member

rouault commented Feb 11, 2026

@Sionigdha Please test locally your changes before comitting, in particular the new test you've added, to avoid burning CI time that is shared with other contributors.

@Sionigdha
Copy link
Contributor Author

@rouault Thanks for the feedback. I’ll run the new test locally and make sure everything passes before pushing further updates.

@Sionigdha
Copy link
Contributor Author

I attempted to set up a full local GDAL build on Windows but wasn’t able to complete it yet. I’ve reviewed the implementation carefully, aligned it with existing argument patterns, and fixed CI issues iteratively. Please let me know if further changes are required.

assert len(j["layers"][0]["features"]) == 1
assert j["layers"][0]["features"][0]["fid"] == 0

assert "fid" in j["layers"][0]["features"][0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change ? The original test was more appropriate. We want to check that the returned feature has the fid we specified

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You’re right ,restoring the original assertion makes more sense since we want to verify that the returned feature matches the requested FID. I will be reverting to checking equality.

@rouault
Copy link
Member

rouault commented Feb 12, 2026

I attempted to set up a full local GDAL build on Windows but wasn’t able to complete it yet.

see https://gdal.org/en/stable/development/dev_environment.html#building-on-windows-with-conda-dependencies-and-visual-studio

.SetRemoveSQLCommentsEnabled();
AddArg("fid", 0, _("Feature identifier"), &m_fid)
.SetMetaVar("FID")
.SetMutualExclusionGroup("layer-sql")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing ;

}
if (m_fid >= 0)
{
aosOptions.AddString("-fid");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong indentation...

sigh... please be respectful of maintainer time, and submit commits that build, and setup pre-commit as indicated in https://gdal.org/en/stable/development/dev_practices.html#commit-hooks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the formatting and build issues I’ve fixed them and will set up the pre-commit hooks and run first to prevent this in future.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gdal vector info: add --fid option

2 participants