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

Can add wrapper for GDALAutoCreateWarpedVRT? #549

Open
z954134 opened this issue Aug 2, 2024 · 1 comment
Open

Can add wrapper for GDALAutoCreateWarpedVRT? #549

z954134 opened this issue Aug 2, 2024 · 1 comment

Comments

@z954134
Copy link

z954134 commented Aug 2, 2024

i use this to change gdal2tiles from python to rust,found no GDALAutoCreateWarpedVRT.
pub fn GDALAutoCreateWarpedVRT(src: &Dataset, wkt1:&str, wkt2: &str) -> GDALDatasetH {
let c_str_1 = CString::new(wkt1).unwrap();
let c_ptr_1: *const c_char = c_str_1.as_ptr();
let c_str_2 = CString::new(wkt2).unwrap();
let c_ptr_2: *const c_char = c_str_2.as_ptr();
let rv = unsafe {
gdal_sys::GDALAutoCreateWarpedVRT(
src.c_dataset(),
c_ptr_1,
c_ptr_2,
GDALResampleAlg::GRA_Bilinear,
0.0,
null_mut(),
)
};
rv
}
but this is unsafe,can add this wrapper?

@ChristianBeilschmidt
Copy link
Contributor

Usually, it is okay to add missing functions to the library. Most of them have to wrap unsafe code because of C-pointers.

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

No branches or pull requests

2 participants