Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow # to comment out gdal options #232

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

maxfreu
Copy link

@maxfreu maxfreu commented Sep 20, 2022

No description provided.

@davidfrantz
Copy link
Owner

This is a good suggestion. But is it enough to test whether # is the 1st char?

Is there any scenario possible where # is part of the gdal option? If not, there might be a more generic solution

@maxfreu
Copy link
Author

maxfreu commented Sep 27, 2022

I have not yet come across any GDAL options containing #. Usually the prefix NUM is used to denote numbers, e.g. NUM_THREADS. There are many drivers and I didn't check all of them, but I think it's pretty safe to assume none of them has # in their options. If there's a more generic solution than this one here, I'm all ears; this was just easy to implement. But it's no way important, I think the drivers neglect all options they dont understand anyway.

@davidfrantz
Copy link
Owner

Yes, that makes sense.
I believe a more generic solution would be to account for this in read_tagvalue()

buffer[strcspn(buffer, "\r\n")] = 0;

I believe this would work:

 buffer[strcspn(buffer, "\r\n#")] = 0;
 if (strlen(buffer) == 0) continue;

This would also allow for things like

BLOCKSIZE = 5# this is the blocksize

@maxfreu maxfreu marked this pull request as draft September 30, 2022 14:31
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.

2 participants