Coder Social home page Coder Social logo

Comments (4)

MWieland avatar MWieland commented on August 30, 2024 1

I totally agree with that. So from a user's perspective we would call something like this:

img = Image(array=myarray, crs=mycrs, transform=mytransform, dimorder="first")

This would be more meaningful, less confusing and more flexible (I like the link to easily go from GDAL to ukis-pysat).

from ukis-pysat.

fwfichtner avatar fwfichtner commented on August 30, 2024

OT: Please be aware that you are quoting an old version of write_to_file().

I also don't quite understand what you're doing, img is not a dataset. This method is also not meant to write a new array to file, at least that's not how I intended it, for such purposes I would suggest using rasterio directly with something like this:

        with rasterio.open(
            destination,
            "w",
            driver="GTiff",
            width=ndvi_arr.shape[-1],
            height=ndvi_arr.shape[-2],
            count=1,
            dtype=np.float32,
            transform=self.transform,
        ) as dst:
            dst.write(ndvi_arr, indexes=1)

from ukis-pysat.

MWieland avatar MWieland commented on August 30, 2024

Just edited the above comment. Should be img.dataset.

from ukis-pysat.

fwfichtner avatar fwfichtner commented on August 30, 2024

The dataset is not the dataset you're looking for and this all becomes very confusing then. But I agree that it is very inviting to do something like that.
As an alternative we could consider something else:
Instead of initializing Image with a dataset (itself confusing, GDAL datasets will not work I guess) and array we could initalize it with crs, affine_transform and array. Then we could use an adaption of __update_dataset() to create the correct dataset internally. This would also be nice to go from GDAL to ukis-pysat in memory because you just have to convert the transform.

from ukis-pysat.

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.