-
Notifications
You must be signed in to change notification settings - Fork 758
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 case insensitive gridname #1121
Comments
I think this would be a nice feature to have. I am not sure how easy it would be though (it's not like there's an fopen_case_insensitive() around for us to use). And then there's all the obvious problems about correct behaviour when both |
There is a custom fopen in src/pj_fileapi.c, which can be made to be case insensitive with dirent.h's opendir()/readdir()/closedir(), and string.h's strcasecmp(). This should only be for Are there any concerns with allowing case insensitive file opening? |
I agree that it would be a nice feature to have, especially due to making tests behave consistently across platforms. I am, however, still undecided whether the nicety is sufficient to support it. The reason is the question of "where should we stop": Prime meridians (option '+pm') are typically proper nouns (Greenwich, Oslo, Copenhagen, etc), but are implemented without initial cap (greenwich, oslo, copenhagen). Also many projections are named after their inventor or implementor (Mercator, Bonne, Lambert, etc.) - would we allow grammatically correct spelling here as well? I do not yet have a firm opinion on this, but I think it should be discussed in depth before going on. |
I think this is the important focus point. I get you point regarding capitalization of various other entities but as it is now they at least behave consistently: If you try to set the prime meridian to I have two concerns with this issue:
|
I'm concerned this could lead to many edge cases and unintended consequences. |
I've done a rough implementation similar to fcaseopen's casepath(), which seems to work well in src/pj_fileapi.c, which will open
I'm rewriting my rough implementation to use the same style of C that I see in PROJ (e.g. char arrays). But whatever PR I'll put forward, it won't add any files, and would only require dirent.h (from the C POSIX library) for non-Windows systems.
Same. I can't think of any yet, except that I'll need to go thru e.g. pj_open_lib to see how it's used to open certain files, and see if it's anything surprising. |
Oh and quickly on the topic of other case-sensitive matters of the PROJ string, other non-file tokens are case sensitive. There are case sensitive keys with different definitions, e.g., the ellipsoid parameters |
My $0.02: I recommend on insisting on a specific capitalization of files (and disallowing files with names that differ only in capitalization). I realize that using the wrong capitalization might work on case insensitive systems. But the documentation should flag this as deprecated. In the long run, this rule leads to more predicable behavior. |
There's a mix of opinions here, although with a slight preference towards keeping the status quo. Let me offer a solution that at least attempt to fix the problem that started this discussion (various spellings of The most prominent place the If we change the Is this a way forward that everyone is happy with? |
As long as there no move to change the default behavior, I'm good. I agree with @cffk that the proposal is fraught and very likely to cause more confusion than it eliminates. |
The status quo is fine, as this does not seem to be a widespread issue in the real world. It's also possible to rewrite stdio_fopen to be case sensitive for everyone, but this may also cause unnecessary issues for some, and I can't say I'm on-board for that option. As for the |
File names provided to
nadgrids
andgeoidgrids
are case sensitive on most POSTIX systems (there are some exceptions, like macOS with HFS+). This means PROJ examples that use gridshift file resources behave differently between (e.g.) macOS and Linux:Should we allow PROJ to use case insensitive grid file names for these parameters? And to reiterate, it is already case insensitive on Microsoft Windows and most macOS, so this would only change the behaviour for other POSIX systems (e.g. Linux).
The text was updated successfully, but these errors were encountered: