721def wkblify_band_header(options, band):
722 """Writes band header into HEX-encoded WKB"""
723 assert band is not None, "Error: Missing GDAL raster band"
724
725 hexwkb = ""
726
727 first4bits = 0
728
729
730 if options.register:
731 first4bits = 128
732
733 nodata = band.GetNoDataValue()
734
735 if nodata is not None:
736 first4bits += 64
737 else:
738 nodata = 0
739
740
741 pixtype = gdt2pt(band.DataType)['id']
742 hexwkb += wkblify('B', pixtype + first4bits)
743
744
745 hexwkb += wkblify(pt2fmt(pixtype), nodata)
746
747 check_hex(hexwkb)
748 return hexwkb
749