Giter Club home page Giter Club logo

Comments (4)

metasim avatar metasim commented on July 25, 2024 1

I find this super frustrating also. As a point of comparison, I have this sort of thing all over my code:

match &raster.cell_type {
    CellType::UInt8 => write_dataset(&raster.data.cast_as::<u8>(), &raster.mask, self),
    CellType::UInt16 => write_dataset(&raster.data.cast_as::<u16>(), &raster.mask, self),
    CellType::UInt32 => write_dataset(&raster.data.cast_as::<u32>(), &raster.mask, self),
    CellType::Int16 => write_dataset(&raster.data.cast_as::<i16>(), &raster.mask, self),
    CellType::Int32 => write_dataset(&raster.data.cast_as::<i32>(), &raster.mask, self),
    CellType::Float32 => write_dataset(&raster.data.cast_as::<f32>(), &raster.mask, self),
    CellType::Float64 => write_dataset(&raster.data.cast_as::<f64>(), &raster.mask, self),
}

As an antidote, i've been working on a side project called erased-cells to allow for compile-time-deferred celltype handling. No GDAL connector yet, but will currently have to gdal_sys directly to get everything I need. :(

from gdal.

metasim avatar metasim commented on July 25, 2024 1

ooof 🤢

from gdal.

jdroenner avatar jdroenner commented on July 25, 2024

i guess that depends how you use it. I usually want to read data with the type of the dataset and when creating a dataset i want that to have the type of the data. In both cases it is nice to use the same generic T for rasterio and driver/band creation.
I guess we can also add another method where the type is provided as a parameter.

from gdal.

lnicola avatar lnicola commented on July 25, 2024

I just realized it's create_with_band_type_with_options and not create_with_band_type_and_options 😅.

Time for a create_with_explicit_band_type_with_options? 😄

from gdal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.