'Return a properly quoted string for use in PostgreSQL/PostGIS.'

def getquoted(self):

    if self.is_geometry:
        return ('%s(%s)' % (('ST_GeogFromWKB' if self.geography else 'ST_GeomFromEWKB'), self._adapter.getquoted().decode()))
    else:
        return ("'%s'::raster" % self.ewkb)
