rasterio “invalid dtype: 'bool'”Python, GDAL, VRT: help wth code efficiency and processing timeGDAL (or other open-source) equivalent of Arc's Point To Raster ToolCalculating NDVI with RasterioReading raster files by block with rasterio?First time rasterio errorUpdate geotiff metadata with rasterioRasterio write_band output has no CRSRasterizing by attribute in rasterioCannot upscale raster with rasterioStoring image with rasterio as gtiff modifies image histogram
What actually is "unallocated space"?
First author doesn't want a co-author to read the whole paper
Labeling lines that are not within polygons using field calculator
Russian Caesar cipher
Company indirectly discriminating against introverts, specifically INTJ
Make mapping that accepts count independent of line count
Who discovered the covering homomorphism between SU(2) and SO(3)?
What is this "very, very powerful article" that Trump is referring to vis à vis the Kurds?
Did the US push the Kurds to lower their defences against Turkey in the months preceding the latest Turkish military operation against them?
I run daily 5kms but I cant seem to improve stamina when playing soccer
Car as a good investment
Why were germanium diodes so fast and germanium transisters so slow?
How can the mourner remarry within one month, if he has to wait two regalim?
Is it allowed to let the engine of an aircraft idle without a pilot in the plane. (For both helicopters and aeroplanes)
How can I make a smooth transition from being a Black-Box Tester to an expert Automation Engineer?
How much does freezing grapes longer sweeten them more?
Why is Mars cold?
Did I Traumatize My Puppy?
Is it unusual that English uses possessive for past tense?
Did it take 3 minutes to reload a musket when the second amendment to the US constitution was ratified?
If we should encrypt the message rather than the method of transfer, why do we care about wifi security? Is this just security theatre?
Digit Date Range
If you revoke a certificate authority's certificate, do all of the certificates it issued become invalid as well?
Can elves trance in armor without any downsides?
rasterio “invalid dtype: 'bool'”
Python, GDAL, VRT: help wth code efficiency and processing timeGDAL (or other open-source) equivalent of Arc's Point To Raster ToolCalculating NDVI with RasterioReading raster files by block with rasterio?First time rasterio errorUpdate geotiff metadata with rasterioRasterio write_band output has no CRSRasterizing by attribute in rasterioCannot upscale raster with rasterioStoring image with rasterio as gtiff modifies image histogram
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
I want to write a binary raster to disk. I have the numpy array whose dtype is:
dtype('bool')
I try to open a GTiff for writing:
img_output = rasterio.open(
"../../binary_output.tif",
'w',
driver='GTiff',
nodata=nd,
height=self.raster.height,
width = self.raster.width,
count=1,
dtype = binary_raster.dtype,
crs=self.raster.crs,
transform=self.raster.transform,)
But I end up with:
TypeError: invalid dtype: 'bool'
I have also tried things like:
dtype = bool
dtype = 'bool'
dtype = "bool"
What is the problem with this? According to the docs, dtype can be any numpy dtype. How do I write a binary raster?
python raster gdal rasterio
add a comment
|
I want to write a binary raster to disk. I have the numpy array whose dtype is:
dtype('bool')
I try to open a GTiff for writing:
img_output = rasterio.open(
"../../binary_output.tif",
'w',
driver='GTiff',
nodata=nd,
height=self.raster.height,
width = self.raster.width,
count=1,
dtype = binary_raster.dtype,
crs=self.raster.crs,
transform=self.raster.transform,)
But I end up with:
TypeError: invalid dtype: 'bool'
I have also tried things like:
dtype = bool
dtype = 'bool'
dtype = "bool"
What is the problem with this? According to the docs, dtype can be any numpy dtype. How do I write a binary raster?
python raster gdal rasterio
add a comment
|
I want to write a binary raster to disk. I have the numpy array whose dtype is:
dtype('bool')
I try to open a GTiff for writing:
img_output = rasterio.open(
"../../binary_output.tif",
'w',
driver='GTiff',
nodata=nd,
height=self.raster.height,
width = self.raster.width,
count=1,
dtype = binary_raster.dtype,
crs=self.raster.crs,
transform=self.raster.transform,)
But I end up with:
TypeError: invalid dtype: 'bool'
I have also tried things like:
dtype = bool
dtype = 'bool'
dtype = "bool"
What is the problem with this? According to the docs, dtype can be any numpy dtype. How do I write a binary raster?
python raster gdal rasterio
I want to write a binary raster to disk. I have the numpy array whose dtype is:
dtype('bool')
I try to open a GTiff for writing:
img_output = rasterio.open(
"../../binary_output.tif",
'w',
driver='GTiff',
nodata=nd,
height=self.raster.height,
width = self.raster.width,
count=1,
dtype = binary_raster.dtype,
crs=self.raster.crs,
transform=self.raster.transform,)
But I end up with:
TypeError: invalid dtype: 'bool'
I have also tried things like:
dtype = bool
dtype = 'bool'
dtype = "bool"
What is the problem with this? According to the docs, dtype can be any numpy dtype. How do I write a binary raster?
python raster gdal rasterio
python raster gdal rasterio
asked 8 hours ago
Jan PislJan Pisl
848 bronze badges
848 bronze badges
add a comment
|
add a comment
|
2 Answers
2
active
oldest
votes
If you call rasterio.dtypes.check_dtype(np.bool_)
you'll see that it's not a known dtype, because gdal doesn't support a true 1-bit dtype. GDT_Byte
is the smallest. The list that rasterio is checking against is:
dtype_fwd =
0: None, # GDT_Unknown
1: ubyte, # GDT_Byte
2: uint16, # GDT_UInt16
3: int16, # GDT_Int16
4: uint32, # GDT_UInt32
5: int32, # GDT_Int32
6: float32, # GDT_Float32
7: float64, # GDT_Float64
8: complex_, # GDT_CInt16
9: complex_, # GDT_CInt32
10: complex64, # GDT_CFloat32
11: complex128 # GDT_CFloat64
uint8
and int8
are mapped to the ubyte
, as seen here:
https://github.com/mapbox/rasterio/blob/master/rasterio/dtypes.py#L29-L45
ah, okay, thanks. do you perhaps have any suggestion how to store a binary raster then?
– Jan Pisl
7 hours ago
i might be missing something but it seems very strange to me that bool dtype is not an option. surely, storing a boolean raster must be a common task.
– Jan Pisl
7 hours ago
2
I'd just save it as a byte raster only containing the values0,1
. You can useyour_array.astype(np.uint8)
before saving it out, and then if you load it later you can do the reverse if necessary,your_array.astype(np.bool_)
. I'm not sure of the exact reasons behind gdal not having a 1-bit data type, but it potentially it has to do with the fact that a byte is the minimum addressable unit of data on most computer systems, so it's common to use a whole byte to store a boolean value. Doing so is less memory efficient but more computationally efficient.
– mikewatt
6 hours ago
1
This is generally correct, except that the underlying GDAL GeoTIFF driver can write datasets with nbits < 8, see my answer for details.
– user2856
4 hours ago
Oh neat, I never noticed that creation option
– mikewatt
3 hours ago
add a comment
|
Yes, you can write a one bit raster with rasterio*.
You need to:
- write to a format that supports a 1bit dataset, such as GeoTIFF;
- ensure your numpy array is
np.uint8/ubyte
so rasterio doesnt raise theTypeError: invalid dtype: 'bool'
exception; and - pass the
NBITS=1
creation option to tell the underlying GDAL GeoTIFF driver to create a one bit file.
import numpy as np
import rasterio as rio
with rio.open('test_byte.tif') as src:
data = src.read()
profile = src.profile
with rio.open('test_bit.tif', 'w', nbits=1, **profile) as dst:
dst.write(data)
# If your array is not a byte dtype, you need to cast it as ubyte/uint8
# dst.write(data.astype(np.uint8))
$ ls -sh test_bit.tif
228K test_bit.tif
$ ls -sh test_byte.tif
1.8M test_byte.tif
$ gdalinfo test_bit.tif
Driver: GTiff/GeoTIFF
Files: test_bit.tif
Size is 1588, 1167
<snip...>
Band 1 Block=1588x41 Type=Byte, ColorInterp=Palette
Image Structure Metadata:
NBITS=1
$ gdalinfo test_byte.tif
Driver: GTiff/GeoTIFF
Files: test_byte.tif
Size is 1588, 1167
<snip...>
Band 1 Block=1588x5 Type=Byte, ColorInterp=Gray
* whether or not any software other than GDAL based can read it, I don't know...
add a comment
|
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "79"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f338410%2frasterio-invalid-dtype-bool%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you call rasterio.dtypes.check_dtype(np.bool_)
you'll see that it's not a known dtype, because gdal doesn't support a true 1-bit dtype. GDT_Byte
is the smallest. The list that rasterio is checking against is:
dtype_fwd =
0: None, # GDT_Unknown
1: ubyte, # GDT_Byte
2: uint16, # GDT_UInt16
3: int16, # GDT_Int16
4: uint32, # GDT_UInt32
5: int32, # GDT_Int32
6: float32, # GDT_Float32
7: float64, # GDT_Float64
8: complex_, # GDT_CInt16
9: complex_, # GDT_CInt32
10: complex64, # GDT_CFloat32
11: complex128 # GDT_CFloat64
uint8
and int8
are mapped to the ubyte
, as seen here:
https://github.com/mapbox/rasterio/blob/master/rasterio/dtypes.py#L29-L45
ah, okay, thanks. do you perhaps have any suggestion how to store a binary raster then?
– Jan Pisl
7 hours ago
i might be missing something but it seems very strange to me that bool dtype is not an option. surely, storing a boolean raster must be a common task.
– Jan Pisl
7 hours ago
2
I'd just save it as a byte raster only containing the values0,1
. You can useyour_array.astype(np.uint8)
before saving it out, and then if you load it later you can do the reverse if necessary,your_array.astype(np.bool_)
. I'm not sure of the exact reasons behind gdal not having a 1-bit data type, but it potentially it has to do with the fact that a byte is the minimum addressable unit of data on most computer systems, so it's common to use a whole byte to store a boolean value. Doing so is less memory efficient but more computationally efficient.
– mikewatt
6 hours ago
1
This is generally correct, except that the underlying GDAL GeoTIFF driver can write datasets with nbits < 8, see my answer for details.
– user2856
4 hours ago
Oh neat, I never noticed that creation option
– mikewatt
3 hours ago
add a comment
|
If you call rasterio.dtypes.check_dtype(np.bool_)
you'll see that it's not a known dtype, because gdal doesn't support a true 1-bit dtype. GDT_Byte
is the smallest. The list that rasterio is checking against is:
dtype_fwd =
0: None, # GDT_Unknown
1: ubyte, # GDT_Byte
2: uint16, # GDT_UInt16
3: int16, # GDT_Int16
4: uint32, # GDT_UInt32
5: int32, # GDT_Int32
6: float32, # GDT_Float32
7: float64, # GDT_Float64
8: complex_, # GDT_CInt16
9: complex_, # GDT_CInt32
10: complex64, # GDT_CFloat32
11: complex128 # GDT_CFloat64
uint8
and int8
are mapped to the ubyte
, as seen here:
https://github.com/mapbox/rasterio/blob/master/rasterio/dtypes.py#L29-L45
ah, okay, thanks. do you perhaps have any suggestion how to store a binary raster then?
– Jan Pisl
7 hours ago
i might be missing something but it seems very strange to me that bool dtype is not an option. surely, storing a boolean raster must be a common task.
– Jan Pisl
7 hours ago
2
I'd just save it as a byte raster only containing the values0,1
. You can useyour_array.astype(np.uint8)
before saving it out, and then if you load it later you can do the reverse if necessary,your_array.astype(np.bool_)
. I'm not sure of the exact reasons behind gdal not having a 1-bit data type, but it potentially it has to do with the fact that a byte is the minimum addressable unit of data on most computer systems, so it's common to use a whole byte to store a boolean value. Doing so is less memory efficient but more computationally efficient.
– mikewatt
6 hours ago
1
This is generally correct, except that the underlying GDAL GeoTIFF driver can write datasets with nbits < 8, see my answer for details.
– user2856
4 hours ago
Oh neat, I never noticed that creation option
– mikewatt
3 hours ago
add a comment
|
If you call rasterio.dtypes.check_dtype(np.bool_)
you'll see that it's not a known dtype, because gdal doesn't support a true 1-bit dtype. GDT_Byte
is the smallest. The list that rasterio is checking against is:
dtype_fwd =
0: None, # GDT_Unknown
1: ubyte, # GDT_Byte
2: uint16, # GDT_UInt16
3: int16, # GDT_Int16
4: uint32, # GDT_UInt32
5: int32, # GDT_Int32
6: float32, # GDT_Float32
7: float64, # GDT_Float64
8: complex_, # GDT_CInt16
9: complex_, # GDT_CInt32
10: complex64, # GDT_CFloat32
11: complex128 # GDT_CFloat64
uint8
and int8
are mapped to the ubyte
, as seen here:
https://github.com/mapbox/rasterio/blob/master/rasterio/dtypes.py#L29-L45
If you call rasterio.dtypes.check_dtype(np.bool_)
you'll see that it's not a known dtype, because gdal doesn't support a true 1-bit dtype. GDT_Byte
is the smallest. The list that rasterio is checking against is:
dtype_fwd =
0: None, # GDT_Unknown
1: ubyte, # GDT_Byte
2: uint16, # GDT_UInt16
3: int16, # GDT_Int16
4: uint32, # GDT_UInt32
5: int32, # GDT_Int32
6: float32, # GDT_Float32
7: float64, # GDT_Float64
8: complex_, # GDT_CInt16
9: complex_, # GDT_CInt32
10: complex64, # GDT_CFloat32
11: complex128 # GDT_CFloat64
uint8
and int8
are mapped to the ubyte
, as seen here:
https://github.com/mapbox/rasterio/blob/master/rasterio/dtypes.py#L29-L45
answered 7 hours ago
mikewattmikewatt
1,3343 silver badges12 bronze badges
1,3343 silver badges12 bronze badges
ah, okay, thanks. do you perhaps have any suggestion how to store a binary raster then?
– Jan Pisl
7 hours ago
i might be missing something but it seems very strange to me that bool dtype is not an option. surely, storing a boolean raster must be a common task.
– Jan Pisl
7 hours ago
2
I'd just save it as a byte raster only containing the values0,1
. You can useyour_array.astype(np.uint8)
before saving it out, and then if you load it later you can do the reverse if necessary,your_array.astype(np.bool_)
. I'm not sure of the exact reasons behind gdal not having a 1-bit data type, but it potentially it has to do with the fact that a byte is the minimum addressable unit of data on most computer systems, so it's common to use a whole byte to store a boolean value. Doing so is less memory efficient but more computationally efficient.
– mikewatt
6 hours ago
1
This is generally correct, except that the underlying GDAL GeoTIFF driver can write datasets with nbits < 8, see my answer for details.
– user2856
4 hours ago
Oh neat, I never noticed that creation option
– mikewatt
3 hours ago
add a comment
|
ah, okay, thanks. do you perhaps have any suggestion how to store a binary raster then?
– Jan Pisl
7 hours ago
i might be missing something but it seems very strange to me that bool dtype is not an option. surely, storing a boolean raster must be a common task.
– Jan Pisl
7 hours ago
2
I'd just save it as a byte raster only containing the values0,1
. You can useyour_array.astype(np.uint8)
before saving it out, and then if you load it later you can do the reverse if necessary,your_array.astype(np.bool_)
. I'm not sure of the exact reasons behind gdal not having a 1-bit data type, but it potentially it has to do with the fact that a byte is the minimum addressable unit of data on most computer systems, so it's common to use a whole byte to store a boolean value. Doing so is less memory efficient but more computationally efficient.
– mikewatt
6 hours ago
1
This is generally correct, except that the underlying GDAL GeoTIFF driver can write datasets with nbits < 8, see my answer for details.
– user2856
4 hours ago
Oh neat, I never noticed that creation option
– mikewatt
3 hours ago
ah, okay, thanks. do you perhaps have any suggestion how to store a binary raster then?
– Jan Pisl
7 hours ago
ah, okay, thanks. do you perhaps have any suggestion how to store a binary raster then?
– Jan Pisl
7 hours ago
i might be missing something but it seems very strange to me that bool dtype is not an option. surely, storing a boolean raster must be a common task.
– Jan Pisl
7 hours ago
i might be missing something but it seems very strange to me that bool dtype is not an option. surely, storing a boolean raster must be a common task.
– Jan Pisl
7 hours ago
2
2
I'd just save it as a byte raster only containing the values
0,1
. You can use your_array.astype(np.uint8)
before saving it out, and then if you load it later you can do the reverse if necessary, your_array.astype(np.bool_)
. I'm not sure of the exact reasons behind gdal not having a 1-bit data type, but it potentially it has to do with the fact that a byte is the minimum addressable unit of data on most computer systems, so it's common to use a whole byte to store a boolean value. Doing so is less memory efficient but more computationally efficient.– mikewatt
6 hours ago
I'd just save it as a byte raster only containing the values
0,1
. You can use your_array.astype(np.uint8)
before saving it out, and then if you load it later you can do the reverse if necessary, your_array.astype(np.bool_)
. I'm not sure of the exact reasons behind gdal not having a 1-bit data type, but it potentially it has to do with the fact that a byte is the minimum addressable unit of data on most computer systems, so it's common to use a whole byte to store a boolean value. Doing so is less memory efficient but more computationally efficient.– mikewatt
6 hours ago
1
1
This is generally correct, except that the underlying GDAL GeoTIFF driver can write datasets with nbits < 8, see my answer for details.
– user2856
4 hours ago
This is generally correct, except that the underlying GDAL GeoTIFF driver can write datasets with nbits < 8, see my answer for details.
– user2856
4 hours ago
Oh neat, I never noticed that creation option
– mikewatt
3 hours ago
Oh neat, I never noticed that creation option
– mikewatt
3 hours ago
add a comment
|
Yes, you can write a one bit raster with rasterio*.
You need to:
- write to a format that supports a 1bit dataset, such as GeoTIFF;
- ensure your numpy array is
np.uint8/ubyte
so rasterio doesnt raise theTypeError: invalid dtype: 'bool'
exception; and - pass the
NBITS=1
creation option to tell the underlying GDAL GeoTIFF driver to create a one bit file.
import numpy as np
import rasterio as rio
with rio.open('test_byte.tif') as src:
data = src.read()
profile = src.profile
with rio.open('test_bit.tif', 'w', nbits=1, **profile) as dst:
dst.write(data)
# If your array is not a byte dtype, you need to cast it as ubyte/uint8
# dst.write(data.astype(np.uint8))
$ ls -sh test_bit.tif
228K test_bit.tif
$ ls -sh test_byte.tif
1.8M test_byte.tif
$ gdalinfo test_bit.tif
Driver: GTiff/GeoTIFF
Files: test_bit.tif
Size is 1588, 1167
<snip...>
Band 1 Block=1588x41 Type=Byte, ColorInterp=Palette
Image Structure Metadata:
NBITS=1
$ gdalinfo test_byte.tif
Driver: GTiff/GeoTIFF
Files: test_byte.tif
Size is 1588, 1167
<snip...>
Band 1 Block=1588x5 Type=Byte, ColorInterp=Gray
* whether or not any software other than GDAL based can read it, I don't know...
add a comment
|
Yes, you can write a one bit raster with rasterio*.
You need to:
- write to a format that supports a 1bit dataset, such as GeoTIFF;
- ensure your numpy array is
np.uint8/ubyte
so rasterio doesnt raise theTypeError: invalid dtype: 'bool'
exception; and - pass the
NBITS=1
creation option to tell the underlying GDAL GeoTIFF driver to create a one bit file.
import numpy as np
import rasterio as rio
with rio.open('test_byte.tif') as src:
data = src.read()
profile = src.profile
with rio.open('test_bit.tif', 'w', nbits=1, **profile) as dst:
dst.write(data)
# If your array is not a byte dtype, you need to cast it as ubyte/uint8
# dst.write(data.astype(np.uint8))
$ ls -sh test_bit.tif
228K test_bit.tif
$ ls -sh test_byte.tif
1.8M test_byte.tif
$ gdalinfo test_bit.tif
Driver: GTiff/GeoTIFF
Files: test_bit.tif
Size is 1588, 1167
<snip...>
Band 1 Block=1588x41 Type=Byte, ColorInterp=Palette
Image Structure Metadata:
NBITS=1
$ gdalinfo test_byte.tif
Driver: GTiff/GeoTIFF
Files: test_byte.tif
Size is 1588, 1167
<snip...>
Band 1 Block=1588x5 Type=Byte, ColorInterp=Gray
* whether or not any software other than GDAL based can read it, I don't know...
add a comment
|
Yes, you can write a one bit raster with rasterio*.
You need to:
- write to a format that supports a 1bit dataset, such as GeoTIFF;
- ensure your numpy array is
np.uint8/ubyte
so rasterio doesnt raise theTypeError: invalid dtype: 'bool'
exception; and - pass the
NBITS=1
creation option to tell the underlying GDAL GeoTIFF driver to create a one bit file.
import numpy as np
import rasterio as rio
with rio.open('test_byte.tif') as src:
data = src.read()
profile = src.profile
with rio.open('test_bit.tif', 'w', nbits=1, **profile) as dst:
dst.write(data)
# If your array is not a byte dtype, you need to cast it as ubyte/uint8
# dst.write(data.astype(np.uint8))
$ ls -sh test_bit.tif
228K test_bit.tif
$ ls -sh test_byte.tif
1.8M test_byte.tif
$ gdalinfo test_bit.tif
Driver: GTiff/GeoTIFF
Files: test_bit.tif
Size is 1588, 1167
<snip...>
Band 1 Block=1588x41 Type=Byte, ColorInterp=Palette
Image Structure Metadata:
NBITS=1
$ gdalinfo test_byte.tif
Driver: GTiff/GeoTIFF
Files: test_byte.tif
Size is 1588, 1167
<snip...>
Band 1 Block=1588x5 Type=Byte, ColorInterp=Gray
* whether or not any software other than GDAL based can read it, I don't know...
Yes, you can write a one bit raster with rasterio*.
You need to:
- write to a format that supports a 1bit dataset, such as GeoTIFF;
- ensure your numpy array is
np.uint8/ubyte
so rasterio doesnt raise theTypeError: invalid dtype: 'bool'
exception; and - pass the
NBITS=1
creation option to tell the underlying GDAL GeoTIFF driver to create a one bit file.
import numpy as np
import rasterio as rio
with rio.open('test_byte.tif') as src:
data = src.read()
profile = src.profile
with rio.open('test_bit.tif', 'w', nbits=1, **profile) as dst:
dst.write(data)
# If your array is not a byte dtype, you need to cast it as ubyte/uint8
# dst.write(data.astype(np.uint8))
$ ls -sh test_bit.tif
228K test_bit.tif
$ ls -sh test_byte.tif
1.8M test_byte.tif
$ gdalinfo test_bit.tif
Driver: GTiff/GeoTIFF
Files: test_bit.tif
Size is 1588, 1167
<snip...>
Band 1 Block=1588x41 Type=Byte, ColorInterp=Palette
Image Structure Metadata:
NBITS=1
$ gdalinfo test_byte.tif
Driver: GTiff/GeoTIFF
Files: test_byte.tif
Size is 1588, 1167
<snip...>
Band 1 Block=1588x5 Type=Byte, ColorInterp=Gray
* whether or not any software other than GDAL based can read it, I don't know...
edited 33 mins ago
answered 4 hours ago
user2856user2856
34.4k2 gold badges65 silver badges114 bronze badges
34.4k2 gold badges65 silver badges114 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f338410%2frasterio-invalid-dtype-bool%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown