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

fix: load_tiff in README was undefined #33

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

culebron
Copy link

@culebron culebron commented Mar 20, 2018

fix for #31

@coveralls
Copy link

coveralls commented Mar 20, 2018

Coverage Status

Coverage decreased (-0.09%) to 29.905% when pulling 7c81bf6 on culebron:master into e633a4e on ozak:master.

@ozak
Copy link
Owner

ozak commented Mar 20, 2018

It may be better to just add **kwargs instead of options=None and options= options, no?

@culebron
Copy link
Author

Yes, good idea.

# the '1' is for band 1.
DataSet.SetGeoTransform(geot)
DataSet.SetProjection(projection.ExportToWkt())
# Write the array
DataSet.GetRasterBand(band).WriteArray(Array)
DataSet.GetRasterBand(band).SetNoDataValue(ndv)
DataSet.GetRasterBand(band).SetNoDataValue(np.float64(ndv))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't forcing a np.float64(ndv) force any dataset to become float, even the ones that are integers and so increasing file size?

@ozak
Copy link
Owner

ozak commented Mar 21, 2018

Doesn't forcing a np.float64(ndv) force any dataset to become float, even the ones that are integers and so increasing file size?

@culebron
Copy link
Author

@ozak I didn't test this. I found out that integer numpy matrices can't have None in them, and for integer ones (like ASTER DEM) it's only necessary to have a maksed array, without ndv.

It starts being confusing. Let me see how to run tests.

@ozak
Copy link
Owner

ozak commented Mar 23, 2018

To see the effect of this np.float I would save an integer raster with and without the option to see the difference in size.

I'm not sure I understood what you meant with the last comments... When is None being assigned to a numpy array?

@ozak
Copy link
Owner

ozak commented Mar 23, 2018

Also, how would you have a masked array without an ndv?

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

Successfully merging this pull request may close these issues.

None yet

3 participants