ozak / georasters

GeoRasters is a Python module that provides a fast and flexible tool to work with GIS raster files.
GNU General Public License v3.0
198 stars 36 forks source link

No data value error while loading data #24

Closed kritiksoman closed 6 years ago

kritiksoman commented 6 years ago

I have a raster file which has -inf whenever no data is present at a location, georasters seems to not able to handle this:

data2 = load_tiff(raster2) File "/Volumes/MacBookData/dell/anaconda3/envs/geo_env/lib/python2.7/site-packages/gisrastertools/gisrastertools.py", line 190, in load_tiff data=np.ma.masked_array(data, mask=data==NDV,fill_value=-np.inf) File "/Volumes/MacBookData/dell/anaconda3/envs/geo_env/lib/python2.7/site-packages/numpy/ma/core.py", line 2892, in new _data._fill_value = _check_fill_value(fill_value, _data.dtype) File "/Volumes/MacBookData/dell/anaconda3/envs/geo_env/lib/python2.7/site-packages/numpy/ma/core.py", line 477, in _check_fill_value raise TypeError(err_msg % (fill_value, ndtype)) TypeError: Fill value -inf overflows dtype uint8

ozak commented 6 years ago

@realdealcoder from error message it does not seem to be related to my georasters package, but to an older implementation gisrastertools. You should not get this problem with this one and I discourage using gisrastertools as it is not maintained. It was my first trial of what became georasters. Let me know if you still encounter the issue.

kritiksoman commented 6 years ago

ok