PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ wkblify()

def raster2pgsql.wkblify (   fmt,
  data 
)
Writes raw binary data into HEX-encoded string using binascii module.

Definition at line 652 of file raster2pgsql.py.

References fmt2printfmt(), and logit().

Referenced by wkblify_band(), wkblify_band_header(), and wkblify_raster_header().

652 def wkblify(fmt, data):
653  """Writes raw binary data into HEX-encoded string using binascii module."""
654  import struct
655 
656  # Binary to HEX
657  fmt_little = '<' +fmt
658  hexstr = binascii.hexlify(struct.pack(fmt_little, data)).upper()
659 
660  # String'ify raw value for log
661  valfmt = '\'' + fmt2printfmt(fmt[len(fmt) - 1]) + '\''
662  val = valfmt % data
663  logit('HEX (\'fmt=%s\', bytes=%d, val=%s):\t\t%s\n' \
664  % (fmt, len(hexstr) / 2, str(val), hexstr))
665 
666  return hexstr
667 
def wkblify(fmt, data)
def fmt2printfmt(fmt)
def logit(msg)
Here is the call graph for this function:
Here is the caller graph for this function: