georasters
                                
                                
                                
                                    georasters copied to clipboard
                            
                            
                            
                        Open file and immediately save it makes exception
I open ASTER DEM file with such simple code: ds = gr.from_file(input_file) ds.to_tiff('/tmp/test')
And it makes exception:
  File "store_gridfs.py", line 13, in main
ds.to_tiff('/tmp/test')
  File ".../georasters.py", line 478, in to_tiff
self.raster.data[self.raster.mask] = self.nodata_value
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
I tried shielding it with an if closure, but then it made another exception:
  File ".../georasters.py", line 122, in create_geotiff
    if isinstance(datatype, np.int) == False:
  File "/usr/local/lib/python3.6/dist-packages/numpy/ma/core.py", line 3353, in __setitem__
    _data[indx] = dval
You usually expect open and save methods to work seamlessly.
In #33 , I added checks of masked data length and converting ndv to double. But check if it works in earlier python versions.
I wonder if this is related to #28? What do you get when requesting ds.nodata_value? I thought about forcing a NDV on the raster fi missing, but that may cause issues so perhaps it would be best to just add an error message that is more informative.
@culebron were you able to test this (#33)? Or can you share the file you were using?