PostGIS  2.1.10dev-r@@SVN_REVISION@@
def raster2pgsql.wkblify (   fmt,
  data 
)
Writes raw binary data into HEX-encoded string using binascii module.

Definition at line 654 of file raster2pgsql.py.

References fmt2printfmt(), and logit().

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

654 def wkblify(fmt, data):
655  """Writes raw binary data into HEX-encoded string using binascii module."""
656  import struct
657 
658  # Binary to HEX
659  fmt_little = '<' +fmt
660  hexstr = binascii.hexlify(struct.pack(fmt_little, data)).upper()
661 
662  # String'ify raw value for log
663  valfmt = '\'' + fmt2printfmt(fmt[len(fmt) - 1]) + '\''
664  val = valfmt % data
665  logit('HEX (\'fmt=%s\', bytes=%d, val=%s):\t\t%s\n' \
666  % (fmt, len(hexstr) / 2, str(val), hexstr))
667 
668  return hexstr
669 
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: