-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
gdal.config #5
Comments
Yeah that makes sense to me - I think adding an unset function, and being able to set it per function call would be the best move. It could be done easily in the JS portion of the project to avoid massive amounts of C++ changes, and unset would be added in C++ - want to send a PR? |
I've found a work-around: Yes I agree. It could be interesting to have some helpers like this. |
I think unset or reset would be a fine API addition, and we can do a secondary PR to add a new helper. Something like this could work? Pretty simple and flexible - would be much easier than adding a new gdal.config(tempConfigObject, () => {
// any gdal code here!
}) which would basically just be: gdal.config = (obj, fn) => {
const currentValues = gdal.config.get()
const split = Object.entries(obj)
split.forEach(([ k, v ]) => gdal.config.set(k, v))
fn()
split.forEach(([ k, v ]) => gdal.config.set(k, currentValues[k])
} |
@contra, that could work, just don't do it with the |
Hi,
To open a shapefile with a specific encoding, we have to set
SHAPE_ENCODING
throughgdal.config.set()
.But after that, we are not able to reset this configuration to its original state, allowing other shapefile encodings to be auto-detected.
It could be useful to have an option to unset a config variable, or maybe a config contexte bound to the dataset, and not GDAL itself.
WDYT?
The text was updated successfully, but these errors were encountered: